I have been trying to find a marker animation plugin for OpenLayers to sync lat, lon, and time data along a track like this (in Leaflet):



Is it possible to animate a marker in OpenLayers, given the way it draws on the canvas?


Yes it is possible to animate markers in Openlayers 3. You can see an example of this from their examples page: http://openlayers.org/en/latest/examples/feature-move-animation.html

Basically you will need to:

  1. have an array of coordinates that represent the path (which I assume you have)
  2. listen to the 'postcompose' event and render along that path array

For your case, you will need to map time to indices of that path array in order to iterate through the array of coordinates and render accordingly.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.