stefanocudini / leaflet-search

Search stuff in a Leaflet map
https://opengeo.tech/maps/leaflet-search/
MIT License
772 stars 334 forks source link

Package seems to be interfering with other leaflet packages #303

Closed secondl1ght closed 1 year ago

secondl1ght commented 1 year ago

When I use leaflet-search on it's own it works, but when I use it in combination with some other leaflet packages like leaflet.locatecontrol and leaflet.markercluster it seems to interfere with them by throwing a is not a function Error wherever they are called.

For example this code: let markers = L.markerClusterGroup(); will throw the error: Error: L.markerClusterGroup is not a function

Here is a link to the other packages I am referring to: https://github.com/domoritz/leaflet-locatecontrol https://github.com/Leaflet/Leaflet.markercluster

I would like to be able to use this package with other leaflet packages without conflicts.

Any help on this would be appreciated, thanks!

stefanocudini commented 1 year ago

Error: L.markerClusterGroup is not a function it can't be a problem caused by this library but by your code