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') {