Expose camera controller zoomFactor
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
This came up [on the forum](https://groups.google.com/d/msg/cesium-dev/9EB47H0q4oc/yIHvUKn_BwAJ), as a question of how to change the camera's zooming speed. I first tried [camera.defaultZoomAmount](https://cesiumjs.org/Cesium/Build/Documentation/Camera.html?classFilter=Camera#defaultZoomAmount) but that turns out to only be the zoom speed when no speed is passed.
I then discovered the hidden zoomFactor private variable:
https://github.com/AnalyticalGraphicsInc/cesium/blob/32fc04d9e7e3b26e78ca1ca4b607091846a68c1e/Source/Scene/ScreenSpaceCameraController.js#L304
Note the apt comment here: `// Constants, Make any of these public?`. So right now, you could change the zoomFactor with:
```
viewer.scene.screenSpaceCameraController._zoomFactor = 8; // defaults to 5
```
Contributor guide
Research direction
Start in Source/Scene/ScreenSpaceCameraController.js at the private zoomFactor variable and its surrounding constants comment. Trace how the camera controller uses it, then make the zoom factor publicly configurable and verify that users no longer need to access the private field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100