-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
I got this error while zooming out in my application:
Uncaught TypeError: Cannot call method 'latLngToLayerPoint' of null leaflet-src.js:4842
L.Polyline.L.Path.extend.projectLatlngs leaflet-src.js:4842
L.Polygon.L.Polyline.extend.projectLatlngs leaflet-src.js:5069
L.Mixin.Events.fireEvent leaflet-src.js:389
L.Map.L.Class.extend._resetView leaflet-src.js:1843
L.Map.include.setView leaflet-src.js:7949
L.Map.ScrollWheelZoom.L.Handler.extend._performZoom leaflet-src.js:6220
(anonymous function)
I believe this is caused by me removing features that have become too small to be visible. I do this removal in the view-reset or zoom-end, which ever hits first.
I guess what's happening is this sequence:
- viewreset event is fired
1.1 get all listeners for this event
1.2 start firing events
1.2.1 my map listeners notices that zoom is too low, so remove a feature which is in the list of listeners (1.1) and set it's _map to null
1.2.2 listener the feature that's been removed is called with its map set to null.
Using leaflet 0.5.1
Metadata
Metadata
Assignees
Labels
No labels