SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
551 stars 133 forks source link

after forceIconRedraw dont work move anim #88

Open tombtom opened 9 years ago

tombtom commented 9 years ago

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
        }
    }
  ...
fungiboletus commented 9 years ago

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.

wahisoufiane commented 7 years ago

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?