Specification:
I want to zoom the camera based on the markers' distances. If all the markers present in the Google Maps cannot be entirely covered on a street level zoom(15) , then switch to another built-in zoom function: CameraUpdateFactory.newLatLngBounds(bounds, width, height, padding)
, which satisfies the requirement. I refrain from using this built-in function when the markers are too close to each other or there's only one marker because it zooms on the maximum level. I have tried to use GoogleMap#setMaxZoomPreference
but it doesn't seem to work. The zoom level does not necessarily prohibits to clamp on a certain maximum value(which setting a max zoom level becomes void) but I need to set the initial zoom where the user can see all of the markers present in the entire map.
Question:
How do I measure the camera viewport in meters?
Thoughts:
I will be needing the viewable area and gather all the distances of markers to determine if I will use the street level zoom level or the built-in zoom function.