ScreenSpaceMapCameraController

A camera controller that allows panning the camera tangential to the ellipsoid in screen space by clicking and dragging the mouse.

new Cesium.ScreenSpaceMapCameraController(options)

Creates an instance of a ScreenSpaceMapCameraController.
Name Type Description
options ScreenSpaceMapCameraController.ControllerOptions optional The options for configuring the controller.
Examples:
viewer.scene.screenSpaceCameraController.enableInputs = false;

const mapCameraController = new Cesium.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 Cesium.ScreenSpaceMapCameraController({
 dragInputs: [{ button: Cesium.MouseButton.RIGHT}]
});
viewer.addController(mapCameraController);

Members

The drag input bindings that map panning. Each binding is a combination of the mouse button and an optional keyboard modifier.
See:
Determines if the controller is enabled and should be updated by the host scene.
The rate at which the camera's pan velocity decays over time.
Default Value: 6.0
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.
Default Value: 0.1
The speed in meters per pixel at which the camera pans.
Default Value: 1.0

Methods

Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners.
Name Type Description
element HTMLElement The DOM element containing the Cesium scene.

disconnectedCallback(element)

Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners.
Name Type Description
element HTMLElement The DOM element containing the Cesium scene.
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.
Name Type Description
scene Scene
time JulianDate The current simulation time.
See:
Invoked once per frame. Implement update to modify the camera or other parts of the scene.
Name Type Description
scene Scene
time JulianDate The current simulation time.
See:

Type Definitions

Cesium.ScreenSpaceMapCameraController.ControllerOptions

Properties:
Name Type Attributes Description
dragInputs Array.<ScreenSpaceInputBindings.InputBinding> <optional>
The drag input bindings that control panning.

Cesium.ScreenSpaceMapCameraController.DragEvent

Properties:
Name Type Description
startPosition Cartesian2 The position of the mouse when the drag started.
endPosition Cartesian2 The position of the mouse when the drag ended.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.