Skip to content

Very small maxClusterRadius hangs browser #836

@lucaswerkmeister

Description

@lucaswerkmeister
  • 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.1.0 (also reproduced with 1.2.0)
  • Leaflet.MarkerCluster version I'm using: 1.1.0
  • Browser (with version) I'm using: Firefox 57.0b11
  • OS/Platform (with version) I'm using: Ubuntu 17.10 Artful Aardvark
  • Create a cluster group with at least one layer (it can even be just a single marker)
  • Set its maxClusterRadius to 0 or Number.EPSILON
  • Add it to a map

What behaviour I'm expecting and which behaviour I'm seeing

What I’m looking for is a way to completely disable clustering except for markers with identical coordinates (similar to #399) – that is, I’m only interested in the spidering behavior. I thought setting maxClusterRadius to 0 or Number.EPSILON might achieve this, but instead it hangs the browser.

Note: in Firefox 57.0b11 (aka “Quantum”), the hanging browser is rather recoverable – after about ten seconds, Firefox gives you the opportunity to kill the tab, and in the case of JSFiddle (e. g. the one linked below), it even only kills the iframe containing the map, so you can re-run the JSFiddle to try again. With another browser, YMMV – take care :)

Minimal example reproducing the issue

  • this example is as simple as possible
  • this example does not rely on any third party code

https://jsfiddle.net/vjw4fkqw/5/ (note: opening the fiddle will not yet hang your browser, you have to click one of the two buttons in the output first)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions