android google maps Polygon add circle hole

前端 未结 2 1625
情书的邮戳
情书的邮戳 2020-12-13 22:34

hi currently im working on a google maps app.

and i want the following effect:

To do this i was thing of first creating a polygon overlay over the c

2条回答
  •  有刺的猬
    2020-12-13 22:41

    I used this method to draw a circle with 5000m radius from user's location, but I do not know how to get that nice highlighted effect in your demo pic, this method gives you a circle with light blue background and a dark blue stroke. Hope it helps!

    private void drawCircle(LatLng point){
    
            // Instantiating CircleOptions to draw a circle around the marker
            CircleOptions circleOptions = new CircleOptions();
    
            // Specifying the center of the circle
            circleOptions.center(point);
    
            // Radius of the circle
            circleOptions.radius(5000);
    
            // Border color of the circle
            circleOptions.strokeColor(0xFF0000FF);
    
            // Fill color of the circle
            circleOptions.fillColor(0x110000FF);
    
            // Border width of the circle
            circleOptions.strokeWidth(2);
    
            // Adding the circle to the GoogleMap
            mMap.addCircle(circleOptions);
    
        }
    

提交回复
热议问题