How Can We Efficiently Render a Large Number of Markers? #604
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
First and foremost, this sounds like a UX problem and not so much a technical one, but let's get over the technical side first anyways. As far as the maps API is concerned, I think a good upper limit for Advanced Markers would be around 500 to 1000, depending on complexity. So 1000 small dots would probably be ok, but 500 full markers with images or such will likely start causing problems. Then you say there will be multiple markers at the same position. This doesn't really make a lot of sense since you can only render a single marker at any position on the map, multiple markers would only cause total chaos :). So some grouping has to be done first, which will already reduce the number of markers you have to add to the map. Maybe it also makes sense to only add markers to the map that are within the bounds of the map, not sure how much optimization the maps API does here automatically. And finally, with this amount of markers I would consider declaring this a data-visualization problem, and use something like a deck.gl scatterplot layer on top of the map instead of using AdvancedMarkers. |
Beta Was this translation helpful? Give feedback.
First and foremost, this sounds like a UX problem and not so much a technical one, but let's get over the technical side first anyways.
As far as the maps API is concerned, I think a good upper limit for Advanced Markers would be around 500 to 1000, depending on complexity. So 1000 small dots would probably be ok, but 500 full markers with images or such will likely start causing problems.
This is essentially the same for this library, but here you additionally have the same number of react-components to worry about, and you have to make sure that react doesn't accidentally end up constantly re-rendering them.
Then you say there will be multiple markers at the same position. This doesn't …