MapCameraManagerDelegate

interface MapCameraManagerDelegate

Definition of a camera delegate. Any invocation will interact with the map's actual camera.

Functions

cameraForCoordinateBounds
Link copied to clipboard
abstract fun cameraForCoordinateBounds(bounds: CoordinateBounds, padding: EdgeInsets = EdgeInsets(0.0, 0.0, 0.0, 0.0), bearing: Double? = null, pitch: Double? = null): CameraOptions

Convenience method that returns the camera options object for given arguments

cameraForCoordinates
Link copied to clipboard
abstract fun cameraForCoordinates(coordinates: List<Point>, camera: CameraOptions, box: ScreenBox): CameraOptions

Convenience method that adjusts the provided camera options object for given arguments

abstract fun cameraForCoordinates(coordinates: List<Point>, padding: EdgeInsets = EdgeInsets(0.0, 0.0, 0.0, 0.0), bearing: Double? = null, pitch: Double? = null): CameraOptions

Convenience method that returns the camera options object for given arguments

cameraForGeometry
Link copied to clipboard
abstract fun cameraForGeometry(geometry: Geometry, padding: EdgeInsets = EdgeInsets(0.0, 0.0, 0.0, 0.0), bearing: Double? = null, pitch: Double? = null): CameraOptions

Convenience method that returns the camera options object for given arguments

coordinateBoundsForCamera
Link copied to clipboard
abstract fun coordinateBoundsForCamera(camera: CameraOptions): CoordinateBounds

Returns the CoordinateBounds for a given camera.

coordinateBoundsForCameraUnwrapped
Link copied to clipboard
abstract fun coordinateBoundsForCameraUnwrapped(camera: CameraOptions): CoordinateBounds

Returns the CoordinateBounds for a given camera.

coordinateBoundsZoomForCamera
Link copied to clipboard
abstract fun coordinateBoundsZoomForCamera(camera: CameraOptions): CoordinateBoundsZoom

Returns the coordinate bounds and zoom for a given camera.

coordinateBoundsZoomForCameraUnwrapped
Link copied to clipboard
abstract fun coordinateBoundsZoomForCameraUnwrapped(camera: CameraOptions): CoordinateBoundsZoom

Returns the unwrapped coordinate bounds and zoom for a given camera.

coordinateForPixel
Link copied to clipboard
abstract fun coordinateForPixel(pixel: ScreenCoordinate): Point

Calculates a geographical coordinate(i.e., longitude-latitude pair) that corresponds to a screen coordinate.

coordinatesForPixels
Link copied to clipboard
abstract fun coordinatesForPixels(pixels: List<ScreenCoordinate>): List<Point>

Calculates geographical coordinates(i.e., longitude-latitude pair) that corresponds to screen coordinates.

dragEnd
Link copied to clipboard
abstract fun dragEnd()

Ends the ongoing drag gesture. This function should be called always after the user has ended a drag gesture initiated by dragStart.

dragStart
Link copied to clipboard
abstract fun dragStart(point: ScreenCoordinate)

Prepares the drag gesture to use the provided screen coordinate as a pivot point. This function should be called each time when user starts a dragging action (e.g. by clicking on the map). The following dragging will be relative to the pivot.

getBounds
Link copied to clipboard
abstract fun getBounds(): CameraBounds

Returns the bounds of the map.

getDragCameraOptions
Link copied to clipboard
abstract fun getDragCameraOptions(fromPoint: ScreenCoordinate, toPoint: ScreenCoordinate): CameraOptions

Calculates target point where camera should move after drag. The method should be called after dragStart and before dragEnd.

getFreeCameraOptions
Link copied to clipboard
abstract fun getFreeCameraOptions(): FreeCameraOptions

Gets the map's current free camera options. After mutation, it should be set back to the map.

pixelForCoordinate
Link copied to clipboard
abstract fun pixelForCoordinate(coordinate: Point): ScreenCoordinate

Calculates a screen coordinate that corresponds to a geographical coordinate (i.e., longitude-latitude pair).

pixelsForCoordinates
Link copied to clipboard
abstract fun pixelsForCoordinates(coordinates: List<Point>): List<ScreenCoordinate>

Calculates screen coordinates that corresponds to geographical coordinates (i.e., longitude-latitude pair).

setBounds
Link copied to clipboard
abstract fun setBounds(options: CameraBoundsOptions): Expected<String, None>

Sets the bounds of the map.

setCamera
Link copied to clipboard
abstract fun setCamera(cameraOptions: CameraOptions)

Changes the map view by any combination of center, zoom, bearing, and pitch, without an animated transition. The map will retain its current values for any details not passed via the camera options argument. It is not guaranteed that the provided CameraOptions will be set, the map may apply constraints resulting in a different CameraState.

abstract fun setCamera(freeCameraOptions: FreeCameraOptions)

Sets the map view with the free camera options.

Properties

cameraState
Link copied to clipboard
abstract val cameraState: CameraState

Represents current camera state.

Inheritors

MapboxMap
Link copied to clipboard