I have this code found from this link https://developers.google.com/maps/documentation/android/shapes#customizing_appearances
Polyline line = map.addPolyline(new PolylineOptions()
.add(new LatLng(-37.81319, 144.96298), new LatLng(-31.95285, 115.85734))
.width(25)
.color(Color.BLUE)
.geodesic(true));
My Problem is Color in Color.Blue returns an error saying The name Color does not exist in the current context.
Just define a color in your colors
resources file and do this:
PolylineOptions rectLine = new PolylineOptions().width(4).color(context.getResources().getColor(R.color.cyan));
Works great for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With