Change the color of polyline in android google map v2 -
i have code found 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 color in color.blue returns error saying name color not exist in current context.
just define color in colors
resources file , this:
polylineoptions rectline = new polylineoptions().width(4).color(context.getresources().getcolor(r.color.cyan));
works great me.
Comments
Post a Comment