zoomToFit

fun zoomToFit(viewWidthDp: Int, viewHeightDp: Int): Double?

The zoom at which this venue fills a map view of the given size, on the Google (256 px tile) scale: fitted to bounds when present, otherwise the served zoom.

For building a map's initial camera, before the map exists and so before the engine can fit the bounds itself. Mapbox's 512 px tiles render this scale one level higher.

Return

The zoom, or null when neither bounds nor a served zoom are available.

Parameters

viewWidthDp

The map view's width in dp.

viewHeightDp

The map view's height in dp.