simplified circle labels

main
Inga 🏳‍🌈 1 year ago
parent 4315d0301d
commit c675cf36ee
  1. 22
      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, {
...markerLayersStyle.circleStyle,
bubblingMouseEvents: false, bubblingMouseEvents: false,
fill: true, fill: true,
fillOpacity: 100, fillOpacity: 100,
}); })
const tooltip = leaflet .on('click', marker.remove)
.tooltip( .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