Code example for PolygonOptions

0
        } 
    } 
 
    private void setUpMap() { 
        // Create a rectangle with two rectangular holes. 
        mMap.addPolygon(new PolygonOptions()
                .addAll(createRectangle(new LatLng(-20, 130), 5, 5))
                .addHole(createRectangle(new LatLng(-22, 128), 1, 1))
                .addHole(createRectangle(new LatLng(-18, 133), 0.5, 1.5))
                .fillColor(Color.CYAN)
                .strokeColor(Color.BLUE)
                .strokeWidth(5));
 
        // Create a rectangle centered at Sydney. 
        PolygonOptions options = new PolygonOptions().addAll(createRectangle(SYDNEY, 5, 8));
 
        int fillColor = Color.HSVToColor(
                mAlphaBar.getProgress(), new float[] {mColorBar.getProgress(), 1, 1});
        mMutablePolygon = mMap.addPolygon(options
                .strokeWidth(mWidthBar.getProgress())
                .strokeColor(Color.BLACK)