Leaflet.markercluster
Leaflet.markercluster copied to clipboard
There is no way to animate marker movement
- [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.5.1
- Leaflet.MarkerCluster version I'm using: 1.4.1
- Browser (with version) I'm using: Chrome 76.0.3809.132
- OS/Platform (with version) I'm using: macOS Mojave 10.14.6
- step 1: Add marker to map, add moving animation for marker of any of 3 types:
- CSS 3 - simplest
.leaflet-marker-pane > *, .leaflet-shadow-pane > * { transition: transform 1s linear; } - Leaflet.Marker.SlideTo with
.slideTo()- https://gitlab.com/IvanSanchez/Leaflet.Marker.SlideTo - TweenLite - https://greensock.com/tweenlite/
- step 2: Move marker to another point
What behaviour I'm expecting and which behaviour I'm seeing
Marker movement is not animated when used .markerClusterGroup() (even worse when using JS animation). According to my assumptions, this happens due to the re-creation of the div-container with markers each time (leaflet-marker-pane as default).
Is there any way to avoid this? It may be possible to set the timeout for clustering markers equal to the time of 1 cycle of the animation or something like that?
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.
https://plnkr.co/edit/hZ50IHm9g9tBdivrHLhU?p=preview
Having the same issue, I believe setLatLng should animate markers if using something like :
.leaflet-marker-pane > * {
-webkit-transition: transform .3s linear;
-moz-transition: transform .3s linear;
-o-transition: transform .3s linear;
-ms-transition: transform .3s linear;
transition: transform .3s linear;
}
But it does not animate with clustering :(
Please, could we just get some update on this issue? I've been expecting at least a plan on this issue so I can decide wether to wait for the fix or choose an alternative.