AnyHelpPls
AnyHelpPls

Reputation: 11

Changing Polyline Google map android

return DIRECTION_URL_API + "origin=" + urlOrigin + "&destination=" + urlDestination +"&alternatives=true" +"&key=" + GOOGLE_API_KEY;

EDITED : I have that on my code that will enable to display the shortest route along with the alternative routes. My problem is, is that the shortest route and alternative routes have the same color which is blue. How can I change the colors of my alternative route different than the shortest route? Please help. I'm very new to this. Help would be much appreciated.

Upvotes: 0

Views: 210

Answers (1)

Basil
Basil

Reputation: 855

you can determine the color of a polyline like this

Polyline line = mMap.addPolyline(new PolylineOptions()
                                    .addAll(list)
                                    .width(MAP_POLYLINE_WIDTH)
                                    .color(Color.parseColor("#05b1fb")) //
                                    .geodesic(true)
                                );

Upvotes: 1

Related Questions