-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
I 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.