From beeb35e4ba383e6428137a7144c521e20241c888 Mon Sep 17 00:00:00 2001 From: RyanBirtch-aot Date: Tue, 6 Aug 2024 23:03:38 +0000 Subject: [PATCH] Added fix for marker drag --- components/src/components/Map/services/MapService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/src/components/Map/services/MapService.ts b/components/src/components/Map/services/MapService.ts index 55aaca367..22b8364ad 100644 --- a/components/src/components/Map/services/MapService.ts +++ b/components/src/components/Map/services/MapService.ts @@ -59,6 +59,9 @@ class MapService { map.on(L.Draw.Event.EDITED, (e) => { options.onDrawnItemsChange(drawnItems.getLayers()); }); + map.on(L.Draw.Event.DRAWSTART, (e) => { + e.layer.setIcon(this.customMarker); + }); } } @@ -85,7 +88,6 @@ class MapService { }).addTo(map); // Initialize Draw Layer let drawnItems = new L.FeatureGroup(); - //({ iconUrl: '../common/marker-icon.png/' }); map.addLayer(drawnItems); // Add Drawing Controllers @@ -159,7 +161,7 @@ class MapService { items.forEach((item) => { let layer; if (item.type === 'marker') { - layer = L.marker(item.coordinates).setIcon(this.customMarker); //layer.setIcon(this.customMarker); + layer = L.marker(item.coordinates).setIcon(this.customMarker); } else if (item.type === 'rectangle') { layer = L.rectangle(item.bounds); } else if (item.type === 'circle') {