Question

Using Google Map Android API v2, I'm trying to apply an overlay outside of a shape. For example, I would like to draw a shape around a marker an apply a grey overlay all around this shape.

Here the result I would like to have : http://www.hostingpics.net/viewer.php?id=221191googlemap.png

I know how to draw a shape and I know how to apply the grey overlay on all the map using the GroundOverlay class but I don't know how to apply the overlay on all the map except in the shape.

I really hope that somebody will be able to help me :)

Thank you in advance !

Was it helpful?

Solution

You can try polygon overlay with holes in the middle. i.e. your entire map is covered by a polygon with an opacity value less then one. You can specify holes in the middle of the polygon. See the documents of polygon overlay:

http://developer.android.com/reference/com/google/android/gms/maps/model/Polygon.html

It says:

 A polygon can be convex or concave, it may span the 180 meridian and it can have holes that are not filled in
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top