hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

fitBounds Overlays (Circle, Polygon) #116

Closed ptsequeira closed 5 years ago

ptsequeira commented 6 years ago

There is a way to fit overlays (Circle and polygon) to map bounds? I tried cameUpdate.fitBounds but only accepts 2 coordinates.

Thanks

de1mat commented 6 years ago

I was trying to make a polygon fill the entire map on display, and then use the holes in the polygon to show the desired region, as opposed to the polygon itself outlining the desired region.

Hope that makes sense. i.e. Making the overlay fit the bounds of the map sounds like it might be what I am after as well.

hansemannn commented 5 years ago

You can calculate the zoom based on the latitude, longitude, radius of the overlay. See a native example here. Camera updates and custom location settings are supported here as well, so it's just some calculation.