Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 604
developer Avatar asked Nov 11 '22 13:11

developer


1 Answers

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

like image 124
creativecoder Avatar answered Nov 14 '22 22:11

creativecoder