Skip to content

Commit

Permalink
added onTick 'event' option on polylines
Browse files Browse the repository at this point in the history
This will allow various visual effects thus I think, it's usefull.
  • Loading branch information
Merulast authored Jun 22, 2023
1 parent 17e6406 commit 452760f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/leaflet.motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ L.Motion.Animate = {
this.setLatLngs(interpolatedLine.traveledPath);
this._drawMarker(interpolatedLine.latLng);

if(this.options.onTick) { this.options.onTick.bind(this)(nextPoint); }

this.__ellapsedTime = ellapsedTime;
this.animation = L.Util.requestAnimFrame(function(){
this._motion(startTime);
Expand Down

0 comments on commit 452760f

Please sign in to comment.