Skip to content

PosAnimation

Used internally for panning animations and utilizing CSS Transitions for modern browsers.

Usage example

js
const myPositionMarker = new Marker([48.864716, 2.294694]).addTo(map);

myPositionMarker.on("click", function() {
const pos = map.latLngToLayerPoint(myPositionMarker.getLatLng());
pos.y -= 25;
const fx = new PosAnimation();

fx.once('end',function() {
pos.y += 25;
fx.run(myPositionMarker._icon, pos, 0.8);
});

fx.run(myPositionMarker._icon, pos, 0.3);
});

@constructor PosAnimation() Creates a PosAnimation object.

Events

EventDataDescription
startFired when the animation starts
stepFired continuously during the animation.
endFired when the animation ends.