Skip to content

Exception in LatLngBounds.intersects() with chunkedLoading #743

@taleteller

Description

@taleteller

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.

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