onScale

open fun onScale(mapboxCarMapSurface: MapboxCarMapSurface, focusX: Float, focusY: Float, scaleFactor: Float)

Allows you to implement or observe the map scale gesture handler. The surface is MapboxCarMapObserver.onAttached before this can be triggered.

See also

androidx.car.app.SurfaceCallback

for instructions to enable.

Parameters

mapboxCarMapSurface

loaded and ready car map surface

focusX

x coordinate of the focal point in pixels. A negative value indicates that the focal point is unavailable.

focusY

y coordinate of the focal point in pixels. A negative value indicates that the focal point is unavailable.

scaleFactor

the scaling factor from the previous state to the current state during the scale event. This value is defined as (current state) / (previous state)