Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

5 votes
6 answers
8k views

useLeafletContext() can only be used in a descendant of <MapContainer>

I am in the process of converting a leaflet-map in React into a hook with the use of react-leaflet and react-leaflet-markercluster. Everything worked perfectly except the use of the MarkerCluster ...
julziemoon's user avatar
1 vote
2 answers
4k views

react-leaflet: Clear marker cluster before rendering new markers

TLDR; Is there a way to clear all markers from a marker cluster using react-leaflet and react-leaflet-markercluster? EDIT: Yes, there is! I just added a key prop to the MarkerClusterGroup, as @...
Lucas Bueno Cesario's user avatar
2 votes
1 answer
1k views

Performance issues if MapComponent state is updated

I am not sure if this is an issue of react-leaflet-markercluster, react-leaflet, leaflet, react, or my code. I have a map with several thousand markers and I am using react-leaflet-markercluster for ...
Matt's user avatar
  • 8,763
1 vote
2 answers
1k views

How to remove marker from markercluster

I am using React Leaflet and react-leaflet-markercluster. I have a lot of markers and if parent's state is changed, marker cluster rerendering takes longer time. For this reason, cluster components ...
Matt's user avatar
  • 8,763