PruneCluster
PruneCluster copied to clipboard
after forceIconRedraw dont work move anim
when I use forceIconRedraw and set f.e. markers[i].data.icon = L.divIcon({ className: 'leaflet-div-icon' }); move anim stops work, just markers jump from one position to other. I think it is for class 'prunecluster-anim' disappear from icon node. For solve it change PrepareLeafletMarker, Im not sure if it is best solution.
PrepareLeafletMarker: function (marker, data, category) {
if (data.icon) {
if (typeof data.icon === 'function') {
marker.setIcon(data.icon(data, category));
if (marker._icon)
L.DomUtil.addClass(marker._icon, "prunecluster-anim");// added by tom
}
else {
marker.setIcon(data.icon);
if(marker._icon)
L.DomUtil.addClass(marker._icon, "prunecluster-anim"); // added by tom
}
}
...
Hi,
Thank you for the bug report. The prunecluster-anim class is used to get the CSS3 transitions. It's managed by another part of the source code, but if this workaround works, I think you can keep it.
I will think about this bug for the next version, but I don't have time to work on it in the near future.
Hi @tombtom , I wont to animate a marker on moving , I use movingMarker plugin but I get annoying result, I think your solution is better. Could you share with us if you found a solution for your problem?