Mouse Scroll Wheel Zoom Rate/Amount?

Have a question about Cesium's default mouse wheel zoom. Is Cesium using the zoomIn/zoomOut methods provided on the Camera object? If so, what amount does Cesium provide to these methods when the wheel is scrolled? Is it supplying a factor of the defaultZoomAmount?

I am trying to implement external zoom control that mimicks the same behavior but, I can't seem to determine how Cesium is calculating the amount to supply to the zoomIn/zoomOut methods. I've been able to get somewhat close but its still off.

Any help would be great!

BTW, I am using Cesium 1.42.1.

Hello,

The value of Camera.defaultZoomAmount will adjust the amount the camera zooms when the user scrolls, but a few other factors go into it, like inertia, distance from the ellipsoid, and some zoom constants. See the zoomHandler function on the ScreenSpaceCameraController class for what exactly is happening under the hood.

Thanks,

Gabby

Hi Gabby

Thanks for directing me to the ZoomHandler. Seems to me though with all the complex logic that went into building the ZoomHandler and the fact that the scroll wheel makes use of it that Cesium should expose it so developers do not have to recreate the wheel for external controls. Perhaps the default behavior of the zoomIn/zoomOut functions on the Camera would perform the same behavior as the scroll wheel when nothing is passed to it…

Hi Jason,

I see you’re point! I think the intention was to keep the zoomIn/zoomOut functions as agnostic as possible. It may be worth proposing a fix and seeing what the team thinks about it by opening a pull request if you are interested.

Thanks,

Gabby