MapCameraManagerDelegate

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

interface MapCameraManagerDelegate

Functions

cameraForCoordinateBounds
Link copied to clipboard

Convenience method that returns the camera options object for given arguments

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

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

Returns the provided \p camera with zoom adjusted to fit \p coordinates into \p box, so that coordinates on the left, top and right of the effective camera center at the principal point of the projection (defined by padding) fit into \p box. Returns the provided camera options object unchanged upon error. Note that this method may fail if the principal point of the projection is not inside \p box or if there is no sufficient screen space, defined by principal point and box, to fit the geometry.

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

Convenience method that returns the camera options object for given arguments

abstract fun cameraForCoordinates(coordinates: List<Point>, padding: EdgeInsets, bearing: Double?, pitch: Double?): CameraOptions
cameraForGeometry
Link copied to clipboard

Convenience method that returns the camera options object for given arguments

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

Returns the coordinate bounds for a given camera.

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

Returns the coordinate bounds and zoom for a given camera.

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

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

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

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

The screen coordinate is in \link MapOptions#size platform pixels \endlink relative to the top left of the map (not of the whole screen).

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

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

The screen coordinates are in \link MapOptions#size platform pixels \endlink relative to the top left of the map (not of the whole screen).

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

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

abstract fun dragEnd()
dragStart
Link copied to clipboard

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.

abstract fun dragStart(point: ScreenCoordinate)
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getBounds
Link copied to clipboard

Returns the bounds of the map.

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

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

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

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

abstract fun getFreeCameraOptions(): FreeCameraOptions
hashCode
Link copied to clipboard
open override fun hashCode(): Int
pixelForCoordinate
Link copied to clipboard

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

The screen coordinate is in \link MapOptions#size platform pixels \endlink relative to the top left of the map (not of the whole screen).

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

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

The screen coordinates are in \link MapOptions#size platform pixels \endlink relative to the top left of the map (not of the whole screen).

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

Sets the bounds of the map.

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

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(cameraOptions: CameraOptions)

Sets the map view with the free camera options.

FreeCameraOptions provides more direct access to the underlying camera entity. For backwards compatibility the state set using this API must be representable with CameraOptions as well. Parameters are clamped to a valid range or discarded as invalid if the conversion to the pitch and bearing presentation is ambiguous. For example orientation can be invalid if it leads to the camera being upside down or the quaternion has zero length.

abstract fun setCamera(freeCameraOptions: FreeCameraOptions)
toString
Link copied to clipboard
open override fun toString(): String

Properties

cameraState
Link copied to clipboard

Represents current camera state.

abstract val cameraState: CameraState

Inheritors

MapboxMap
Link copied to clipboard