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

options

The options for configuring the controller.

See also

Constructors

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

Types

Link copied to clipboard

Properties

Link copied to clipboard

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.

Link copied to clipboard

The drag input bindings that control zooming. 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 zooming. When enabled, the camera will continue to move after the user input stops, gradually slowing down based on ScreenSpaceZoomCameraController.inertialDecay.

Link copied to clipboard

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

Link copied to clipboard

Maximum distance from the zoom target that the camera can move away.

Link copied to clipboard

The maximum zoom velocity in meters per second. This limits the speed at which the camera can zoom in and out.

Link copied to clipboard

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.

Link copied to clipboard

The scroll input bindings that control zooming.

Link copied to clipboard

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.

Link copied to clipboard

Specifies the length of time in seconds in which a single zoom animation is targeted to complete.

Link copied to clipboard

The ratio of the camera's distance to the zoom target that defines how much the camera zooms in and out per second.

Link copied to clipboard

The rate at which the camera zooms in and out based on the mouse wheel delta.

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.