AleCat83
AleCat83

Reputation: 1493

Highlight all the worlds in Android Google Maps

I'm developing an app in which the user can select points on a Google Maps and create areas based on point-radius and display them on the map with a semi-transparent circle of a specific color. The user is also able to insert "all world" areas. I need to display this "all-world" area on the map, is it possible to add a semi-transparent polygon that cover all the map? Or, is there a better solution to highlight all the map?

Upvotes: 0

Views: 91

Answers (1)

adjuremods
adjuremods

Reputation: 2998

Check the documentation of Polygons under the Shapes in Google Maps Android API to cover the map.

Polygon objects are similar to Polyline objects in that they consist of a series of coordinates in an ordered sequence. However, instead of being open-ended, polygons are designed to define regions within a closed loop with the interior filled in.

To create Polygon, first create a PolygonOptions object and add some points to it. These points will form the outline of the polygon. You then add the polygon to the map by calling GoogleMap.addPolygon(PolygonOptions) which will return a Polygon object.

To alter the shape of this polygon, just call the Polygon.setPoints() and provide a new list of points for the outline of the polygon.

Now, for customizing the appearance of the polygon, just check this link. And for the semi-transparent polygon that you want, you can check these tutorial and SO question on how to achieve that.

Upvotes: 1

Related Questions