From 3e2600cbbc100a7e489688a6e5d491e91cc86649 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 11 Aug 2020 19:42:28 +0300 Subject: [PATCH] Fix createed and updated polygon --- .../modules/home/components/widget/lib/maps/leaflet-map.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts index 2193a40882..6f92ef3280 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts @@ -180,7 +180,7 @@ export default abstract class LeafletMap { } addPolygonControl() { - if (this.options.editablePolygon) { + if (this.options.showPolygon && this.options.editablePolygon) { let mousePositionOnMap: L.LatLng[]; let addPolygon: L.Control; this.map.on('mousemove', (e: L.LeafletMouseEvent) => { @@ -195,7 +195,7 @@ export default abstract class LeafletMap { icon.options.shadowSize = [0, 0]; const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map); const datasourcesList = document.createElement('div'); - const customLatLng = {coordinates: this.convertToPolygonFormat(mousePositionOnMap)}; + const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)}; this.datasources.forEach(ds => { const dsItem = document.createElement('p'); dsItem.appendChild(document.createTextNode(ds.entityName));