Exception in LatLngBounds.intersects() with chunkedLoading
See original GitHub issueI am currently working on a Map Application loading 1000+ of markers via ajax, clustering them using markerclusters. When enabling chunkedLoading, and only then, I randomly experience the following exception while dragging:
TypeError: ne2 is undefined
L.LatLngBounds.prototype.intersects()
L.MarkerCluster<._recursively()
L.MarkerCluster<._recursivelyRemoveChildrenFromMap()
L.MarkerClusterGroup<._moveEnd()
L.Evented<.fire()
L.Map.Drag<._onDragEnd()
L.Evented<.fire()
L.Draggable<.finishDrag()
L.Draggable<._onUp()
L.DomEvent._on/handler()
It happens in the function L.LatLngBounds.prototype.intersects()
being called from L.MarkerCluster._recursively()
. Since there is no better way to update lots of markers against an external loaded set, updating is done by calling clearLayers()
and addLayers()
. I have tested this issue on recent Firefox and Google Chrome.
Of course the marker update function is bound to “zoomend dragend”, and the mass update calls seem to conflict with the event MarkerClusters is binding itself for clustering functionality, therefore trying to check intersection of already gone markers. Since there is no exception handling, the map cannot be dragged anymore after failing as above.
I think there should either be exception handling, validity or timing checks with chunkedLoading enabled.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:11 (5 by maintainers)
Top GitHub Comments
Hi, I am still getting this same error when opening the map. It happens specifically when used in conjuction with the Leaflet.pm lib used to draw shapes. It’s possibly caused by adding a new shape on the map in the middle of the chunked loading process. Disabling chunkLoading fixes it.
fixed this by disabling chunked loading, only was an issue on IOS in a webview though … strange bug!