Open mikeg0 opened 2 years ago
For what it's worth, I found this kludgy workaround ...
myGlobe.controls().domElement.addEventListener('wheel', function (event) {
myGlobe.pointOfView({altitude: myGlobe.pointOfView().altitude + event.deltaY / 1000})
})
@mikeg0 thanks for reaching out.
The orbit controls on this component are calibrated dynamically to optimize the rotation and zooming of the globe. Essentially the closer you are to the surface, the more level of detail there is, thus the smaller the steps should be. This means the component is constantly adjusting (and overriding) the zoom speeds based on camera altitude changes.
If you'd like to use a different logic for this, I would suggest to import instead the lower level component three-globe. With that one you are responsible for setting up the full scaffolding of camera, scene, renderer etc, but with that comes great flexibility to set it precisely as you intend it, including all the controls configuration.
Same problem here, would be nice to have a way to disable lib zoomSpeed overwrite 👀
Describe the bug After initializing a Globe, I am attempting to set the Zoom Speed property. E.g.,
myGlobe.controls().zoomSpeed = 0.6;
The Zoom Speed gets overwritten due to the change listener here ... https://github.com/vasturiano/globe.gl/blob/master/src/globe.js#L364To Reproduce
Zoom Speed gets set to something other than 0.6 on mouse scroll.
Expected behavior I should be able to override the Zoom Speed property
Screenshots
Desktop (please complete the following information):
Additional context I attempted to modify the zoom level by setting the
pointOfView({ lat, lng, altitude })
via theonZoom(fn)
callback, but the callback does not have a parameter indicating whether we are zooming in or zooming out.