Adds geospatial capabilities to three.js cameras.

Hierarchy (view full)

Implements

Constructors

Accessors

  • get height(): number
  • The height, in pixels, of this view.

    Returns number

  • get maxFarPlane(): number
  • Gets or sets the maximum distance allowed for the camera far plane.

    Returns number

  • set maxFarPlane(distance): void
  • Parameters

    • distance: number

    Returns void

  • get minNearPlane(): number
  • Gets or sets the minimum distance allowed for the camera near plane.

    Returns number

  • set minNearPlane(distance): void
  • Parameters

    • distance: number

    Returns void

  • get width(): number
  • The width, in pixels, of this view.

    Returns number

Methods

  • Adds a listener to an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The function that gets called when the event is fired.

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Fire an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • event: BaseEvent<T> & ViewEvents[T]

      The event that gets fired.

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The function that gets called when the event is fired.

    Returns boolean

  • Type Parameters

    • T extends string

    Parameters

    Returns boolean

  • Return the position in the requested CRS, or in camera's CRS if undefined.

    Parameters

    • Optional crs: string

      if defined (e.g 'EPSG:4236') the camera position will be returned in this CRS

    Returns Coordinates

    Coordinates object holding camera's position

  • Removes a listener from an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of the listener that gets removed.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The listener function that gets removed.

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Resets the near and far planes to their default value.

    Returns void

  • Registers external controls that must be udpated periodically.

    Note: this is the case of simple controls in the examples/{js,jsm}/controls folder of THREE.js (e.g MapControls):

    • they fire 'change' events when the controls' state has changed and the view must be rendered,
    • they have an update() method to update the controls' state.

    For more complex controls, such as the package camera-controls, a more complex logic is required. Please refer to the appropriate examples for a detailed documentation on how to bind Giro3D and those controls.

    Parameters

    • controls: null | ExternalControls

      The controls to register. If null, currently registered controls are unregistered (they are not disabled however).

    Returns void