Reputation: 21
In map when I will click marker I will get poly line and distance. Again when I click another marker in map I will get a new Line but when I click the 2nd marker I need to update that poly line, no need to add multiple polylines.
Upvotes: 0
Views: 769
Reputation: 616
Latest Mapbox SDK has added an updatePolyline() method. It can be used to update your polyline. It was not present in older versions.
Upvotes: 3
Reputation: 1087
you can simply use this to add a polyline :
Polyline mPolyline = this.mMap.addPolyline(new PolylineOptions().....);
and then to remove simply call :
mPolyline.remove();
Hope it helps!!!
Upvotes: 0