**polygon.setfillcolor(Color)** not working for google map v2

4

I am adding a Polygon into Google Map v2 like this:

for (int index = coordinats.size()-1; index >= 0; index--) {
        polygonOptions.add(
                new LatLng(latCoordinats.get(index), lngCoordinats.get(index)));
    }
     polygonOptions.strokeColor(0x7FFFFFFF);
     polygonOptions.strokeWidth((float) 5);
     polygonOptions.fillColor(Color.BLUE);

     polygon=   mMap.addPolygon(polygonOptions);

polygonOptions.fillColor(Color.BLUE);

is not working for me... What am i missing?

android
google-maps
polygons
asked on Stack Overflow Feb 5, 2014 by developer • edited Feb 5, 2014 by M D

1 Answer

1

I am also tried polygonOptions.fillColor(Color.BLUE); and polygon.setFillColor(color); it has no effect for random latitude and longitude coordinates.

I Tested by giving only four corners latitude and longitude coordinates
new LatLng(-31.673, 128.892),
new LatLng(-31.952, 115.857),
new LatLng(-17.785, 122.258),
new LatLng(-12.4258, 130.7932)
polygonOptions.fillColor(Color.BLUE); is working

answered on Stack Overflow Mar 28, 2019 by creativecoder

User contributions licensed under CC BY-SA 3.0