From 452760f51886c39c429e11a64f6863abde743f84 Mon Sep 17 00:00:00 2001 From: Merula <86977165+Merulast@users.noreply.github.com> Date: Thu, 22 Jun 2023 18:07:28 +0200 Subject: [PATCH] added onTick 'event' option on polylines This will allow various visual effects thus I think, it's usefull. --- src/leaflet.motion.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/leaflet.motion.js b/src/leaflet.motion.js index b52160d..6a1ab54 100644 --- a/src/leaflet.motion.js +++ b/src/leaflet.motion.js @@ -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);