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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -