ScreenSpaceZoomCameraController
Creates a new instance of ScreenSpaceZoomCameraController.
viewer.scene.screenSpaceCameraController.enableInputs = false;
viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
const zoomCameraController = new ScreenSpaceZoomCameraController();
viewer.addController(zoomCameraController);Parameters
The options for configuring the controller.
See also
Types
Properties
Enables or disables damping for zooming. Damping smooths out the camera movement and makes it feel more natural or weighty, but it can also introduce a slight delay in the camera response. If damping is disabled, the camera will respond immediately to user input.
The drag input bindings that control zooming. Each binding is a combination of the mouse button and an optional keyboard modifier.
Enable or disable inertia when zooming. When enabled, the camera will continue to move after the user input stops, gradually slowing down based on ScreenSpaceZoomCameraController.inertialDecay.
The rate at which the camera's zoom velocity decays over time.
Maximum distance from the zoom target that the camera can move away.
The maximum zoom velocity in meters per second. This limits the speed at which the camera can zoom in and out.
A callback function used to pick the world position from which to zoom. 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 zoom, or undefined if no position could be picked.
The scroll input bindings that control zooming.
If false, the camera will zoom to the position at the center of the screen. If true, the camera will zoom to the position under the cursor or tap when dragging starts or when scrolling with the scroll wheel.
Specifies the length of time in seconds in which a single zoom animation is targeted to complete.
The ratio of the camera's distance to the zoom target that defines how much the camera zooms in and out per second.
The rate at which the camera zooms in and out based on the mouse wheel delta.
Functions
Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners.
Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners.
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.
Invoked once per frame. Implement update to modify the camera or other parts of the scene.