-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
I needed to restart the animation when a user clicks a button. I added this to the AnimatedMarker.js file
reStart: function(latlngs){
this.initialize(latlngs);
// Don't show CSS transition back to initial position
this._icon.style[L.DomUtil.TRANSITION] = ('all ' + 0 + 'ms linear')
this._shadow.style[L.DomUtil.TRANSITION] = ('all ' + 0 + 'ms linear')
// Reset marker to initial position
this.setLatLng(this._latlngs[0]);
var that = this;
setTimeout(function(){
that.start();
}, 200)
}
...and this to my onclick handler
animatedMarker.reStart(line.getLatLngs());
There may be a better solution, but this is working for me.
haoyuant, loafer-shu and bayoishola20
Metadata
Metadata
Assignees
Labels
No labels