I am working on an app for which I need a path to be drawn on a Google map as the location changes showing where the user has been. I have tried using the MyLocationOverlay class thinking I could just override the method that draws the location but I have been unsuccessful in determining what method to override. Also, it appears that MyLocationOverlay draws a new map every time the location is drawn. I am currently using an ItemizedOverlay and just having a dot added to the list every time the location changes. This works, and I get a dotted path as I walk but I would really like a solid path. Are there any suggestions?
I have also seen this post but I can’t get it to work. Dont you need an overlay inorder to get it on the map?
I think the easiest way to do this would be to subclass the Overlay class, and then override the draw method. The draw method is pretty open ended and it shouldn’t be too hard to draw a path. An example would look something like this:
Objects of this class can then be added to the list returned by MapView.getOverlays() to be added to the map.