| | |
| | | |
| | | selectedItem.forEach(element => { |
| | | var path = element.shape; |
| | | if (path != null && path != "null" && path != undefined) { |
| | | var positions = getPositionFromLonLat(path.substring(9, path.length - 2)) |
| | | if(path == null && path == "null" && path == undefined){ |
| | | return; |
| | | } |
| | | if (path.substring(0, 1) == "M") { |
| | | var paths = (path.substring(15, path.length - 3)).split(")),(("); |
| | | paths.forEach(element_path => { |
| | | var positions = getPositionFromLonLat(element_path) |
| | | var tmpAttr = deepCopy(element); |
| | | delete tmpAttr['shape']; |
| | | this.addPolygonToMap(layerid, qindex, positions, tmpAttr); |
| | | }); |
| | | } else { |
| | | var positions = getPositionFromLonLat(path.substring(9, path.length - 2)); |
| | | var tmpAttr = deepCopy(element); |
| | | delete tmpAttr['shape']; |
| | | this.addPolygonToMap(layerid, qindex, positions, tmpAttr); |
| | | } |
| | | } |
| | | |
| | | // if (path != null && path != "null" && path != undefined) { |
| | | // var positions = getPositionFromLonLat(path.substring(9, path.length - 2)) |
| | | // var tmpAttr = deepCopy(element); |
| | | // delete tmpAttr['shape']; |
| | | // this.addPolygonToMap(layerid, qindex, positions, tmpAttr); |
| | | // } |
| | | }); |
| | | |
| | | } |