marchdev-tk / flutter_google_maps

A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
BSD 3-Clause "New" or "Revised" License
87 stars 57 forks source link

moveCameraBounds behavior #73

Closed ccastroelo closed 3 years ago

ccastroelo commented 3 years ago

Hello. I tried to use moveCameraBounds to show two points on the screen at the same time, I expected that even if they were far apart, the zoom would adjust in order to appear the map with the two points, but what is happening is the zoom no is changed and the map moves to the center point between the two points. Is this the expected behavior? (if I have a point in the USA and another in Portugal and the zoom in which it is small, it shows me a point in the middle of the ocean instead of centering between the two points and zooming out so that the two points appear.)

Does anyone know a way then to calculate the zoom required to show two points on the map at the same time from a maxLat, maxLng and minLat, minLng?

Thx

ccastroelo commented 3 years ago

This solution work for me.

https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds