0

I have a map with many markers for places. I want to draw an overlay around all map with a black transparent color, and a circle around those markers which is fully transparent to show them. Like the attached picture.

I know how to add an overlay view, but I don't know how to add the middle circle while keeping the overlay colored.

If I use Circle then only the circle is colored, and not rest of map.

I also tried to draw something like this but yea won't work ^^.

        int d = 500; // diameter
        Bitmap bm = Bitmap.createBitmap(d, d, Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(bm);
        Paint p = new Paint();
        p.setColor(getResources().getColor(R.color.colorAccent));
        c.drawCircle(d / 2, d / 2, d / 2, p);

        // generate BitmapDescriptor from circle Bitmap
        BitmapDescriptor bmD = BitmapDescriptorFactory.fromBitmap(bm);

        // mapView is the GoogleMap
        googleMap.addGroundOverlay(new GroundOverlayOptions().
                image(bmD).
                position(latLng, RADIUS_CIRCLE * 2, RADIUS_CIRCLE * 2).
                transparency(0.4f));

I am confused and not sure how to work it out. Any help will be appreciated. Thanks.

Black view with transparent circle inside it

M.Baraka
  • 725
  • 1
  • 10
  • 24

1 Answers1

0

Please check Antonio's answer in the comments. I have tested that and works for me. user1892172 answer but i didn't test it, but seems correct also. Thanks.

M.Baraka
  • 725
  • 1
  • 10
  • 24