pickWorldPosition
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.
const zoomCameraController = new ScreenSpaceZoomCameraController();
zoomCameraController.pickWorldPosition = function (scene, windowPosition, result) {
// Pick the world position from the depth buffer
return scene.pickPosition(windowPosition, result);
};
viewer.addController(zoomCameraController);Content copied to clipboard