I've been busy for a long time finding out how to draw a line between two (GPS) points on the map in HelloMapView but with no luck.
Could anyone please tell me how to do so.
Suppose I use the HelloMapView which extends MapView. Do I need to use overlays? If so do I have to override the onDraw() method of the overlay and draw a line here? I actually tried these things but with no result.
Thank you in advance!
This worked for me. With the method mentioned here I was able to draw polylines on Google Maps V2. I drew a new line whenever the user location got changed, so the the polyline looks like the path followed by user on map.
Source code at. Github: prasang7/eTaxi-Meter
Please ignore other modules of this project related to distance calculation and User Interface if you are not interested in them.
For those who really only want to draw a simple line - there is indeed also the short short version.
from https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polyline
Route Helper class
You can get the projection from the MapView object which is passed into the draw() method: mapv.getProjection().toPixels(gP1, p1);
Thank you for your help. At last I could draw a line on the map. This is how I done it: