androidpolygongoogle-maps-android-api-2

Unable to fill the polygon with a color


I am adding a Polygon like this:

PolygonOptions options = new PolygonOptions();
for (int x = 0; x <= 360; x++) {

//get LatLng ll
options.add(ll);
}
options.strokeColor(Color.BLUE);
options.strokeWidth(2);
options.fillColor(Color.CYAN);
map.addPolygon(options);

What i get is a blue stroke polygon(circle). But I am not able to fill it with a color(it just empty). What am i missing?

Thank You


Solution

  • Make sure that the vertices are added in counterclockwise order as given in the docs.