@antv/l7-map 2.21.11-beta.5 → 2.21.11-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -6
- package/es/index.d.ts +3 -4
- package/es/index.js +2 -4
- package/es/map/camera.d.ts +690 -0
- package/es/map/camera.js +1138 -0
- package/{lib → es/map}/css/l7.css +41 -7
- package/es/map/events.d.ts +384 -0
- package/es/map/events.js +222 -0
- package/es/map/geo/edge_insets.d.ts +97 -0
- package/es/{geo → map/geo}/edge_insets.js +55 -33
- package/es/map/geo/lng_lat.d.ts +116 -0
- package/es/map/geo/lng_lat.js +159 -0
- package/es/map/geo/lng_lat_bounds.d.ts +217 -0
- package/es/map/geo/lng_lat_bounds.js +334 -0
- package/es/map/geo/mercator_coordinate.d.ts +113 -0
- package/es/map/geo/mercator_coordinate.js +142 -0
- package/es/map/geo/transform.d.ts +262 -0
- package/es/map/geo/transform.js +736 -0
- package/{lib → es/map}/handler/box_zoom.d.ts +30 -24
- package/es/map/handler/box_zoom.js +145 -0
- package/es/map/handler/click_zoom.d.ts +24 -0
- package/es/map/handler/click_zoom.js +47 -0
- package/es/map/handler/cooperative_gestures.d.ts +40 -0
- package/es/map/handler/cooperative_gestures.js +94 -0
- package/es/map/handler/drag_handler.d.ts +88 -0
- package/es/map/handler/drag_handler.js +89 -0
- package/es/map/handler/drag_move_state_manager.d.ts +30 -0
- package/es/map/handler/drag_move_state_manager.js +94 -0
- package/es/map/handler/handler_util.d.ts +3 -0
- package/es/{handler → map/handler}/handler_util.js +1 -2
- package/es/map/handler/keyboard.d.ts +88 -0
- package/es/map/handler/keyboard.js +197 -0
- package/es/map/handler/map_event.d.ts +46 -0
- package/es/map/handler/map_event.js +131 -0
- package/es/map/handler/mouse.d.ts +30 -0
- package/es/map/handler/mouse.js +85 -0
- package/es/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/es/map/handler/one_finger_touch_drag.js +39 -0
- package/es/map/handler/scroll_zoom.d.ts +102 -0
- package/es/map/handler/scroll_zoom.js +312 -0
- package/es/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
- package/es/{handler → map/handler}/shim/dblclick_zoom.js +20 -16
- package/es/map/handler/shim/drag_pan.d.ts +79 -0
- package/es/map/handler/shim/drag_pan.js +77 -0
- package/es/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
- package/es/map/handler/shim/drag_rotate.js +66 -0
- package/es/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/es/map/handler/shim/two_fingers_touch.js +106 -0
- package/es/map/handler/tap_drag_zoom.d.ts +28 -0
- package/es/map/handler/tap_drag_zoom.js +92 -0
- package/es/map/handler/tap_recognizer.d.ts +35 -0
- package/es/map/handler/tap_recognizer.js +107 -0
- package/es/map/handler/tap_zoom.d.ts +28 -0
- package/es/map/handler/tap_zoom.js +87 -0
- package/es/map/handler/touch_pan.d.ts +40 -0
- package/es/map/handler/touch_pan.js +85 -0
- package/es/map/handler/transform-provider.d.ts +23 -0
- package/es/map/handler/transform-provider.js +35 -0
- package/es/map/handler/two_fingers_touch.d.ts +107 -0
- package/es/map/handler/two_fingers_touch.js +289 -0
- package/es/map/handler_inertia.d.ts +20 -0
- package/es/{handler → map}/handler_inertia.js +36 -50
- package/es/map/handler_manager.d.ts +154 -0
- package/es/map/handler_manager.js +466 -0
- package/es/map/map.d.ts +625 -0
- package/es/map/map.js +972 -0
- package/es/map/util/abort_error.d.ts +15 -0
- package/es/map/util/abort_error.js +21 -0
- package/es/map/util/browser.d.ts +10 -0
- package/es/map/util/browser.js +30 -0
- package/es/map/util/dom.d.ts +30 -0
- package/es/map/util/dom.js +105 -0
- package/es/map/util/evented.d.ts +75 -0
- package/es/map/util/evented.js +158 -0
- package/es/map/util/task_queue.d.ts +18 -0
- package/es/map/util/task_queue.js +54 -0
- package/es/map/util/util.d.ts +104 -0
- package/es/map/util/util.js +155 -0
- package/lib/index.d.ts +3 -4
- package/lib/index.js +12 -42
- package/lib/map/camera.d.ts +690 -0
- package/lib/map/camera.js +1145 -0
- package/{es → lib/map}/css/l7.css +41 -7
- package/lib/map/events.d.ts +384 -0
- package/lib/map/events.js +231 -0
- package/lib/map/geo/edge_insets.d.ts +97 -0
- package/lib/{geo → map/geo}/edge_insets.js +56 -35
- package/lib/map/geo/lng_lat.d.ts +116 -0
- package/lib/map/geo/lng_lat.js +166 -0
- package/lib/map/geo/lng_lat_bounds.d.ts +217 -0
- package/lib/map/geo/lng_lat_bounds.js +341 -0
- package/lib/map/geo/mercator_coordinate.d.ts +113 -0
- package/lib/map/geo/mercator_coordinate.js +157 -0
- package/lib/map/geo/transform.d.ts +262 -0
- package/lib/map/geo/transform.js +744 -0
- package/{es → lib/map}/handler/box_zoom.d.ts +30 -24
- package/lib/map/handler/box_zoom.js +153 -0
- package/lib/map/handler/click_zoom.d.ts +24 -0
- package/lib/map/handler/click_zoom.js +54 -0
- package/lib/map/handler/cooperative_gestures.d.ts +40 -0
- package/lib/map/handler/cooperative_gestures.js +101 -0
- package/lib/map/handler/drag_handler.d.ts +88 -0
- package/lib/map/handler/drag_handler.js +97 -0
- package/lib/map/handler/drag_move_state_manager.d.ts +30 -0
- package/lib/map/handler/drag_move_state_manager.js +103 -0
- package/lib/map/handler/handler_util.d.ts +3 -0
- package/lib/{handler → map/handler}/handler_util.js +1 -2
- package/lib/map/handler/keyboard.d.ts +88 -0
- package/lib/map/handler/keyboard.js +205 -0
- package/lib/map/handler/map_event.d.ts +46 -0
- package/lib/map/handler/map_event.js +140 -0
- package/lib/map/handler/mouse.d.ts +30 -0
- package/lib/map/handler/mouse.js +93 -0
- package/lib/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/lib/map/handler/one_finger_touch_drag.js +47 -0
- package/lib/map/handler/scroll_zoom.d.ts +102 -0
- package/lib/map/handler/scroll_zoom.js +320 -0
- package/lib/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
- package/lib/{handler → map/handler}/shim/dblclick_zoom.js +21 -17
- package/lib/map/handler/shim/drag_pan.d.ts +79 -0
- package/lib/map/handler/shim/drag_pan.js +85 -0
- package/lib/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
- package/lib/map/handler/shim/drag_rotate.js +74 -0
- package/lib/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/lib/map/handler/shim/two_fingers_touch.js +114 -0
- package/lib/map/handler/tap_drag_zoom.d.ts +28 -0
- package/lib/map/handler/tap_drag_zoom.js +99 -0
- package/lib/map/handler/tap_recognizer.d.ts +35 -0
- package/lib/map/handler/tap_recognizer.js +116 -0
- package/lib/map/handler/tap_zoom.d.ts +28 -0
- package/lib/map/handler/tap_zoom.js +94 -0
- package/lib/map/handler/touch_pan.d.ts +40 -0
- package/lib/map/handler/touch_pan.js +92 -0
- package/lib/map/handler/transform-provider.d.ts +23 -0
- package/lib/map/handler/transform-provider.js +43 -0
- package/lib/map/handler/two_fingers_touch.d.ts +107 -0
- package/lib/map/handler/two_fingers_touch.js +296 -0
- package/lib/map/handler_inertia.d.ts +20 -0
- package/lib/{handler → map}/handler_inertia.js +38 -53
- package/lib/map/handler_manager.d.ts +154 -0
- package/lib/map/handler_manager.js +474 -0
- package/lib/map/map.d.ts +625 -0
- package/lib/map/map.js +979 -0
- package/lib/map/util/abort_error.d.ts +15 -0
- package/lib/map/util/abort_error.js +29 -0
- package/lib/map/util/browser.d.ts +10 -0
- package/lib/map/util/browser.js +36 -0
- package/lib/map/util/dom.d.ts +30 -0
- package/lib/map/util/dom.js +113 -0
- package/lib/map/util/evented.d.ts +75 -0
- package/lib/map/util/evented.js +167 -0
- package/lib/map/util/task_queue.d.ts +18 -0
- package/lib/map/util/task_queue.js +62 -0
- package/lib/map/util/util.d.ts +104 -0
- package/lib/map/util/util.js +171 -0
- package/package.json +6 -3
- package/es/camera.d.ts +0 -86
- package/es/camera.js +0 -639
- package/es/earthmap.d.ts +0 -69
- package/es/earthmap.js +0 -445
- package/es/geo/edge_insets.d.ts +0 -54
- package/es/geo/lng_lat.d.ts +0 -18
- package/es/geo/lng_lat.js +0 -59
- package/es/geo/lng_lat_bounds.d.ts +0 -25
- package/es/geo/lng_lat_bounds.js +0 -118
- package/es/geo/mercator.d.ts +0 -30
- package/es/geo/mercator.js +0 -72
- package/es/geo/point.d.ts +0 -40
- package/es/geo/point.js +0 -153
- package/es/geo/simple.d.ts +0 -30
- package/es/geo/simple.js +0 -75
- package/es/geo/transform.d.ts +0 -198
- package/es/geo/transform.js +0 -895
- package/es/handler/IHandler.d.ts +0 -34
- package/es/handler/IHandler.js +0 -1
- package/es/handler/blockable_map_event.d.ts +0 -17
- package/es/handler/blockable_map_event.js +0 -58
- package/es/handler/box_zoom.js +0 -162
- package/es/handler/click_zoom.d.ts +0 -16
- package/es/handler/click_zoom.js +0 -40
- package/es/handler/events/event.d.ts +0 -4
- package/es/handler/events/event.js +0 -12
- package/es/handler/events/index.d.ts +0 -4
- package/es/handler/events/index.js +0 -4
- package/es/handler/events/map_mouse_event.d.ts +0 -34
- package/es/handler/events/map_mouse_event.js +0 -45
- package/es/handler/events/map_touch_event.d.ts +0 -57
- package/es/handler/events/map_touch_event.js +0 -75
- package/es/handler/events/map_wheel_event.d.ts +0 -33
- package/es/handler/events/map_wheel_event.js +0 -33
- package/es/handler/events/render_event.d.ts +0 -6
- package/es/handler/events/render_event.js +0 -10
- package/es/handler/handler_inertia.d.ts +0 -23
- package/es/handler/handler_manager.d.ts +0 -61
- package/es/handler/handler_manager.js +0 -487
- package/es/handler/handler_util.d.ts +0 -4
- package/es/handler/keyboard.d.ts +0 -36
- package/es/handler/keyboard.js +0 -131
- package/es/handler/map_event.d.ts +0 -29
- package/es/handler/map_event.js +0 -89
- package/es/handler/mouse/index.d.ts +0 -4
- package/es/handler/mouse/index.js +0 -4
- package/es/handler/mouse/mouse_handler.d.ts +0 -22
- package/es/handler/mouse/mouse_handler.js +0 -99
- package/es/handler/mouse/mousepan_handler.d.ts +0 -10
- package/es/handler/mouse/mousepan_handler.js +0 -21
- package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/es/handler/mouse/mousepitch_hander.js +0 -24
- package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/es/handler/mouse/mouserotate_hander.js +0 -24
- package/es/handler/mouse/util.d.ts +0 -6
- package/es/handler/mouse/util.js +0 -12
- package/es/handler/scroll_zoom.d.ts +0 -93
- package/es/handler/scroll_zoom.js +0 -315
- package/es/handler/shim/drag_pan.d.ts +0 -61
- package/es/handler/shim/drag_pan.js +0 -75
- package/es/handler/shim/drag_rotate.js +0 -64
- package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/es/handler/shim/touch_zoom_rotate.js +0 -104
- package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/es/handler/tap/single_tap_recognizer.js +0 -77
- package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/es/handler/tap/tap_drag_zoom.js +0 -89
- package/es/handler/tap/tap_recognizer.d.ts +0 -17
- package/es/handler/tap/tap_recognizer.js +0 -46
- package/es/handler/tap/tap_zoom.d.ts +0 -22
- package/es/handler/tap/tap_zoom.js +0 -81
- package/es/handler/touch/index.d.ts +0 -5
- package/es/handler/touch/index.js +0 -5
- package/es/handler/touch/touch_pan.d.ts +0 -30
- package/es/handler/touch/touch_pan.js +0 -91
- package/es/handler/touch/touch_pitch.d.ts +0 -13
- package/es/handler/touch/touch_pitch.js +0 -75
- package/es/handler/touch/touch_rotate.d.ts +0 -12
- package/es/handler/touch/touch_rotate.js +0 -57
- package/es/handler/touch/touch_zoom.d.ts +0 -12
- package/es/handler/touch/touch_zoom.js +0 -37
- package/es/handler/touch/two_touch.d.ts +0 -23
- package/es/handler/touch/two_touch.js +0 -98
- package/es/hash.d.ts +0 -14
- package/es/hash.js +0 -121
- package/es/interface.d.ts +0 -34
- package/es/interface.js +0 -1
- package/es/map.d.ts +0 -70
- package/es/map.js +0 -472
- package/es/util.d.ts +0 -25
- package/es/util.js +0 -70
- package/es/utils/Aabb.d.ts +0 -12
- package/es/utils/Aabb.js +0 -72
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -117
- package/es/utils/performance.d.ts +0 -17
- package/es/utils/performance.js +0 -58
- package/es/utils/primitives.d.ts +0 -6
- package/es/utils/primitives.js +0 -37
- package/es/utils/task_queue.d.ts +0 -13
- package/es/utils/task_queue.js +0 -60
- package/lib/camera.d.ts +0 -86
- package/lib/camera.js +0 -648
- package/lib/earthmap.d.ts +0 -69
- package/lib/earthmap.js +0 -451
- package/lib/geo/edge_insets.d.ts +0 -54
- package/lib/geo/lng_lat.d.ts +0 -18
- package/lib/geo/lng_lat.js +0 -67
- package/lib/geo/lng_lat_bounds.d.ts +0 -25
- package/lib/geo/lng_lat_bounds.js +0 -126
- package/lib/geo/mercator.d.ts +0 -30
- package/lib/geo/mercator.js +0 -88
- package/lib/geo/point.d.ts +0 -40
- package/lib/geo/point.js +0 -161
- package/lib/geo/simple.d.ts +0 -30
- package/lib/geo/simple.js +0 -92
- package/lib/geo/transform.d.ts +0 -198
- package/lib/geo/transform.js +0 -906
- package/lib/handler/IHandler.d.ts +0 -34
- package/lib/handler/IHandler.js +0 -5
- package/lib/handler/blockable_map_event.d.ts +0 -17
- package/lib/handler/blockable_map_event.js +0 -66
- package/lib/handler/box_zoom.js +0 -168
- package/lib/handler/click_zoom.d.ts +0 -16
- package/lib/handler/click_zoom.js +0 -48
- package/lib/handler/events/event.d.ts +0 -4
- package/lib/handler/events/event.js +0 -20
- package/lib/handler/events/index.d.ts +0 -4
- package/lib/handler/events/index.js +0 -27
- package/lib/handler/events/map_mouse_event.d.ts +0 -34
- package/lib/handler/events/map_mouse_event.js +0 -53
- package/lib/handler/events/map_touch_event.d.ts +0 -57
- package/lib/handler/events/map_touch_event.js +0 -83
- package/lib/handler/events/map_wheel_event.d.ts +0 -33
- package/lib/handler/events/map_wheel_event.js +0 -41
- package/lib/handler/events/render_event.d.ts +0 -6
- package/lib/handler/events/render_event.js +0 -18
- package/lib/handler/handler_inertia.d.ts +0 -23
- package/lib/handler/handler_manager.d.ts +0 -61
- package/lib/handler/handler_manager.js +0 -495
- package/lib/handler/handler_util.d.ts +0 -4
- package/lib/handler/keyboard.d.ts +0 -36
- package/lib/handler/keyboard.js +0 -138
- package/lib/handler/map_event.d.ts +0 -29
- package/lib/handler/map_event.js +0 -97
- package/lib/handler/mouse/index.d.ts +0 -4
- package/lib/handler/mouse/index.js +0 -27
- package/lib/handler/mouse/mouse_handler.d.ts +0 -22
- package/lib/handler/mouse/mouse_handler.js +0 -107
- package/lib/handler/mouse/mousepan_handler.d.ts +0 -10
- package/lib/handler/mouse/mousepan_handler.js +0 -29
- package/lib/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/lib/handler/mouse/mousepitch_hander.js +0 -32
- package/lib/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/lib/handler/mouse/mouserotate_hander.js +0 -32
- package/lib/handler/mouse/util.d.ts +0 -6
- package/lib/handler/mouse/util.js +0 -19
- package/lib/handler/scroll_zoom.d.ts +0 -93
- package/lib/handler/scroll_zoom.js +0 -322
- package/lib/handler/shim/drag_pan.d.ts +0 -61
- package/lib/handler/shim/drag_pan.js +0 -83
- package/lib/handler/shim/drag_rotate.js +0 -72
- package/lib/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/lib/handler/shim/touch_zoom_rotate.js +0 -112
- package/lib/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/lib/handler/tap/single_tap_recognizer.js +0 -86
- package/lib/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/lib/handler/tap/tap_drag_zoom.js +0 -97
- package/lib/handler/tap/tap_recognizer.d.ts +0 -17
- package/lib/handler/tap/tap_recognizer.js +0 -56
- package/lib/handler/tap/tap_zoom.d.ts +0 -22
- package/lib/handler/tap/tap_zoom.js +0 -89
- package/lib/handler/touch/index.d.ts +0 -5
- package/lib/handler/touch/index.js +0 -34
- package/lib/handler/touch/touch_pan.d.ts +0 -30
- package/lib/handler/touch/touch_pan.js +0 -100
- package/lib/handler/touch/touch_pitch.d.ts +0 -13
- package/lib/handler/touch/touch_pitch.js +0 -83
- package/lib/handler/touch/touch_rotate.d.ts +0 -12
- package/lib/handler/touch/touch_rotate.js +0 -65
- package/lib/handler/touch/touch_zoom.d.ts +0 -12
- package/lib/handler/touch/touch_zoom.js +0 -45
- package/lib/handler/touch/two_touch.d.ts +0 -23
- package/lib/handler/touch/two_touch.js +0 -106
- package/lib/hash.d.ts +0 -14
- package/lib/hash.js +0 -129
- package/lib/interface.d.ts +0 -34
- package/lib/interface.js +0 -5
- package/lib/map.d.ts +0 -70
- package/lib/map.js +0 -478
- package/lib/util.d.ts +0 -25
- package/lib/util.js +0 -89
- package/lib/utils/Aabb.d.ts +0 -12
- package/lib/utils/Aabb.js +0 -80
- package/lib/utils/dom.d.ts +0 -4
- package/lib/utils/dom.js +0 -125
- package/lib/utils/performance.d.ts +0 -17
- package/lib/utils/performance.js +0 -64
- package/lib/utils/primitives.d.ts +0 -6
- package/lib/utils/primitives.js +0 -45
- package/lib/utils/task_queue.d.ts +0 -13
- package/lib/utils/task_queue.js +0 -67
package/es/handler/keyboard.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
const defaultOptions = {
|
|
3
|
-
panStep: 100,
|
|
4
|
-
bearingStep: 15,
|
|
5
|
-
pitchStep: 10
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using
|
|
10
|
-
* the following keyboard shortcuts:
|
|
11
|
-
*
|
|
12
|
-
* - `=` / `+`: Increase the zoom level by 1.
|
|
13
|
-
* - `Shift-=` / `Shift-+`: Increase the zoom level by 2.
|
|
14
|
-
* - `-`: Decrease the zoom level by 1.
|
|
15
|
-
* - `Shift--`: Decrease the zoom level by 2.
|
|
16
|
-
* - Arrow keys: Pan by 100 pixels.
|
|
17
|
-
* - `Shift+⇢`: Increase the rotation by 15 degrees.
|
|
18
|
-
* - `Shift+⇠`: Decrease the rotation by 15 degrees.
|
|
19
|
-
* - `Shift+⇡`: Increase the pitch by 10 degrees.
|
|
20
|
-
* - `Shift+⇣`: Decrease the pitch by 10 degrees.
|
|
21
|
-
*/
|
|
22
|
-
class KeyboardHandler {
|
|
23
|
-
/**
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
constructor() {
|
|
27
|
-
_defineProperty(this, "enabled", void 0);
|
|
28
|
-
_defineProperty(this, "active", void 0);
|
|
29
|
-
_defineProperty(this, "panStep", void 0);
|
|
30
|
-
_defineProperty(this, "bearingStep", void 0);
|
|
31
|
-
_defineProperty(this, "pitchStep", void 0);
|
|
32
|
-
const stepOptions = defaultOptions;
|
|
33
|
-
this.panStep = stepOptions.panStep;
|
|
34
|
-
this.bearingStep = stepOptions.bearingStep;
|
|
35
|
-
this.pitchStep = stepOptions.pitchStep;
|
|
36
|
-
}
|
|
37
|
-
reset() {
|
|
38
|
-
this.active = false;
|
|
39
|
-
}
|
|
40
|
-
keydown(e) {
|
|
41
|
-
if (e.altKey || e.ctrlKey || e.metaKey) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
let zoomDir = 0;
|
|
45
|
-
let bearingDir = 0;
|
|
46
|
-
let pitchDir = 0;
|
|
47
|
-
let xDir = 0;
|
|
48
|
-
let yDir = 0;
|
|
49
|
-
switch (e.keyCode) {
|
|
50
|
-
case 61:
|
|
51
|
-
case 107:
|
|
52
|
-
case 171:
|
|
53
|
-
case 187:
|
|
54
|
-
zoomDir = 1;
|
|
55
|
-
break;
|
|
56
|
-
case 189:
|
|
57
|
-
case 109:
|
|
58
|
-
case 173:
|
|
59
|
-
zoomDir = -1;
|
|
60
|
-
break;
|
|
61
|
-
case 37:
|
|
62
|
-
if (e.shiftKey) {
|
|
63
|
-
bearingDir = -1;
|
|
64
|
-
} else {
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
xDir = -1;
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
case 39:
|
|
70
|
-
if (e.shiftKey) {
|
|
71
|
-
bearingDir = 1;
|
|
72
|
-
} else {
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
xDir = 1;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 38:
|
|
78
|
-
if (e.shiftKey) {
|
|
79
|
-
pitchDir = 1;
|
|
80
|
-
} else {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
yDir = -1;
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
|
-
case 40:
|
|
86
|
-
if (e.shiftKey) {
|
|
87
|
-
pitchDir = -1;
|
|
88
|
-
} else {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
yDir = 1;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
cameraAnimation: map => {
|
|
98
|
-
const zoom = map.getZoom();
|
|
99
|
-
map.easeTo({
|
|
100
|
-
duration: 300,
|
|
101
|
-
easeId: 'keyboardHandler',
|
|
102
|
-
easing: easeOut,
|
|
103
|
-
zoom: zoomDir ? Math.round(zoom) + zoomDir * (e.shiftKey ? 2 : 1) : zoom,
|
|
104
|
-
bearing: map.getBearing() + bearingDir * this.bearingStep,
|
|
105
|
-
pitch: map.getPitch() + pitchDir * this.pitchStep,
|
|
106
|
-
offset: [-xDir * this.panStep, -yDir * this.panStep],
|
|
107
|
-
center: map.getCenter()
|
|
108
|
-
}, {
|
|
109
|
-
originalEvent: e
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
enable() {
|
|
115
|
-
this.enabled = true;
|
|
116
|
-
}
|
|
117
|
-
disable() {
|
|
118
|
-
this.enabled = false;
|
|
119
|
-
this.reset();
|
|
120
|
-
}
|
|
121
|
-
isEnabled() {
|
|
122
|
-
return this.enabled;
|
|
123
|
-
}
|
|
124
|
-
isActive() {
|
|
125
|
-
return this.active;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function easeOut(t) {
|
|
129
|
-
return t * (2 - t);
|
|
130
|
-
}
|
|
131
|
-
export default KeyboardHandler;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { EarthMap } from '../earthmap';
|
|
2
|
-
import type Point from '../geo/point';
|
|
3
|
-
import type { Map } from '../map';
|
|
4
|
-
import { MapMouseEvent, MapTouchEvent, MapWheelEvent } from './events';
|
|
5
|
-
export default class MapEventHandler {
|
|
6
|
-
private mousedownPos;
|
|
7
|
-
private clickTolerance;
|
|
8
|
-
private map;
|
|
9
|
-
constructor(map: Map | EarthMap, options: {
|
|
10
|
-
clickTolerance: number;
|
|
11
|
-
});
|
|
12
|
-
reset(): void;
|
|
13
|
-
wheel(e: WheelEvent): {} | undefined;
|
|
14
|
-
mousedown(e: MouseEvent, point: Point): {} | undefined;
|
|
15
|
-
mouseup(e: MouseEvent): void;
|
|
16
|
-
click(e: MouseEvent, point: Point): void;
|
|
17
|
-
dblclick(e: MouseEvent): {} | undefined;
|
|
18
|
-
mouseover(e: MouseEvent): void;
|
|
19
|
-
mouseout(e: MouseEvent): void;
|
|
20
|
-
touchstart(e: TouchEvent): {} | undefined;
|
|
21
|
-
touchmove(e: TouchEvent): void;
|
|
22
|
-
touchend(e: TouchEvent): void;
|
|
23
|
-
touchcancel(e: TouchEvent): void;
|
|
24
|
-
firePreventable(mapEvent: MapMouseEvent | MapTouchEvent | MapWheelEvent): {} | undefined;
|
|
25
|
-
isEnabled(): boolean;
|
|
26
|
-
isActive(): boolean;
|
|
27
|
-
enable(): boolean;
|
|
28
|
-
disable(): boolean;
|
|
29
|
-
}
|
package/es/handler/map_event.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
|
|
4
|
-
import { MapMouseEvent, MapTouchEvent, MapWheelEvent } from "./events";
|
|
5
|
-
export default class MapEventHandler {
|
|
6
|
-
constructor(map, options) {
|
|
7
|
-
_defineProperty(this, "mousedownPos", void 0);
|
|
8
|
-
_defineProperty(this, "clickTolerance", void 0);
|
|
9
|
-
_defineProperty(this, "map", void 0);
|
|
10
|
-
this.map = map;
|
|
11
|
-
this.clickTolerance = options.clickTolerance;
|
|
12
|
-
}
|
|
13
|
-
reset() {
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
delete this.mousedownPos;
|
|
16
|
-
}
|
|
17
|
-
wheel(e) {
|
|
18
|
-
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
19
|
-
// - ScrollZoom
|
|
20
|
-
return this.firePreventable(new MapWheelEvent(e.type, this.map, e));
|
|
21
|
-
}
|
|
22
|
-
mousedown(e, point) {
|
|
23
|
-
this.mousedownPos = point;
|
|
24
|
-
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
25
|
-
// - MousePan
|
|
26
|
-
// - MouseRotate
|
|
27
|
-
// - MousePitch
|
|
28
|
-
// - DblclickHandler
|
|
29
|
-
return this.firePreventable(new MapMouseEvent(e.type, this.map, e));
|
|
30
|
-
}
|
|
31
|
-
mouseup(e) {
|
|
32
|
-
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
33
|
-
}
|
|
34
|
-
click(e, point) {
|
|
35
|
-
if (this.mousedownPos && this.mousedownPos.dist(point) >= this.clickTolerance) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
39
|
-
}
|
|
40
|
-
dblclick(e) {
|
|
41
|
-
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
42
|
-
// - DblClickZoom
|
|
43
|
-
return this.firePreventable(new MapMouseEvent(e.type, this.map, e));
|
|
44
|
-
}
|
|
45
|
-
mouseover(e) {
|
|
46
|
-
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
47
|
-
}
|
|
48
|
-
mouseout(e) {
|
|
49
|
-
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
50
|
-
}
|
|
51
|
-
touchstart(e) {
|
|
52
|
-
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
53
|
-
// - TouchPan
|
|
54
|
-
// - TouchZoom
|
|
55
|
-
// - TouchRotate
|
|
56
|
-
// - TouchPitch
|
|
57
|
-
// - TapZoom
|
|
58
|
-
// - SwipeZoom
|
|
59
|
-
return this.firePreventable(new MapTouchEvent(e.type, this.map, e));
|
|
60
|
-
}
|
|
61
|
-
touchmove(e) {
|
|
62
|
-
this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
|
|
63
|
-
}
|
|
64
|
-
touchend(e) {
|
|
65
|
-
this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
|
|
66
|
-
}
|
|
67
|
-
touchcancel(e) {
|
|
68
|
-
this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
|
|
69
|
-
}
|
|
70
|
-
firePreventable(mapEvent) {
|
|
71
|
-
this.map.emit(mapEvent.type, mapEvent);
|
|
72
|
-
if (mapEvent.defaultPrevented) {
|
|
73
|
-
// returning an object marks the handler as active and resets other handlers
|
|
74
|
-
return {};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
isEnabled() {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
isActive() {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
enable() {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
disable() {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type Point from '../../geo/point';
|
|
2
|
-
export default class MouseHandler {
|
|
3
|
-
protected enabled: boolean;
|
|
4
|
-
protected active: boolean;
|
|
5
|
-
protected lastPoint: Point;
|
|
6
|
-
protected eventButton: 1 | 2;
|
|
7
|
-
protected moved: boolean;
|
|
8
|
-
protected clickTolerance: number;
|
|
9
|
-
constructor(options: {
|
|
10
|
-
clickTolerance: number;
|
|
11
|
-
});
|
|
12
|
-
reset(): void;
|
|
13
|
-
mousedown(e: MouseEvent, point: Point): void;
|
|
14
|
-
mousemoveWindow(e: MouseEvent, point: Point): void;
|
|
15
|
-
mouseupWindow(e: MouseEvent): void;
|
|
16
|
-
enable(): void;
|
|
17
|
-
disable(): void;
|
|
18
|
-
isEnabled(): boolean;
|
|
19
|
-
isActive(): boolean;
|
|
20
|
-
protected correctButton(e: MouseEvent, button: number): boolean;
|
|
21
|
-
protected move(lastPoint: Point, point: Point): void;
|
|
22
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
|
|
4
|
-
import DOM from "../../utils/dom";
|
|
5
|
-
import { buttonStillPressed } from "./util";
|
|
6
|
-
export default class MouseHandler {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
_defineProperty(this, "enabled", void 0);
|
|
9
|
-
_defineProperty(this, "active", void 0);
|
|
10
|
-
_defineProperty(this, "lastPoint", void 0);
|
|
11
|
-
_defineProperty(this, "eventButton", void 0);
|
|
12
|
-
_defineProperty(this, "moved", void 0);
|
|
13
|
-
_defineProperty(this, "clickTolerance", void 0);
|
|
14
|
-
this.reset();
|
|
15
|
-
this.clickTolerance = options.clickTolerance || 1;
|
|
16
|
-
}
|
|
17
|
-
reset() {
|
|
18
|
-
this.active = false;
|
|
19
|
-
this.moved = false;
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
delete this.lastPoint;
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
delete this.eventButton;
|
|
24
|
-
}
|
|
25
|
-
mousedown(e, point) {
|
|
26
|
-
if (this.lastPoint) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const eventButton = DOM.mouseButton(e);
|
|
30
|
-
if (!this.correctButton(e, eventButton)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
this.lastPoint = point;
|
|
34
|
-
this.eventButton = eventButton;
|
|
35
|
-
}
|
|
36
|
-
mousemoveWindow(e, point) {
|
|
37
|
-
const lastPoint = this.lastPoint;
|
|
38
|
-
if (!lastPoint) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
if (buttonStillPressed(e, this.eventButton)) {
|
|
43
|
-
// Some browsers don't fire a `mouseup` when the mouseup occurs outside
|
|
44
|
-
// the window or iframe:
|
|
45
|
-
// https://github.com/mapbox/mapbox-gl-js/issues/4622
|
|
46
|
-
//
|
|
47
|
-
// If the button is no longer pressed during this `mousemove` it may have
|
|
48
|
-
// been released outside of the window or iframe.
|
|
49
|
-
this.reset();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
this.moved = true;
|
|
56
|
-
this.lastPoint = point;
|
|
57
|
-
|
|
58
|
-
// implemented by child class
|
|
59
|
-
return this.move(lastPoint, point);
|
|
60
|
-
}
|
|
61
|
-
mouseupWindow(e) {
|
|
62
|
-
if (!this.lastPoint) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const eventButton = DOM.mouseButton(e);
|
|
66
|
-
if (eventButton !== this.eventButton) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (this.moved) {
|
|
70
|
-
DOM.suppressClick();
|
|
71
|
-
}
|
|
72
|
-
this.reset();
|
|
73
|
-
}
|
|
74
|
-
enable() {
|
|
75
|
-
this.enabled = true;
|
|
76
|
-
}
|
|
77
|
-
disable() {
|
|
78
|
-
this.enabled = false;
|
|
79
|
-
this.reset();
|
|
80
|
-
}
|
|
81
|
-
isEnabled() {
|
|
82
|
-
return this.enabled;
|
|
83
|
-
}
|
|
84
|
-
isActive() {
|
|
85
|
-
return this.active;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
-
correctButton(e, button) {
|
|
90
|
-
// eslint-disable-line
|
|
91
|
-
return false; // implemented by child
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
95
|
-
move(lastPoint, point) {
|
|
96
|
-
// eslint-disable-line
|
|
97
|
-
return; // implemented by child
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type Point from '../../geo/point';
|
|
2
|
-
import MouseHandler from './mouse_handler';
|
|
3
|
-
export default class MousePanHandler extends MouseHandler {
|
|
4
|
-
mousedown(e: MouseEvent, point: Point): void;
|
|
5
|
-
move(lastPoint: Point, point: Point): {
|
|
6
|
-
around: Point;
|
|
7
|
-
panDelta: Point;
|
|
8
|
-
};
|
|
9
|
-
protected correctButton(e: MouseEvent, button: number): boolean;
|
|
10
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
|
|
3
|
-
import MouseHandler from "./mouse_handler";
|
|
4
|
-
import { LEFT_BUTTON } from "./util";
|
|
5
|
-
export default class MousePanHandler extends MouseHandler {
|
|
6
|
-
mousedown(e, point) {
|
|
7
|
-
super.mousedown(e, point);
|
|
8
|
-
if (this.lastPoint) {
|
|
9
|
-
this.active = true;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
move(lastPoint, point) {
|
|
13
|
-
return {
|
|
14
|
-
around: point,
|
|
15
|
-
panDelta: point.sub(lastPoint)
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
correctButton(e, button) {
|
|
19
|
-
return button === LEFT_BUTTON && !e.ctrlKey;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type Point from '../../geo/point';
|
|
2
|
-
import MouseHandler from './mouse_handler';
|
|
3
|
-
export default class MousePitchHandler extends MouseHandler {
|
|
4
|
-
correctButton(e: MouseEvent, button: number): boolean;
|
|
5
|
-
move(lastPoint: Point, point: Point): {
|
|
6
|
-
pitchDelta: number;
|
|
7
|
-
} | undefined;
|
|
8
|
-
contextmenu(e: MouseEvent): void;
|
|
9
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
|
|
3
|
-
import MouseHandler from "./mouse_handler";
|
|
4
|
-
import { LEFT_BUTTON, RIGHT_BUTTON } from "./util";
|
|
5
|
-
export default class MousePitchHandler extends MouseHandler {
|
|
6
|
-
correctButton(e, button) {
|
|
7
|
-
return button === LEFT_BUTTON && e.ctrlKey || button === RIGHT_BUTTON;
|
|
8
|
-
}
|
|
9
|
-
move(lastPoint, point) {
|
|
10
|
-
const degreesPerPixelMoved = -0.5;
|
|
11
|
-
const pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;
|
|
12
|
-
if (pitchDelta) {
|
|
13
|
-
this.active = true;
|
|
14
|
-
return {
|
|
15
|
-
pitchDelta
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
contextmenu(e) {
|
|
20
|
-
// prevent browser context menu when necessary; we don't allow it with rotation
|
|
21
|
-
// because we can't discern rotation gesture start from contextmenu on Mac
|
|
22
|
-
e.preventDefault();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type Point from '../../geo/point';
|
|
2
|
-
import MouseHandler from './mouse_handler';
|
|
3
|
-
export default class MouseRotateHandler extends MouseHandler {
|
|
4
|
-
contextmenu(e: MouseEvent): void;
|
|
5
|
-
protected correctButton(e: MouseEvent, button: number): boolean;
|
|
6
|
-
protected move(lastPoint: Point, point: Point): {
|
|
7
|
-
bearingDelta: number;
|
|
8
|
-
} | undefined;
|
|
9
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
|
|
3
|
-
import MouseHandler from "./mouse_handler";
|
|
4
|
-
import { LEFT_BUTTON, RIGHT_BUTTON } from "./util";
|
|
5
|
-
export default class MouseRotateHandler extends MouseHandler {
|
|
6
|
-
contextmenu(e) {
|
|
7
|
-
// prevent browser context menu when necessary; we don't allow it with rotation
|
|
8
|
-
// because we can't discern rotation gesture start from contextmenu on Mac
|
|
9
|
-
e.preventDefault();
|
|
10
|
-
}
|
|
11
|
-
correctButton(e, button) {
|
|
12
|
-
return button === LEFT_BUTTON && e.ctrlKey || button === RIGHT_BUTTON;
|
|
13
|
-
}
|
|
14
|
-
move(lastPoint, point) {
|
|
15
|
-
const degreesPerPixelMoved = 0.8;
|
|
16
|
-
const bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;
|
|
17
|
-
if (bearingDelta) {
|
|
18
|
-
this.active = true;
|
|
19
|
-
return {
|
|
20
|
-
bearingDelta
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
package/es/handler/mouse/util.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const LEFT_BUTTON = 0;
|
|
2
|
-
export const RIGHT_BUTTON = 2;
|
|
3
|
-
|
|
4
|
-
// the values for each button in MouseEvent.buttons
|
|
5
|
-
export const BUTTONS_FLAGS = {
|
|
6
|
-
[LEFT_BUTTON]: 1,
|
|
7
|
-
[RIGHT_BUTTON]: 2
|
|
8
|
-
};
|
|
9
|
-
export function buttonStillPressed(e, button) {
|
|
10
|
-
const flag = BUTTONS_FLAGS[button];
|
|
11
|
-
return e.buttons === undefined || (e.buttons & flag) !== flag;
|
|
12
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { EarthMap } from '../earthmap';
|
|
2
|
-
import type Point from '../geo/point';
|
|
3
|
-
import type { Map } from '../map';
|
|
4
|
-
import type HandlerManager from './handler_manager';
|
|
5
|
-
/**
|
|
6
|
-
* The `ScrollZoomHandler` allows the user to zoom the map by scrolling.
|
|
7
|
-
*/
|
|
8
|
-
declare class ScrollZoomHandler {
|
|
9
|
-
private map;
|
|
10
|
-
private el;
|
|
11
|
-
private enabled;
|
|
12
|
-
private active;
|
|
13
|
-
private zooming;
|
|
14
|
-
private aroundCenter;
|
|
15
|
-
private around;
|
|
16
|
-
private aroundPoint;
|
|
17
|
-
private type;
|
|
18
|
-
private lastValue;
|
|
19
|
-
private timeout;
|
|
20
|
-
private finishTimeout;
|
|
21
|
-
private lastWheelEvent;
|
|
22
|
-
private lastWheelEventTime;
|
|
23
|
-
private startZoom;
|
|
24
|
-
private targetZoom;
|
|
25
|
-
private delta;
|
|
26
|
-
private easing;
|
|
27
|
-
private prevEase;
|
|
28
|
-
private frameId;
|
|
29
|
-
private handler;
|
|
30
|
-
private defaultZoomRate;
|
|
31
|
-
private wheelZoomRate;
|
|
32
|
-
/**
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
constructor(map: Map | EarthMap, handler: HandlerManager);
|
|
36
|
-
/**
|
|
37
|
-
* Set the zoom rate of a trackpad
|
|
38
|
-
* @param {number} [zoomRate=1/100] The rate used to scale trackpad movement to a zoom value.
|
|
39
|
-
* @example
|
|
40
|
-
* // Speed up trackpad zoom
|
|
41
|
-
* map.scrollZoom.setZoomRate(1/25);
|
|
42
|
-
*/
|
|
43
|
-
setZoomRate(zoomRate: number): void;
|
|
44
|
-
/**
|
|
45
|
-
* Set the zoom rate of a mouse wheel
|
|
46
|
-
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
|
|
47
|
-
* @example
|
|
48
|
-
* // Slow down zoom of mouse wheel
|
|
49
|
-
* map.scrollZoom.setWheelZoomRate(1/600);
|
|
50
|
-
*/
|
|
51
|
-
setWheelZoomRate(zoomRate: number): void;
|
|
52
|
-
/**
|
|
53
|
-
* Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.
|
|
54
|
-
*
|
|
55
|
-
* @returns {boolean} `true` if the "scroll to zoom" interaction is enabled.
|
|
56
|
-
*/
|
|
57
|
-
isEnabled(): boolean;
|
|
58
|
-
isActive(): boolean;
|
|
59
|
-
isZooming(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Enables the "scroll to zoom" interaction.
|
|
62
|
-
*
|
|
63
|
-
* @param {Object} [options] Options object.
|
|
64
|
-
* @param {string} [options.around] If "center" is passed, map will zoom around center of map
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* map.scrollZoom.enable();
|
|
68
|
-
* @example
|
|
69
|
-
* map.scrollZoom.enable({ around: 'center' })
|
|
70
|
-
*/
|
|
71
|
-
enable(options?: any): void;
|
|
72
|
-
/**
|
|
73
|
-
* Disables the "scroll to zoom" interaction.
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* map.scrollZoom.disable();
|
|
77
|
-
*/
|
|
78
|
-
disable(): void;
|
|
79
|
-
wheel(e: WheelEvent): void;
|
|
80
|
-
renderFrame(): {
|
|
81
|
-
noInertia: boolean;
|
|
82
|
-
needsRenderFrame: boolean;
|
|
83
|
-
zoomDelta: number;
|
|
84
|
-
around: Point;
|
|
85
|
-
originalEvent: any;
|
|
86
|
-
} | undefined;
|
|
87
|
-
reset(): void;
|
|
88
|
-
private onScrollFrame;
|
|
89
|
-
private onTimeout;
|
|
90
|
-
private start;
|
|
91
|
-
private smoothOutEasing;
|
|
92
|
-
}
|
|
93
|
-
export default ScrollZoomHandler;
|