I've implemented the code seen at:
https://developers.google.com/maps/documentation/roads/inspector.
In each of the examples on this page, the marker animation loops.
How are you supposed to stop the looping so that the icon remains at the end point until more coordinates are fed to it, at which point I'll animate from the last gps coord to the newest gps coord which I just received?
I just don't want to see the course traveled over and over again.
To stop the animation, cancel the setInterval when the icon reaches the end of the polyline.
proof of concept fiddle
code snippet: