Leaflet.markercluster: Uncaught TypeError: Cannot read property 'getMinZoom' of null
I just switched from 1.0.2 (I think) to 1.0.3, when zooming in and out of my map, I get this (during the 3rd or 4th zoom, not right away)
Uncaught TypeError: Cannot read property ‘getMinZoom’ of null at e._recursivelyRemoveChildrenFromMap (leaflet.markercluster-src.js:1712) at leaflet.markercluster-src.js:1349
That line changed from
this._recursively(previousBounds, -1, zoomLevel - 1,
to
this._recursively(previousBounds, this._group._map.getMinZoom() - 1, zoomLevel - 1,
Leaflet is either 1.0.2 or 1.0.3, browser is Chrome latest.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Pull minZoom fetching out to fix errors removing a MCG from a map while an animation is going on. Refs #758 — committed to Leaflet/Leaflet.markercluster by deleted user 7 years ago
Woops! Doing it now…
Thanks, 1.0.4 released
Have pushed up a fix that works for that test.
Please try this version in your app, there are possibly other places the error can occur: https://gist.github.com/danzel/173297195f053e17a61117e90c64e469 If it still breaks somewhere, please paste the stacktrace.
Here it is http://playground-leaflet.rhcloud.com/wexa/5/edit?html,output 🎉 Changing the setTimeout duration to 300 removes the error