Leaflet / Leaflet.markercluster

Marker Clustering plugin for Leaflet
MIT License
3.98k stars 1k forks source link

Animation is not working when i zoom in #1018

Open peterkowalsky333 opened 4 years ago

peterkowalsky333 commented 4 years ago

How to reproduce

What behaviour I'm expecting and which behaviour I'm seeing

I want to have animation when i zoom in like this example:

http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html

Minimal example reproducing the issue

My markerClusterGroup configuration looks like this:

this.markerClusterGroup = L.markerClusterGroup({ removeOutsideVisibleBounds: true, animate: true,
      animateAddingMarkers: true });

I also included

L.DomUtil.TRANSFORM = 'webkitTransition';
and
L.DomUtil.TRANSITION= 'webkitTransition';

and i imported the css file

 <link rel="stylesheet" href="/bower_components/leaflet.markercluster/dist/MarkerCluster.css">

but still,when i zoom in i dont have animations like on the example

tsungweihsu commented 2 years ago

Hello,

it might be a bit late to share the solution, but I had the same problem and solved by simply importing both css files:

@import "~leaflet.markercluster/dist/MarkerCluster.css";
@import "~leaflet.markercluster/dist/MarkerCluster.Default.css";

It should include the animations needed for splitting and merging. I'm using leaflet 1.7.1 and leaflet.markercluster 1.5.3.