Fundamental performance problems with MarkerClusterer
See original GitHub issueI have tried and failed to resolve performance problems with having many markers using the MarkerClusterer. I now believe that the performance issue is an architectural limitation caused by the fact that for each Marker a <div></div>
is rendered and performance decreases lineairly with increasing numbers of markers.
The MarkerClusterer is intended to deal with many markers and it’s not working as advertised. I would recommend rewriting this and use the clusterer api more directly, avoiding a dom node for every marker. I can share the code I wrote based google-map-react
as I was forced to move away from react-google-maps
. Certainly not as elegant as it could be, but I was under a time crunch.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:8
Top Results From Across the Web
reactjs - Performance issues if MapComponent state is updated
I have a map with several thousand markers and I am using react-leaflet-markercluster for marker clustering. If I need to update a global...
Read more >Performance issues with (clustered) point features
Therefore, I tried clustering using https://github.com/Leaflet/Leaflet.markercluster. There are still performance issues because all 2800 ...
Read more >MarkerClusterer jump to zoom level on click issue
markerclusterer jumps to the next zoom level and shows the same cluster icon with the same number of markers. On the next click...
Read more >Rethinking the usage and experience of clustering markers in ...
Therefore basic aggregation libraries using clustering methods were ... many others, considers only a subset of the performance issue – by ...
Read more >Improving Google Maps Performance on Large Datasets
Feature image: Improving Google Maps Performance on Large Datasets ... + import MarkerClusterer from '@google/markerclustererplus';.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I had the same problem. I was helped to hand over the prop “noRedraw” to the marker. The problem is that otherwise for every marker that is added or deleted the entire card is reloaded.
My own marker drawing code is a bit janky due to excessive reloads from the server, but it does seem like banning all redraws caused a bug where non-clustered points disappeared.
If you’re coming ere from google, what you actually probably want is to do something like this as long as you know how many markers you’re going to add ahead of time:
Depending, of course, on your own personal code style preferences. I prefer
if
/else
to inline ternary operators. In a language were function calls weren’t so miserably slow, I’d also factor that out to a function 😃