PruneCluster icon indicating copy to clipboard operation
PruneCluster copied to clipboard

after forceIconRedraw dont work move anim

Open tombtom opened this issue 8 years ago • 2 comments

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
        }
    }
  ...

tombtom avatar Sep 26 '15 20:09 tombtom

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.

fungiboletus avatar Sep 28 '15 08:09 fungiboletus

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?

wahisoufiane avatar Feb 01 '17 12:02 wahisoufiane