Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docsprint] Add inline example for setZoomRate and setWheelZoomRate of scrollZoomHandler #9593

Merged
merged 2 commits into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/ui/handler/scroll_zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ class ScrollZoomHandler {
/**
* Set the zoom rate of a trackpad
* @param {number} [zoomRate=1/100] The rate used to scale trackpad movement to a zoom value.
* @example
* // Speed up trackpad zoom
* map.scrollZoom.setZoomRate(1/25);
*/
setZoomRate(zoomRate: number) {
this._defaultZoomRate = zoomRate;
}

/**
* Set the zoom rate of a mouse wheel
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
*/
* Set the zoom rate of a mouse wheel
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
* @example
* // Slow down zoom of mouse wheel
* map.scrollZoom.setWheelZoomRate(1/600);
*/
setWheelZoomRate(wheelZoomRate: number) {
this._wheelZoomRate = wheelZoomRate;
}
Expand Down