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
dragInputs : Array.<ScreenSpaceInputBindings.InputBinding>
The drag input bindings that map panning. Each binding is a combination of the mouse button
and an optional keyboard modifier.
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. |
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. |
Type Definitions
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
dragInputs |
Array.<ScreenSpaceInputBindings.InputBinding> |
<optional> |
The drag input bindings that control panning. |
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. |
