Options
All
  • Public
  • Public/Protected
  • All
Menu

The Camera object specifies a view of the map and allows manipulation of that view.

Hierarchy

Index

Properties

interactions: { disable: () => void; enable: () => void } = ...

User camera interactions

Type declaration

  • disable: () => void
      • (): void
      • Disable all user interactions. This does not affect programmatic Camera controls, such as set and focusOn

        Returns void

  • enable: () => void
      • (): void
      • Enable all user interactions. This does not affect programmatic Camera controls, such as set and focusOn

        Returns void

Accessors

  • get currentAnimation(): undefined | Promise<undefined>
  • The current camera animation, if any. Resolves when the animation finishes.

    Returns undefined | Promise<undefined>

  • get maxTilt(): number
  • set maxTilt(radians: number): void
  • Get the current maximum tilt angle (in radians) the camera is allowed to use.

    Returns number

  • Sets the maximum tilt angle (in radians) the camera is allowed to use.

    Tilt angle must be between 0 and π/2 radians. It will be clamped within this range if it exceeds it on either end.

    As tilt angle approaches π/2 radians, this will impact overall touch controls and should be used sparingly.

    Parameters

    • radians: number

    Returns void

  • get maxZoom(): number
  • set maxZoom(meters: number): void
  • Get the maximum distance (in meters) the camera is allowed to get from the ground.

    Returns number

  • Set the maximum distance (in meters) the camera is allowed to get from the ground.

    Parameters

    • meters: number

    Returns void

  • get minZoom(): number
  • set minZoom(meters: number): void
  • Get the minimum distance (in meters) the camera is allowed to get to the ground.

    Returns number

  • Set the minimum distance (in meters) the camera is allowed to get to the ground.

    Parameters

    • meters: number

    Returns void

  • Get the current camera position, which is at the center of the map.

    Returns MappedinCoordinate

    the position as a coordinate

  • get rotation(): number
  • Current Camera rotation (in radians) from north

    Returns number

  • get tilt(): number
  • Current camera tilt angle (in radians), relative to a top-down view.

    ex: 0 means the camera is facing top-down, π/2 means the camera is facing directly from the side.

    Returns number

  • get zoom(): number
  • Current Camera zoom (in meters)

    Returns number

Methods

  • cancelAnimation(): void
  • Cancel the currently active Camera animation.

    Returns void

  • Focus the Camera view on a collection of targets and animate to that state.

    Parameters

    Returns Promise<any>

    a Promise that resolves when the animation finishes, or rejects when it is cancelled.

  • getSafeAreaInsets(): any
  • Returns any

  • off<EVENT_NAME>(eventName: EVENT_NAME, fn: (payload: CAMERA_EVENT_PAYLOAD[EVENT_NAME]) => void): void
  • setSafeAreaInsets(insets: { bottom: number; left: number; right: number; top: number }): void
  • Parameters

    • insets: { bottom: number; left: number; right: number; top: number }
      • bottom: number
      • left: number
      • right: number
      • top: number

    Returns void