Skip to content

Zoom Methods

Each method uses MapMetricsMap.animateCamera, but with a different CameraUpdateFactory.

Zooming In

kotlin
mapMetricsMap.animateCamera(CameraUpdateFactory.zoomIn())

Zooming Out

kotlin
mapMetricsMap.animateCamera(CameraUpdateFactory.zoomOut())

Zoom By Some Amount of Zoom Levels

kotlin
mapMetricsMap.animateCamera(CameraUpdateFactory.zoomBy(2.0))

Zoom to a Zoom Level

kotlin
mapMetricsMap.animateCamera(CameraUpdateFactory.zoomTo(2.0))

Zoom to a Point

kotlin
val view = window.decorView
mapMetricsMap.animateCamera(
    CameraUpdateFactory.zoomBy(
        1.0,
        Point(view.measuredWidth / 4, view.measuredHeight / 4)
    )
)