ScreenSpaceMapCameraController

Creates an instance of a ScreenSpaceMapCameraController.

viewer.scene.screenSpaceCameraController.enableInputs = false;

const mapCameraController = new ScreenSpaceMapCameraController();
viewer.addController(mapCameraController);
// Configure the controller to use the right mouse button for panning instead of the default left mouse button.
const mapCameraController = new ScreenSpaceMapCameraController({
dragInputs: [{ button: MouseButton.RIGHT}]
});
viewer.addController(mapCameraController);

Parameters

options

The options for configuring the controller.

See also

Constructors

Link copied to clipboard
constructor(options: ScreenSpaceMapCameraController.ControllerOptions? = definedExternally)

Types

Link copied to clipboard

Properties

Link copied to clipboard

The drag input bindings that map panning. Each binding is a combination of the mouse button and an optional keyboard modifier.

Link copied to clipboard
open override var enabled: Boolean

Determines if the controller is enabled and should be updated by the host scene.

Link copied to clipboard

Enable or disable inertia when panning. When enabled, the camera will continue to move after the user stops dragging, gradually slowing down based on ScreenSpaceMapCameraController.inertialDecay.

Link copied to clipboard

The rate at which the camera's pan velocity decays over time.

Link copied to clipboard

A parameter in the range [0, 1) used to limit the range of inputs to a percentage of the window width/height per animation frame. This helps keep the camera under control in low-frame-rate situations.

Link copied to clipboard

The speed in meters per pixel at which the camera pans.

Link copied to clipboard

A callback function used to pick the world position from which to pan. The function is called with Scene, the Cartesian2 screen space position, and a Cartesian3 instance to store the result. The function should return the Cartesian3 world position from which to pan, or undefined if no position could be picked. If undefined is returned, the camera will pan relative to the ellipsoid surface below the camera.

Functions

Link copied to clipboard
open override fun connectedCallback(element: HTMLElement)

Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners.

Link copied to clipboard
open override fun disconnectedCallback(element: HTMLElement)

Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners.

Link copied to clipboard
open override fun firstUpdate(scene: Scene, time: JulianDate)

Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene.

Link copied to clipboard
open override fun update(scene: Scene, time: JulianDate)

Invoked once per frame. Implement update to modify the camera or other parts of the scene.