Skip to content

Commit

Permalink
Added fix for marker drag
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBirtch-aot committed Aug 6, 2024
1 parent 174dfb1 commit beeb35e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/src/components/Map/services/MapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}

Expand All @@ -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
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit beeb35e

Please sign in to comment.