getBoundsZoomLevel

open fun getBoundsZoomLevel(bounds: LatLngBounds, mapWidthPx: Integer, mapHeightPx: Integer, maxZoom: Float): Float

Calculates the zoom needed to display the entire bounds on a map clamped to a max zoom.

Return

the zoom level required to show the given area on the map of the specified width/height

Parameters

bounds

the bounds of the area to zoom

mapWidthPx

Width of map view in pixels.

mapHeightPx

Height of map view in pixels.

maxZoom

upper limit for the zoom level to be clamped to


open fun getBoundsZoomLevel(bounds: LatLngBounds, mapWidthPx: Integer, mapHeightPx: Integer): Float

Calculates the zoom needed to display the entire bounds on a map.

Return

the zoom level required to show the given area on the map of the specified width/height

Parameters

bounds

the bounds of the area to zoom

mapWidthPx

Width of map view in pixels.

mapHeightPx

Height of map view in pixels.