Uncaught TypeError with release 2.0.0 in combination with MarkerCluster
See original GitHub issueI get an Uncaught TypeError
in the browser console when using the new version 2.0.0.
In Chrome the error message is:
Events.js:190 Uncaught TypeError: Cannot read property 'fn' of undefined
at NewClass.fire (Events.js:190)
at NewClass.removeLayer (Layer.js:200)
at NewClass.eachLayer (LayerGroup.js:123)
at NewClass.onRemove (LayerGroup.js:111)
at NewClass.removeLayer (Layer.js:189)
at NewClass.removeFrom (Layer.js:70)
at NewClass.remove (Layer.js:59)
at NewClass.onRemove (leaflet.markercluster-src.js:648)
at NewClass.removeLayer (Layer.js:189)
at v2.0.0.html:37
In Firefox the error message is:
Uncaught TypeError: l is undefined
fire Events.js:190
removeLayer Layer.js:200
eachLayer LayerGroup.js:123
onRemove LayerGroup.js:111
removeLayer Layer.js:189
removeFrom Layer.js:70
remove Layer.js:59
onRemove leaflet.markercluster-src.js:648
removeLayer Layer.js:189
<anonymous> v2.0.0.html:37
This looks like there is a problem in MarkerCluster, but when I use the old version of leaflet-control-geocoder this problem does not occur.
I’ve created a rudimentary example to comprehend the issue. The only difference is the version number of leaflet-control-geocoder. v1.13.0.html - old version without error v2.0.0.html - new version with error
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: this.callInitHooks is not a function - Stack ...
You have forgot to add new , it should look like: var markers = new L.MarkerClusterGroup();. Else you can the shortcut version with...
Read more >react-leaflet-markercluster - Bountysource
I'm using react-leaflet-markercluster with with children markers and getting TypeError: Cannot read property 'lat' of undefined when I update the markers.
Read more >react-leaflet-markercluster - npm
React wrapper of Leaflet.markercluster for react-laeflet. Latest version: 3.0.0-rc1, last published: 2 years ago.
Read more >Marker Clustering | Maps JavaScript API - Google Developers
This tutorial shows you how to use marker clusters to display a large number of markers on a map. You can use the...
Read more >Leaflet markerClusterGroup 'undefined is not a function'
You should add the script that loads the markercluster plugin after you've loaded the core leaflet application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Eugh, I just spent nearly 2 days trying to figure this. Such a N00b at JS but eventually…got here. Will make sure I version tie from here on in!
Sorry for breaking the event handling with the 2.0.0 release. Bringing together leaflet mixins and TypeScript wasn’t easy and my approach for the 2.0.0 release turned out erroneous. A few minutes ago, I’ve released 2.0.1 which should address this issue.