Spiderifying with a lot of markers breaks page rendering
See original GitHub issue- I’m reporting a bug, not asking for help
- I’m sure this is a Leaflet.MarkerCluster code issue, not an issue with my own code nor with the framework I’m using (Cordova, Ionic, Angular, React…)
- I’ve searched through the issues to make sure it’s not yet reported
How to reproduce
- Leaflet version I’m using: 1.3.1
- Leaflet.MarkerCluster version I’m using: 1.3.0
- Browser (with version) I’m using: Chrome
- OS/Platform (with version) I’m using: Linux
- Clusters at max zoom with ~200+ items
- Spiderify is gliching out the entire page, entire blocks of the page fail to render, crazy stuff. Hard to track down why, I don’t see anything unusual in the DOM. See the weird grey sections to the right and bottom right, and half the table below is cut off O_O
- Zooming back out (which cancels spidering) fixes it and the page renders properly again.
What behaviour I’m expecting and which behaviour I’m seeing
Shouldn’t mangle the page!
I’d be happy with an option that could let me make a workaround, i.e. spiderfyOnMaxZoom
allowing a closure that can return true/false based on some conditions, for example size of the cluster (I could do return clusterSize < 100;
and just not spiderify on really big clusters)
Minimal example reproducing the issue
I’ll have to set up a jsfiddle at some point later, a bit tight on time right now but I should be able to do it later.
Options I’m using:
var cluster = L.markerClusterGroup({
maxClusterRadius: 35,
spiderLegPolylineOptions: { weight: 1, color: '#222', opacity: 0.2 },
chunkedLoading: true,
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
react-leaflet too many markers causes page to freeze
As you can see I'm mapping about 53K markers. The problem is that after I render these markers the webpage is practically unusable...
Read more >Stacking Chips - Showing Many Points that Share the Same ...
Spidering, or spiderifying is a visualization technique where overlapping points can be offset around their mapped location, and visually linked ...
Read more >Markers showing as broken images or not rendering in Maps
When plotting a marker layer in Salesforce Maps you may notice strange behaviour where markers are not rendering on the map and the...
Read more >page 94: marker rendering - YouTube
Video tutorial for page 94 from my book, How To Render.
Read more >Performant Custom Map Markers for React-Native-Maps
Let break down what's happening here: 1. We initialize with tracksViewChanges = true so when the custom marker image loads it will render....
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 FreeTop 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
Top GitHub Comments
LMK when there is a jsfiddle up, looks like maybe we are upsetting the browser, but we could be doing something wrong.
Ah okay @danzel, I see that I can do
c.layer._childCount
(where c is the cluster event), but how do I cancel spidering?return false;
doesn’t cancel that from happening.