Commit 2bc2624a60063b7a640a97b9b87f3fad6fadaadd
Committed by
GitHub
Merge pull request #3286 from vvlladd28/bugs/map/edit-polygon
Fix createed and updated polygon
Showing
1 changed file
with
2 additions
and
2 deletions
... | ... | @@ -180,7 +180,7 @@ export default abstract class LeafletMap { |
180 | 180 | } |
181 | 181 | |
182 | 182 | addPolygonControl() { |
183 | - if (this.options.editablePolygon) { | |
183 | + if (this.options.showPolygon && this.options.editablePolygon) { | |
184 | 184 | let mousePositionOnMap: L.LatLng[]; |
185 | 185 | let addPolygon: L.Control; |
186 | 186 | this.map.on('mousemove', (e: L.LeafletMouseEvent) => { |
... | ... | @@ -195,7 +195,7 @@ export default abstract class LeafletMap { |
195 | 195 | icon.options.shadowSize = [0, 0]; |
196 | 196 | const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map); |
197 | 197 | const datasourcesList = document.createElement('div'); |
198 | - const customLatLng = {coordinates: this.convertToPolygonFormat(mousePositionOnMap)}; | |
198 | + const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)}; | |
199 | 199 | this.datasources.forEach(ds => { |
200 | 200 | const dsItem = document.createElement('p'); |
201 | 201 | dsItem.appendChild(document.createTextNode(ds.entityName)); | ... | ... |