I need to plot a route from user's current location to the destination address. Now let's say if the user takes a different route, I need to replot the route. How should I proceed?
I, obviously, will not keep on plotting the route as soon as the user's location. I need to replot only when the user takes a different route
Have already been answered here. How to draw interactive Polyline on route google maps v2 android
Code sample
PolylineOptions options = new
PolylineOptions().width(5).color(Color.BLUE).geodesic(true);
for (int z = 0; z < list.size(); z++) {
LatLng point = list.get(z);
options.add(point);
}
line = myMap.addPolyline(options);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.