question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception in LatLngBounds.intersects() with chunkedLoading

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
antholordcommented, Jun 11, 2018

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.

1reaction
davidmann4commented, Dec 4, 2017

fixed this by disabling chunked loading, only was an issue on IOS in a webview though … strange bug!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leaflet.markercluster - Shenchen Liu's website
... Fix chunkedLoading LatLngBounds.intersects() (by @boldtrn) #743 #891 ... Fixed leaflet 1.0.2 bug where clearLayers would throw an exception (by ...
Read more >
@skyraptor/leaflet.markercluster | Yarn - Package Manager
Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps. Requires Leaflet 1.0.0. cluster map example. For a ...
Read more >
ORA_Help___Information...
clearAttributes(),e. ... noWrap||(s=s.wrap(),a=a.wrap()),!e.bounds.intersects([s ... Exception=function(t){var e=Error.prototype.constructor.apply(this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found