Leaflet.markercluster
Leaflet.markercluster copied to clipboard
Call to L.markerClusterGroup affecting other groups added to map
- [x] I'm reporting a bug, not asking for help
- [x] I'm sure this is a Leaflet.MarkerCluster code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
- [x] I've searched through the issues to make sure it's not yet reported
How to reproduce
- Leaflet version I'm using: ^1.7.11
- Leaflet.MarkerCluster version I'm using: ^1.5.3
- Browser (with version) I'm using: Tested with Edge and Chrome
- OS/Platform (with version) I'm using: Tested with Linux, MS WIN
- Create a
FeatureGroup
with a singleDivIcon
inside and add it to the map - Create a
MarkerClusterGroup
, add someDivIcons
and add the group to them map - See the
FeatureGroup
'sDivIcon
slide around on the map while zooming, even though it is not part of theMarkerClusterGroup
What behaviour I'm expecting and which behaviour I'm seeing
I am expecting the two groups to be isolated from each other. The effect of the MarkerClusterGroup
should not be applied to the FeatureGroup
. But it is, and we tested it and it happens as soon as we call L.markerClusterGroup()
. If we don't call this function, the FeatureGroup
's marker doesn't slide on the map.
Minimal example reproducing the issue
- [x] this example is as simple as possible
- [x] this example does not rely on any third party code
Using http://leafletjs.com/edit.html or any other jsfiddle-like site.