Skip to content

Commit

Permalink
Merge pull request #33 from longnguyenduy233/bugfix/marker-rotate-issue
Browse files Browse the repository at this point in the history
[bugfix] Fix marker rotation issue
  • Loading branch information
Igor-Vladyka authored Oct 9, 2023
2 parents 17e6406 + 6747f91 commit 84f2cd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/leaflet.motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ L.Motion.Animate = {
motionMarkerOnLine = +needToRotateMarker;
}

icon.style.transform = "rotate(-" + Math.round(L.Motion.Utils.getAngle(prevPoint, nextPoint) + motionMarkerOnLine) +"deg)";
const markerAngle = -1 * Math.round(L.Motion.Utils.getAngle(prevPoint, nextPoint) + motionMarkerOnLine);
icon.style.transform = `rotate(${markerAngle}deg)`;
}
});
}
Expand Down

0 comments on commit 84f2cd8

Please sign in to comment.