simplified circle labels

main
Inga 🏳‍🌈 1 year ago
parent 4315d0301d
commit c675cf36ee
  1. 38
      src/routePlanner/hooks/useMarkersOnMap/getLayersForMarkers.ts

@ -24,26 +24,20 @@ export const getLayersForMarkers = (
]; ];
}), }),
// circles and labels // circles and labels
...markers.flatMap((marker) => { ...markers.map((marker) =>
const circle = leaflet.circleMarker(marker.coordinates, { leaflet
...markerLayersStyle, .circleMarker(marker.coordinates, {
bubblingMouseEvents: false, ...markerLayersStyle.circleStyle,
fill: true, bubblingMouseEvents: false,
fillOpacity: 100, fill: true,
}); fillOpacity: 100,
const tooltip = leaflet })
.tooltip( .on('click', marker.remove)
{ .bindTooltip(marker.shortLabel, {
permanent: true, permanent: true,
direction: 'center', direction: 'center',
className: 'text', className: 'text',
content: marker.shortLabel, content: marker.shortLabel,
}, }),
circle, ),
)
.setLatLng(marker.coordinates);
circle.on('click', marker.remove);
return [circle, tooltip];
}),
]; ];

Loading…
Cancel
Save