Skip to content

Commit 523a445

Browse files
author
Mal Wood-Santoro
authored
[docsprint] Add inline example for setZoomRate and setWheelZoomRate of scrollZoomHandler (#9593)
* Add inline example for setZoomRate of scrollZoomHandler * add setWheelZoomRate inline example
1 parent 93774c6 commit 523a445

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ui/handler/scroll_zoom.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,21 @@ class ScrollZoomHandler {
8181
/**
8282
* Set the zoom rate of a trackpad
8383
* @param {number} [zoomRate=1/100] The rate used to scale trackpad movement to a zoom value.
84+
* @example
85+
* // Speed up trackpad zoom
86+
* map.scrollZoom.setZoomRate(1/25);
8487
*/
8588
setZoomRate(zoomRate: number) {
8689
this._defaultZoomRate = zoomRate;
8790
}
8891

8992
/**
90-
* Set the zoom rate of a mouse wheel
91-
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
92-
*/
93+
* Set the zoom rate of a mouse wheel
94+
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
95+
* @example
96+
* // Slow down zoom of mouse wheel
97+
* map.scrollZoom.setWheelZoomRate(1/600);
98+
*/
9399
setWheelZoomRate(wheelZoomRate: number) {
94100
this._wheelZoomRate = wheelZoomRate;
95101
}

0 commit comments

Comments
 (0)