set color to zones of geojson googlemaps android

Viewed 38

I have rendered the geojson on maps using Google Utiltiy lib. i want to set color to the zones .how can i achieve that .

i have tried the below:

JSONObject polygonproperties = object.getJSONObject("geometry");
            JSONArray polyshape = polygonproperties.getJSONArray("coordinates");
           JSONArray arraycoordinates= (JSONArray) polyshape.get(0);
            for(int i=0;i<arraycoordinates.length();i++)
            {
                JSONArray abcd= (JSONArray) arraycoordinates.get(i);
                latLng=new LatLng(abcd.getDouble(0),abcd.getDouble(1));
                Polygon polygon= googleMap.addPolygon(new 
                   PolygonOptions().add(
                        latLng ));
                polygon.setFillColor(Color.BLACK);
                polygon.setStrokeColor(Color.BLUE);

            }

But nothing works..

0 Answers
Related