Skip to content

Commit

Permalink
Merge pull request #32 from Merulast/master
Browse files Browse the repository at this point in the history
added onTick 'event' option on polylines
  • Loading branch information
Igor-Vladyka authored Oct 9, 2023
2 parents 84f2cd8 + 452760f commit a7bc647
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 a7bc647

Please sign in to comment.