From 853239b34fb281365655c8284c4d00bd5f225c25 Mon Sep 17 00:00:00 2001 From: malwoodsantoro Date: Fri, 17 Apr 2020 15:47:40 -0700 Subject: [PATCH 1/2] Add inline example for setZoomRate of scrollZoomHandler --- src/ui/handler/scroll_zoom.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/handler/scroll_zoom.js b/src/ui/handler/scroll_zoom.js index cd19b8d3cb5..49814f73755 100644 --- a/src/ui/handler/scroll_zoom.js +++ b/src/ui/handler/scroll_zoom.js @@ -80,6 +80,9 @@ 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; From beffaaaa4923c13eb613610832e9fe3d19a1b08f Mon Sep 17 00:00:00 2001 From: malwoodsantoro Date: Fri, 17 Apr 2020 16:54:10 -0700 Subject: [PATCH 2/2] add setWheelZoomRate inline example --- src/ui/handler/scroll_zoom.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/handler/scroll_zoom.js b/src/ui/handler/scroll_zoom.js index 49814f73755..2bb54316b92 100644 --- a/src/ui/handler/scroll_zoom.js +++ b/src/ui/handler/scroll_zoom.js @@ -89,9 +89,12 @@ class ScrollZoomHandler { } /** - * 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; }