setCameraMode

open fun setCameraMode(cameraMode: Int)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking. Use OnLocationCameraTransitionListener to listen for the transition state.

  • NONE: No camera tracking
  • NONE_COMPASS: Camera does not track location, but does track compass bearing
  • NONE_GPS: Camera does not track location, but does track GPS bearing
  • TRACKING: Camera tracks the user location
  • TRACKING_COMPASS: Camera tracks the user location, with bearing provided by a compass
  • TRACKING_GPS: Camera tracks the user location, with normalized bearing
  • TRACKING_GPS_NORTH: Camera tracks the user location, with bearing always set to north

Parameters

cameraMode

one of the modes found in CameraMode


open fun setCameraMode(cameraMode: Int, @Nullable transitionListener: OnLocationCameraTransitionListener)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking. Use OnLocationCameraTransitionListener to listen for the transition state.

  • NONE: No camera tracking
  • NONE_COMPASS: Camera does not track location, but does track compass bearing
  • NONE_GPS: Camera does not track location, but does track GPS bearing
  • TRACKING: Camera tracks the user location
  • TRACKING_COMPASS: Camera tracks the user location, with bearing provided by a compass
  • TRACKING_GPS: Camera tracks the user location, with normalized bearing
  • TRACKING_GPS_NORTH: Camera tracks the user location, with bearing always set to north

Parameters

cameraMode

one of the modes found in CameraMode

transitionListener

callback that's going to be invoked when the transition animation finishes


open fun setCameraMode(cameraMode: Int, transitionDuration: Long, @Nullable zoom: Double, @Nullable bearing: Double, @Nullable tilt: Double, @Nullable transitionListener: OnLocationCameraTransitionListener)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking. Use OnLocationCameraTransitionListener to listen for the transition state.

Set values of zoom, bearing and tilt that the camera will transition to. If null is passed to any of those, current value will be used for that parameter instead. If the camera is already tracking, provided values are ignored.

  • NONE: No camera tracking
  • NONE_COMPASS: Camera does not track location, but does track compass bearing
  • NONE_GPS: Camera does not track location, but does track GPS bearing
  • TRACKING: Camera tracks the user location
  • TRACKING_COMPASS: Camera tracks the user location, with bearing provided by a compass
  • TRACKING_GPS: Camera tracks the user location, with normalized bearing
  • TRACKING_GPS_NORTH: Camera tracks the user location, with bearing always set to north

Parameters

cameraMode

one of the modes found in CameraMode

transitionDuration

duration of the transition in milliseconds

zoom

target zoom, set to null to use current camera position

bearing

target bearing, set to null to use current camera position

tilt

target tilt, set to null to use current camera position

transitionListener

callback that's going to be invoked when the transition animation finishes