I\'m wondering what the best practice is to draw a dynamic route on a map with the Google Maps API v2. I want to have a map that\'s able to prolong the route while the user is m
Looking at the documentation, it appears that polylineOptions.add(LatLng)
and googleMap.addPolyline(polylineOptions)
methods return the polylineOptions
object. The first method will also return polylineOptions
WITH the point added to the end.
I think you'll have to add the polylineOptions
to googleMap.addPolyline(polylineOptions)
again or use googleMap.clear()
before adding it a second time. Somehting like this:
polylineOptions = googleMap.addPolyline(polylineOptions);
// googleMap.clear();
googleMap.addPolyline(polylineOptions.add(point));