Search code examples
androidgoogle-mapsgoogle-maps-api-3

How to draw transparent circles on Google Maps API


I try to draw circles on the Google Maps API, which are transparent.

CircleOptions circleOptions = new CircleOptions()
        .center(new LatLng(lat, lon))
        .radius(50.0)
        .strokeColor(Color.TRANSPARENT)
        .strokeWidth(1)
        .fillColor(Color.CYAN); // 

But I like to draw them transparently, so that I can see the map behind? How could I do that?


Solution

  • For mGoogleMap as GoogleMap object, with latitude longitude given as

    LatLng currentLatLon = new LatLng(lat double value, lng double value);
    

    This is the way to draw circle in google maps

    mGoogleMap.addCircle(new CircleOptions()
                        .center(currentLatLon)
                        .radius(150)
                        .strokeColor(Color.RED)
                        .fillColor(0x220000FF)
                        .strokeWidth(5)
                        );