question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

example

  • 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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danzelcommented, Jan 29, 2018

LMK when there is a jsfiddle up, looks like maybe we are upsetting the browser, but we could be doing something wrong.

0reactions
francislavoiecommented, Feb 13, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found