hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fitBounds Overlays (Circle, Polygon)

ptsequeira opened this issue · comments

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

Thanks

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.

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.