Search code examples
androidosmdroid

Animating osmdroid overlays


I have tried to pass drawables with animations to the marker overlay built into the bonus pack to no success. Has anyone figured out how to animate a marker overlay, I was looking to create the sonar ping style my location thats built into apple maps. I would also like to make one fade in and out for a set amount of time.

From what I can tell is to do this would be to override the draw method and keep track of the last value, then use an post delayed handler to act as the timer and keep forcing the map to refresh which will redraw the markers. This seems a bit of overhead, but it appears how the my location overlay currently works, in that every time the location is updated it redraws the map to show the new marker location or compass direction if its moving.


Solution

  • Yes it's possible (have pretty much what you described in closed source app), but you have to do the leg work your self.

    You'll need an async task that fires on some cycle that adds line to an osm overlay. On each iteration, clear the view, then add in a new circle (or whatever) with a larger diameter until your target radius has been reached.