@antv/l7-map 2.5.36 → 2.5.37-mini12

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.
Files changed (198) hide show
  1. package/lib/camera.js.map +1 -1
  2. package/lib/earthmap.js +7 -26
  3. package/lib/earthmap.js.map +1 -1
  4. package/lib/geo/lng_lat.js +1 -1
  5. package/lib/geo/mercator.js +11 -7
  6. package/lib/geo/mercator.js.map +1 -1
  7. package/lib/geo/simple.js +11 -7
  8. package/lib/geo/simple.js.map +1 -1
  9. package/lib/geo/transform.js +6 -2
  10. package/lib/geo/transform.js.map +1 -1
  11. package/lib/handler/handler_manager.js +55 -33
  12. package/lib/handler/handler_manager.js.map +1 -1
  13. package/lib/handler/mouse/index.js +4 -4
  14. package/lib/handler/mouse/util.js +1 -1
  15. package/lib/handler/shim/drag_pan.js +10 -2
  16. package/lib/handler/shim/drag_pan.js.map +1 -1
  17. package/lib/handler/shim/touch_zoom_rotate.js +10 -2
  18. package/lib/handler/shim/touch_zoom_rotate.js.map +1 -1
  19. package/lib/handler/tap/single_tap_recognizer.js +1 -1
  20. package/lib/handler/tap/tap_recognizer.js +6 -2
  21. package/lib/handler/tap/tap_recognizer.js.map +1 -1
  22. package/lib/hash.js +9 -4
  23. package/lib/hash.js.map +1 -1
  24. package/lib/map.js +39 -19
  25. package/lib/map.js.map +1 -1
  26. package/lib/util.js +14 -9
  27. package/lib/util.js.map +1 -1
  28. package/lib/utils/dom.js +66 -26
  29. package/lib/utils/dom.js.map +1 -1
  30. package/lib/utils/performance.js +4 -1
  31. package/lib/utils/performance.js.map +1 -1
  32. package/package.json +3 -3
  33. package/LICENSE.md +0 -21
  34. package/es/camera.d.ts +0 -82
  35. package/es/camera.js +0 -729
  36. package/es/camera.js.map +0 -1
  37. package/es/earthmap.d.ts +0 -67
  38. package/es/earthmap.js +0 -454
  39. package/es/earthmap.js.map +0 -1
  40. package/es/geo/edge_insets.d.ts +0 -54
  41. package/es/geo/edge_insets.js +0 -88
  42. package/es/geo/edge_insets.js.map +0 -1
  43. package/es/geo/lng_lat.d.ts +0 -18
  44. package/es/geo/lng_lat.js +0 -77
  45. package/es/geo/lng_lat.js.map +0 -1
  46. package/es/geo/lng_lat_bounds.d.ts +0 -24
  47. package/es/geo/lng_lat_bounds.js +0 -170
  48. package/es/geo/lng_lat_bounds.js.map +0 -1
  49. package/es/geo/mercator.d.ts +0 -28
  50. package/es/geo/mercator.js +0 -79
  51. package/es/geo/mercator.js.map +0 -1
  52. package/es/geo/point.d.ts +0 -40
  53. package/es/geo/point.js +0 -237
  54. package/es/geo/point.js.map +0 -1
  55. package/es/geo/simple.d.ts +0 -28
  56. package/es/geo/simple.js +0 -78
  57. package/es/geo/simple.js.map +0 -1
  58. package/es/geo/transform.d.ts +0 -198
  59. package/es/geo/transform.js +0 -663
  60. package/es/geo/transform.js.map +0 -1
  61. package/es/handler/IHandler.d.ts +0 -34
  62. package/es/handler/IHandler.js +0 -2
  63. package/es/handler/IHandler.js.map +0 -1
  64. package/es/handler/blockable_map_event.d.ts +0 -17
  65. package/es/handler/blockable_map_event.js +0 -84
  66. package/es/handler/blockable_map_event.js.map +0 -1
  67. package/es/handler/box_zoom.d.ts +0 -59
  68. package/es/handler/box_zoom.js +0 -184
  69. package/es/handler/box_zoom.js.map +0 -1
  70. package/es/handler/click_zoom.d.ts +0 -16
  71. package/es/handler/click_zoom.js +0 -64
  72. package/es/handler/click_zoom.js.map +0 -1
  73. package/es/handler/events/event.d.ts +0 -4
  74. package/es/handler/events/event.js +0 -14
  75. package/es/handler/events/event.js.map +0 -1
  76. package/es/handler/events/index.d.ts +0 -4
  77. package/es/handler/events/index.js +0 -5
  78. package/es/handler/events/index.js.map +0 -1
  79. package/es/handler/events/map_mouse_event.d.ts +0 -34
  80. package/es/handler/events/map_mouse_event.js +0 -65
  81. package/es/handler/events/map_mouse_event.js.map +0 -1
  82. package/es/handler/events/map_touch_event.d.ts +0 -57
  83. package/es/handler/events/map_touch_event.js +0 -75
  84. package/es/handler/events/map_touch_event.js.map +0 -1
  85. package/es/handler/events/map_wheel_event.d.ts +0 -33
  86. package/es/handler/events/map_wheel_event.js +0 -52
  87. package/es/handler/events/map_wheel_event.js.map +0 -1
  88. package/es/handler/events/render_event.d.ts +0 -5
  89. package/es/handler/events/render_event.js +0 -41
  90. package/es/handler/events/render_event.js.map +0 -1
  91. package/es/handler/handler_inertia.d.ts +0 -23
  92. package/es/handler/handler_inertia.js +0 -186
  93. package/es/handler/handler_inertia.js.map +0 -1
  94. package/es/handler/handler_manager.d.ts +0 -57
  95. package/es/handler/handler_manager.js +0 -655
  96. package/es/handler/handler_manager.js.map +0 -1
  97. package/es/handler/handler_util.d.ts +0 -4
  98. package/es/handler/handler_util.js +0 -10
  99. package/es/handler/handler_util.js.map +0 -1
  100. package/es/handler/keyboard.d.ts +0 -36
  101. package/es/handler/keyboard.js +0 -157
  102. package/es/handler/keyboard.js.map +0 -1
  103. package/es/handler/map_event.d.ts +0 -29
  104. package/es/handler/map_event.js +0 -120
  105. package/es/handler/map_event.js.map +0 -1
  106. package/es/handler/mouse/index.d.ts +0 -4
  107. package/es/handler/mouse/index.js +0 -5
  108. package/es/handler/mouse/index.js.map +0 -1
  109. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  110. package/es/handler/mouse/mouse_handler.js +0 -131
  111. package/es/handler/mouse/mouse_handler.js.map +0 -1
  112. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  113. package/es/handler/mouse/mousepan_handler.js +0 -54
  114. package/es/handler/mouse/mousepan_handler.js.map +0 -1
  115. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  116. package/es/handler/mouse/mousepitch_hander.js +0 -54
  117. package/es/handler/mouse/mousepitch_hander.js.map +0 -1
  118. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  119. package/es/handler/mouse/mouserotate_hander.js +0 -54
  120. package/es/handler/mouse/mouserotate_hander.js.map +0 -1
  121. package/es/handler/mouse/util.d.ts +0 -6
  122. package/es/handler/mouse/util.js +0 -12
  123. package/es/handler/mouse/util.js.map +0 -1
  124. package/es/handler/scroll_zoom.d.ts +0 -93
  125. package/es/handler/scroll_zoom.js +0 -317
  126. package/es/handler/scroll_zoom.js.map +0 -1
  127. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  128. package/es/handler/shim/dblclick_zoom.js +0 -45
  129. package/es/handler/shim/dblclick_zoom.js.map +0 -1
  130. package/es/handler/shim/drag_pan.d.ts +0 -61
  131. package/es/handler/shim/drag_pan.js +0 -53
  132. package/es/handler/shim/drag_pan.js.map +0 -1
  133. package/es/handler/shim/drag_rotate.d.ts +0 -46
  134. package/es/handler/shim/drag_rotate.js +0 -51
  135. package/es/handler/shim/drag_rotate.js.map +0 -1
  136. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  137. package/es/handler/shim/touch_zoom_rotate.js +0 -80
  138. package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
  139. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  140. package/es/handler/tap/single_tap_recognizer.js +0 -127
  141. package/es/handler/tap/single_tap_recognizer.js.map +0 -1
  142. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  143. package/es/handler/tap/tap_drag_zoom.js +0 -124
  144. package/es/handler/tap/tap_drag_zoom.js.map +0 -1
  145. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  146. package/es/handler/tap/tap_recognizer.js +0 -72
  147. package/es/handler/tap/tap_recognizer.js.map +0 -1
  148. package/es/handler/tap/tap_zoom.d.ts +0 -22
  149. package/es/handler/tap/tap_zoom.js +0 -124
  150. package/es/handler/tap/tap_zoom.js.map +0 -1
  151. package/es/handler/touch/index.d.ts +0 -5
  152. package/es/handler/touch/index.js +0 -6
  153. package/es/handler/touch/index.js.map +0 -1
  154. package/es/handler/touch/touch_pan.d.ts +0 -30
  155. package/es/handler/touch/touch_pan.js +0 -139
  156. package/es/handler/touch/touch_pan.js.map +0 -1
  157. package/es/handler/touch/touch_pitch.d.ts +0 -13
  158. package/es/handler/touch/touch_pitch.js +0 -120
  159. package/es/handler/touch/touch_pitch.js.map +0 -1
  160. package/es/handler/touch/touch_rotate.d.ts +0 -12
  161. package/es/handler/touch/touch_rotate.js +0 -88
  162. package/es/handler/touch/touch_rotate.js.map +0 -1
  163. package/es/handler/touch/touch_zoom.d.ts +0 -12
  164. package/es/handler/touch/touch_zoom.js +0 -79
  165. package/es/handler/touch/touch_zoom.js.map +0 -1
  166. package/es/handler/touch/two_touch.d.ts +0 -23
  167. package/es/handler/touch/two_touch.js +0 -140
  168. package/es/handler/touch/two_touch.js.map +0 -1
  169. package/es/hash.d.ts +0 -15
  170. package/es/hash.js +0 -143
  171. package/es/hash.js.map +0 -1
  172. package/es/index.d.ts +0 -2
  173. package/es/index.js +0 -3
  174. package/es/index.js.map +0 -1
  175. package/es/interface.d.ts +0 -31
  176. package/es/interface.js +0 -2
  177. package/es/interface.js.map +0 -1
  178. package/es/map.d.ts +0 -67
  179. package/es/map.js +0 -454
  180. package/es/map.js.map +0 -1
  181. package/es/util.d.ts +0 -18
  182. package/es/util.js +0 -74
  183. package/es/util.js.map +0 -1
  184. package/es/utils/Aabb.d.ts +0 -12
  185. package/es/utils/Aabb.js +0 -134
  186. package/es/utils/Aabb.js.map +0 -1
  187. package/es/utils/dom.d.ts +0 -4
  188. package/es/utils/dom.js +0 -165
  189. package/es/utils/dom.js.map +0 -1
  190. package/es/utils/performance.d.ts +0 -17
  191. package/es/utils/performance.js +0 -57
  192. package/es/utils/performance.js.map +0 -1
  193. package/es/utils/primitives.d.ts +0 -6
  194. package/es/utils/primitives.js +0 -44
  195. package/es/utils/primitives.js.map +0 -1
  196. package/es/utils/task_queue.d.ts +0 -13
  197. package/es/utils/task_queue.js +0 -113
  198. package/es/utils/task_queue.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/mouse/mouse_handler.ts"],"names":["DOM","buttonStillPressed","MouseHandler","options","reset","clickTolerance","active","moved","lastPoint","eventButton","e","point","mouseButton","correctButton","preventDefault","dist","move","suppressClick","enabled","button"],"mappings":";;;AAEA,OAAOA,GAAP,MAAgB,iBAAhB;AACA,SAASC,kBAAT,QAAmC,QAAnC;;IACqBC,Y;AAQnB,wBAAYC,OAAZ,EAAiD;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAC/C,SAAKC,KAAL;AACA,SAAKC,cAAL,GAAsBF,OAAO,CAACE,cAAR,IAA0B,CAAhD;AACD;;;;WAED,iBAAe;AACb,WAAKC,MAAL,GAAc,KAAd;AACA,WAAKC,KAAL,GAAa,KAAb;AACA,aAAO,KAAKC,SAAZ;AACA,aAAO,KAAKC,WAAZ;AACD;;;WAED,mBAAiBC,CAAjB,EAAgCC,KAAhC,EAA8C;AAC5C,UAAI,KAAKH,SAAT,EAAoB;AAClB;AACD;;AAED,UAAMC,WAAW,GAAGT,GAAG,CAACY,WAAJ,CAAgBF,CAAhB,CAApB;;AACA,UAAI,CAAC,KAAKG,aAAL,CAAmBH,CAAnB,EAAsBD,WAAtB,CAAL,EAAyC;AACvC;AACD;;AAED,WAAKD,SAAL,GAAiBG,KAAjB;AACA,WAAKF,WAAL,GAAmBA,WAAnB;AACD;;;WAED,yBAAuBC,CAAvB,EAAsCC,KAAtC,EAAoD;AAClD,UAAMH,SAAS,GAAG,KAAKA,SAAvB;;AACA,UAAI,CAACA,SAAL,EAAgB;AACd;AACD;;AACDE,MAAAA,CAAC,CAACI,cAAF;;AAEA,UAAIb,kBAAkB,CAACS,CAAD,EAAI,KAAKD,WAAT,CAAtB,EAA6C;AAO3C,aAAKL,KAAL;AACA;AACD;;AAED,UAAI,CAAC,KAAKG,KAAN,IAAeI,KAAK,CAACI,IAAN,CAAWP,SAAX,IAAwB,KAAKH,cAAhD,EAAgE;AAC9D;AACD;;AACD,WAAKE,KAAL,GAAa,IAAb;AACA,WAAKC,SAAL,GAAiBG,KAAjB;AAGA,aAAO,KAAKK,IAAL,CAAUR,SAAV,EAAqBG,KAArB,CAAP;AACD;;;WAED,uBAAqBD,CAArB,EAAoC;AAClC,UAAI,CAAC,KAAKF,SAAV,EAAqB;AACnB;AACD;;AACD,UAAMC,WAAW,GAAGT,GAAG,CAACY,WAAJ,CAAgBF,CAAhB,CAApB;;AACA,UAAID,WAAW,KAAK,KAAKA,WAAzB,EAAsC;AACpC;AACD;;AACD,UAAI,KAAKF,KAAT,EAAgB;AACdP,QAAAA,GAAG,CAACiB,aAAJ;AACD;;AACD,WAAKb,KAAL;AACD;;;WAED,kBAAgB;AACd,WAAKc,OAAL,GAAe,IAAf;AACD;;;WAED,mBAAiB;AACf,WAAKA,OAAL,GAAe,KAAf;AACA,WAAKd,KAAL;AACD;;;WAED,qBAAmB;AACjB,aAAO,KAAKc,OAAZ;AACD;;;WAED,oBAAkB;AAChB,aAAO,KAAKZ,MAAZ;AACD;;;WAED,uBAAwBI,CAAxB,EAAuCS,MAAvC,EAAuD;AAErD,aAAO,KAAP;AACD;;;WAED,cAAeX,SAAf,EAAiCG,KAAjC,EAA+C;AAE7C;AACD;;;;;;SArGkBT,Y","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport DOM from '../../utils/dom';\nimport { buttonStillPressed } from './util';\nexport default class MouseHandler {\n protected enabled: boolean;\n protected active: boolean;\n protected lastPoint: Point;\n protected eventButton: 1 | 2;\n protected moved: boolean;\n protected clickTolerance: number;\n\n constructor(options: { clickTolerance: number }) {\n this.reset();\n this.clickTolerance = options.clickTolerance || 1;\n }\n\n public reset() {\n this.active = false;\n this.moved = false;\n delete this.lastPoint;\n delete this.eventButton;\n }\n\n public mousedown(e: MouseEvent, point: Point) {\n if (this.lastPoint) {\n return;\n }\n\n const eventButton = DOM.mouseButton(e);\n if (!this.correctButton(e, eventButton)) {\n return;\n }\n\n this.lastPoint = point;\n this.eventButton = eventButton;\n }\n\n public mousemoveWindow(e: MouseEvent, point: Point) {\n const lastPoint = this.lastPoint;\n if (!lastPoint) {\n return;\n }\n e.preventDefault();\n\n if (buttonStillPressed(e, this.eventButton)) {\n // Some browsers don't fire a `mouseup` when the mouseup occurs outside\n // the window or iframe:\n // https://github.com/mapbox/mapbox-gl-js/issues/4622\n //\n // If the button is no longer pressed during this `mousemove` it may have\n // been released outside of the window or iframe.\n this.reset();\n return;\n }\n\n if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {\n return;\n }\n this.moved = true;\n this.lastPoint = point;\n\n // implemented by child class\n return this.move(lastPoint, point);\n }\n\n public mouseupWindow(e: MouseEvent) {\n if (!this.lastPoint) {\n return;\n }\n const eventButton = DOM.mouseButton(e);\n if (eventButton !== this.eventButton) {\n return;\n }\n if (this.moved) {\n DOM.suppressClick();\n }\n this.reset();\n }\n\n public enable() {\n this.enabled = true;\n }\n\n public disable() {\n this.enabled = false;\n this.reset();\n }\n\n public isEnabled() {\n return this.enabled;\n }\n\n public isActive() {\n return this.active;\n }\n\n protected correctButton(e: MouseEvent, button: number) {\n // eslint-disable-line\n return false; // implemented by child\n }\n\n protected move(lastPoint: Point, point: Point) {\n // eslint-disable-line\n return; // implemented by child\n }\n}\n"],"file":"mouse_handler.js"}
@@ -1,10 +0,0 @@
1
- import 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,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _get from "@babel/runtime/helpers/get";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
-
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
-
10
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
-
12
- import MouseHandler from './mouse_handler';
13
- import { LEFT_BUTTON } from './util';
14
-
15
- var MousePanHandler = function (_MouseHandler) {
16
- _inherits(MousePanHandler, _MouseHandler);
17
-
18
- var _super = _createSuper(MousePanHandler);
19
-
20
- function MousePanHandler() {
21
- _classCallCheck(this, MousePanHandler);
22
-
23
- return _super.apply(this, arguments);
24
- }
25
-
26
- _createClass(MousePanHandler, [{
27
- key: "mousedown",
28
- value: function mousedown(e, point) {
29
- _get(_getPrototypeOf(MousePanHandler.prototype), "mousedown", this).call(this, e, point);
30
-
31
- if (this.lastPoint) {
32
- this.active = true;
33
- }
34
- }
35
- }, {
36
- key: "move",
37
- value: function move(lastPoint, point) {
38
- return {
39
- around: point,
40
- panDelta: point.sub(lastPoint)
41
- };
42
- }
43
- }, {
44
- key: "correctButton",
45
- value: function correctButton(e, button) {
46
- return button === LEFT_BUTTON && !e.ctrlKey;
47
- }
48
- }]);
49
-
50
- return MousePanHandler;
51
- }(MouseHandler);
52
-
53
- export { MousePanHandler as default };
54
- //# sourceMappingURL=mousepan_handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/mouse/mousepan_handler.ts"],"names":["MouseHandler","LEFT_BUTTON","MousePanHandler","e","point","lastPoint","active","around","panDelta","sub","button","ctrlKey"],"mappings":";;;;;;;;;;;AAGA,OAAOA,YAAP,MAAyB,iBAAzB;AACA,SAA6BC,WAA7B,QAAgD,QAAhD;;IACqBC,e;;;;;;;;;;;;;WACnB,mBAAiBC,CAAjB,EAAgCC,KAAhC,EAA8C;AAC5C,qFAAgBD,CAAhB,EAAmBC,KAAnB;;AACA,UAAI,KAAKC,SAAT,EAAoB;AAClB,aAAKC,MAAL,GAAc,IAAd;AACD;AACF;;;WAED,cAAYD,SAAZ,EAA8BD,KAA9B,EAA4C;AAC1C,aAAO;AACLG,QAAAA,MAAM,EAAEH,KADH;AAELI,QAAAA,QAAQ,EAAEJ,KAAK,CAACK,GAAN,CAAUJ,SAAV;AAFL,OAAP;AAID;;;WACD,uBAAwBF,CAAxB,EAAuCO,MAAvC,EAAuD;AACrD,aAAOA,MAAM,KAAKT,WAAX,IAA0B,CAACE,CAAC,CAACQ,OAApC;AACD;;;;EAhB0CX,Y;;SAAxBE,e","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport DOM from '../../utils/dom';\nimport MouseHandler from './mouse_handler';\nimport { buttonStillPressed, LEFT_BUTTON } from './util';\nexport default class MousePanHandler extends MouseHandler {\n public mousedown(e: MouseEvent, point: Point) {\n super.mousedown(e, point);\n if (this.lastPoint) {\n this.active = true;\n }\n }\n\n public move(lastPoint: Point, point: Point) {\n return {\n around: point,\n panDelta: point.sub(lastPoint),\n };\n }\n protected correctButton(e: MouseEvent, button: number) {\n return button === LEFT_BUTTON && !e.ctrlKey;\n }\n}\n"],"file":"mousepan_handler.js"}
@@ -1,9 +0,0 @@
1
- import 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,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
- import MouseHandler from './mouse_handler';
12
- import { LEFT_BUTTON, RIGHT_BUTTON } from './util';
13
-
14
- var MousePitchHandler = function (_MouseHandler) {
15
- _inherits(MousePitchHandler, _MouseHandler);
16
-
17
- var _super = _createSuper(MousePitchHandler);
18
-
19
- function MousePitchHandler() {
20
- _classCallCheck(this, MousePitchHandler);
21
-
22
- return _super.apply(this, arguments);
23
- }
24
-
25
- _createClass(MousePitchHandler, [{
26
- key: "correctButton",
27
- value: function correctButton(e, button) {
28
- return button === LEFT_BUTTON && e.ctrlKey || button === RIGHT_BUTTON;
29
- }
30
- }, {
31
- key: "move",
32
- value: function move(lastPoint, point) {
33
- var degreesPerPixelMoved = -0.5;
34
- var pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;
35
-
36
- if (pitchDelta) {
37
- this.active = true;
38
- return {
39
- pitchDelta: pitchDelta
40
- };
41
- }
42
- }
43
- }, {
44
- key: "contextmenu",
45
- value: function contextmenu(e) {
46
- e.preventDefault();
47
- }
48
- }]);
49
-
50
- return MousePitchHandler;
51
- }(MouseHandler);
52
-
53
- export { MousePitchHandler as default };
54
- //# sourceMappingURL=mousepitch_hander.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/mouse/mousepitch_hander.ts"],"names":["MouseHandler","LEFT_BUTTON","RIGHT_BUTTON","MousePitchHandler","e","button","ctrlKey","lastPoint","point","degreesPerPixelMoved","pitchDelta","y","active","preventDefault"],"mappings":";;;;;;;;;;AAEA,OAAOA,YAAP,MAAyB,iBAAzB;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,QAA1C;;IACqBC,iB;;;;;;;;;;;;;WACnB,uBAAqBC,CAArB,EAAoCC,MAApC,EAAoD;AAClD,aAAQA,MAAM,KAAKJ,WAAX,IAA0BG,CAAC,CAACE,OAA7B,IAAyCD,MAAM,KAAKH,YAA3D;AACD;;;WAED,cAAYK,SAAZ,EAA8BC,KAA9B,EAA4C;AAC1C,UAAMC,oBAAoB,GAAG,CAAC,GAA9B;AACA,UAAMC,UAAU,GAAG,CAACF,KAAK,CAACG,CAAN,GAAUJ,SAAS,CAACI,CAArB,IAA0BF,oBAA7C;;AACA,UAAIC,UAAJ,EAAgB;AACd,aAAKE,MAAL,GAAc,IAAd;AACA,eAAO;AAAEF,UAAAA,UAAU,EAAVA;AAAF,SAAP;AACD;AACF;;;WAED,qBAAmBN,CAAnB,EAAkC;AAGhCA,MAAAA,CAAC,CAACS,cAAF;AACD;;;;EAlB4Cb,Y;;SAA1BG,iB","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport MouseHandler from './mouse_handler';\nimport { LEFT_BUTTON, RIGHT_BUTTON } from './util';\nexport default class MousePitchHandler extends MouseHandler {\n public correctButton(e: MouseEvent, button: number) {\n return (button === LEFT_BUTTON && e.ctrlKey) || button === RIGHT_BUTTON;\n }\n\n public move(lastPoint: Point, point: Point) {\n const degreesPerPixelMoved = -0.5;\n const pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;\n if (pitchDelta) {\n this.active = true;\n return { pitchDelta };\n }\n }\n\n public contextmenu(e: MouseEvent) {\n // prevent browser context menu when necessary; we don't allow it with rotation\n // because we can't discern rotation gesture start from contextmenu on Mac\n e.preventDefault();\n }\n}\n"],"file":"mousepitch_hander.js"}
@@ -1,9 +0,0 @@
1
- import 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,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
- import MouseHandler from './mouse_handler';
12
- import { LEFT_BUTTON, RIGHT_BUTTON } from './util';
13
-
14
- var MouseRotateHandler = function (_MouseHandler) {
15
- _inherits(MouseRotateHandler, _MouseHandler);
16
-
17
- var _super = _createSuper(MouseRotateHandler);
18
-
19
- function MouseRotateHandler() {
20
- _classCallCheck(this, MouseRotateHandler);
21
-
22
- return _super.apply(this, arguments);
23
- }
24
-
25
- _createClass(MouseRotateHandler, [{
26
- key: "contextmenu",
27
- value: function contextmenu(e) {
28
- e.preventDefault();
29
- }
30
- }, {
31
- key: "correctButton",
32
- value: function correctButton(e, button) {
33
- return button === LEFT_BUTTON && e.ctrlKey || button === RIGHT_BUTTON;
34
- }
35
- }, {
36
- key: "move",
37
- value: function move(lastPoint, point) {
38
- var degreesPerPixelMoved = 0.8;
39
- var bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;
40
-
41
- if (bearingDelta) {
42
- this.active = true;
43
- return {
44
- bearingDelta: bearingDelta
45
- };
46
- }
47
- }
48
- }]);
49
-
50
- return MouseRotateHandler;
51
- }(MouseHandler);
52
-
53
- export { MouseRotateHandler as default };
54
- //# sourceMappingURL=mouserotate_hander.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/mouse/mouserotate_hander.ts"],"names":["MouseHandler","LEFT_BUTTON","RIGHT_BUTTON","MouseRotateHandler","e","preventDefault","button","ctrlKey","lastPoint","point","degreesPerPixelMoved","bearingDelta","x","active"],"mappings":";;;;;;;;;;AAEA,OAAOA,YAAP,MAAyB,iBAAzB;AACA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,QAA1C;;IACqBC,kB;;;;;;;;;;;;;WACnB,qBAAmBC,CAAnB,EAAkC;AAGhCA,MAAAA,CAAC,CAACC,cAAF;AACD;;;WACD,uBAAwBD,CAAxB,EAAuCE,MAAvC,EAAuD;AACrD,aAAQA,MAAM,KAAKL,WAAX,IAA0BG,CAAC,CAACG,OAA7B,IAAyCD,MAAM,KAAKJ,YAA3D;AACD;;;WAED,cAAeM,SAAf,EAAiCC,KAAjC,EAA+C;AAC7C,UAAMC,oBAAoB,GAAG,GAA7B;AACA,UAAMC,YAAY,GAAG,CAACF,KAAK,CAACG,CAAN,GAAUJ,SAAS,CAACI,CAArB,IAA0BF,oBAA/C;;AACA,UAAIC,YAAJ,EAAkB;AAChB,aAAKE,MAAL,GAAc,IAAd;AACA,eAAO;AAAEF,UAAAA,YAAY,EAAZA;AAAF,SAAP;AACD;AACF;;;;EAjB6CX,Y;;SAA3BG,kB","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport MouseHandler from './mouse_handler';\nimport { LEFT_BUTTON, RIGHT_BUTTON } from './util';\nexport default class MouseRotateHandler extends MouseHandler {\n public contextmenu(e: MouseEvent) {\n // prevent browser context menu when necessary; we don't allow it with rotation\n // because we can't discern rotation gesture start from contextmenu on Mac\n e.preventDefault();\n }\n protected correctButton(e: MouseEvent, button: number) {\n return (button === LEFT_BUTTON && e.ctrlKey) || button === RIGHT_BUTTON;\n }\n\n protected move(lastPoint: Point, point: Point) {\n const degreesPerPixelMoved = 0.8;\n const bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;\n if (bearingDelta) {\n this.active = true;\n return { bearingDelta };\n }\n }\n}\n"],"file":"mouserotate_hander.js"}
@@ -1,6 +0,0 @@
1
- export declare const LEFT_BUTTON = 0;
2
- export declare const RIGHT_BUTTON = 2;
3
- export declare const BUTTONS_FLAGS: {
4
- [key: number]: number;
5
- };
6
- export declare function buttonStillPressed(e: MouseEvent, button: 1 | 2): boolean;
@@ -1,12 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
- var _BUTTONS_FLAGS;
4
-
5
- export var LEFT_BUTTON = 0;
6
- export var RIGHT_BUTTON = 2;
7
- export var BUTTONS_FLAGS = (_BUTTONS_FLAGS = {}, _defineProperty(_BUTTONS_FLAGS, LEFT_BUTTON, 1), _defineProperty(_BUTTONS_FLAGS, RIGHT_BUTTON, 2), _BUTTONS_FLAGS);
8
- export function buttonStillPressed(e, button) {
9
- var flag = BUTTONS_FLAGS[button];
10
- return e.buttons === undefined || (e.buttons & flag) !== flag;
11
- }
12
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/mouse/util.ts"],"names":["LEFT_BUTTON","RIGHT_BUTTON","BUTTONS_FLAGS","buttonStillPressed","e","button","flag","buttons","undefined"],"mappings":";;;;AAAA,OAAO,IAAMA,WAAW,GAAG,CAApB;AACP,OAAO,IAAMC,YAAY,GAAG,CAArB;AAGP,OAAO,IAAMC,aAAwC,yDAClDF,WADkD,EACpC,CADoC,mCAElDC,YAFkD,EAEnC,CAFmC,kBAA9C;AAKP,OAAO,SAASE,kBAAT,CAA4BC,CAA5B,EAA2CC,MAA3C,EAA0D;AAC/D,MAAMC,IAAI,GAAGJ,aAAa,CAACG,MAAD,CAA1B;AACA,SAAOD,CAAC,CAACG,OAAF,KAAcC,SAAd,IAA2B,CAACJ,CAAC,CAACG,OAAF,GAAYD,IAAb,MAAuBA,IAAzD;AACD","sourcesContent":["export const LEFT_BUTTON = 0;\nexport const RIGHT_BUTTON = 2;\n\n// the values for each button in MouseEvent.buttons\nexport const BUTTONS_FLAGS: { [key: number]: number } = {\n [LEFT_BUTTON]: 1,\n [RIGHT_BUTTON]: 2,\n};\n\nexport function buttonStillPressed(e: MouseEvent, button: 1 | 2) {\n const flag = BUTTONS_FLAGS[button];\n return e.buttons === undefined || (e.buttons & flag) !== flag;\n}\n"],"file":"util.js"}
@@ -1,93 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- import 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;
@@ -1,317 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import LngLat from '../geo/lng_lat';
5
- import { bezier, ease, interpolate, now } from '../util';
6
- import DOM from '../utils/dom';
7
- var wheelZoomDelta = 4.000244140625;
8
- var defaultZoomRate = 1 / 100;
9
- var wheelZoomRate = 1 / 450;
10
- var maxScalePerFrame = 2;
11
-
12
- var ScrollZoomHandler = function () {
13
- function ScrollZoomHandler(map, handler) {
14
- var _this = this;
15
-
16
- _classCallCheck(this, ScrollZoomHandler);
17
-
18
- _defineProperty(this, "map", void 0);
19
-
20
- _defineProperty(this, "el", void 0);
21
-
22
- _defineProperty(this, "enabled", void 0);
23
-
24
- _defineProperty(this, "active", void 0);
25
-
26
- _defineProperty(this, "zooming", void 0);
27
-
28
- _defineProperty(this, "aroundCenter", void 0);
29
-
30
- _defineProperty(this, "around", void 0);
31
-
32
- _defineProperty(this, "aroundPoint", void 0);
33
-
34
- _defineProperty(this, "type", void 0);
35
-
36
- _defineProperty(this, "lastValue", void 0);
37
-
38
- _defineProperty(this, "timeout", void 0);
39
-
40
- _defineProperty(this, "finishTimeout", void 0);
41
-
42
- _defineProperty(this, "lastWheelEvent", void 0);
43
-
44
- _defineProperty(this, "lastWheelEventTime", void 0);
45
-
46
- _defineProperty(this, "startZoom", void 0);
47
-
48
- _defineProperty(this, "targetZoom", void 0);
49
-
50
- _defineProperty(this, "delta", void 0);
51
-
52
- _defineProperty(this, "easing", void 0);
53
-
54
- _defineProperty(this, "prevEase", void 0);
55
-
56
- _defineProperty(this, "frameId", void 0);
57
-
58
- _defineProperty(this, "handler", void 0);
59
-
60
- _defineProperty(this, "defaultZoomRate", void 0);
61
-
62
- _defineProperty(this, "wheelZoomRate", void 0);
63
-
64
- _defineProperty(this, "onScrollFrame", function () {
65
- if (!_this.frameId) {
66
- return;
67
- }
68
-
69
- _this.frameId = null;
70
-
71
- if (!_this.isActive()) {
72
- return;
73
- }
74
-
75
- var tr = _this.map.transform;
76
-
77
- if (_this.delta !== 0) {
78
- var zoomRate = _this.type === 'wheel' && Math.abs(_this.delta) > wheelZoomDelta ? _this.wheelZoomRate : _this.defaultZoomRate;
79
- var scale = maxScalePerFrame / (1 + Math.exp(-Math.abs(_this.delta * zoomRate)));
80
-
81
- if (_this.delta < 0 && scale !== 0) {
82
- scale = 1 / scale;
83
- }
84
-
85
- var fromScale = typeof _this.targetZoom === 'number' ? tr.zoomScale(_this.targetZoom) : tr.scale;
86
- _this.targetZoom = Math.min(tr.maxZoom, Math.max(tr.minZoom, tr.scaleZoom(fromScale * scale)));
87
-
88
- if (_this.type === 'wheel') {
89
- _this.startZoom = tr.zoom;
90
- _this.easing = _this.smoothOutEasing(200);
91
- }
92
-
93
- _this.delta = 0;
94
- }
95
-
96
- var targetZoom = typeof _this.targetZoom === 'number' ? _this.targetZoom : tr.zoom;
97
- var startZoom = _this.startZoom;
98
- var easing = _this.easing;
99
- var finished = false;
100
- var zoom;
101
-
102
- if (_this.type === 'wheel' && startZoom && easing) {
103
- var t = Math.min((now() - _this.lastWheelEventTime) / 200, 1);
104
- var k = easing(t);
105
- zoom = interpolate(startZoom, targetZoom, k);
106
-
107
- if (t < 1) {
108
- if (!_this.frameId) {
109
- _this.frameId = true;
110
- }
111
- } else {
112
- finished = true;
113
- }
114
- } else {
115
- zoom = targetZoom;
116
- finished = true;
117
- }
118
-
119
- _this.active = true;
120
-
121
- if (finished) {
122
- _this.active = false;
123
- _this.finishTimeout = setTimeout(function () {
124
- _this.zooming = false;
125
-
126
- _this.handler.triggerRenderFrame();
127
-
128
- delete _this.targetZoom;
129
- delete _this.finishTimeout;
130
- }, 200);
131
- }
132
-
133
- return {
134
- noInertia: true,
135
- needsRenderFrame: !finished,
136
- zoomDelta: zoom - tr.zoom,
137
- around: _this.aroundPoint,
138
- originalEvent: _this.lastWheelEvent
139
- };
140
- });
141
-
142
- this.map = map;
143
- this.el = map.getCanvasContainer();
144
- this.handler = handler;
145
- this.delta = 0;
146
- this.defaultZoomRate = defaultZoomRate;
147
- this.wheelZoomRate = wheelZoomRate;
148
- }
149
-
150
- _createClass(ScrollZoomHandler, [{
151
- key: "setZoomRate",
152
- value: function setZoomRate(zoomRate) {
153
- this.defaultZoomRate = zoomRate;
154
- }
155
- }, {
156
- key: "setWheelZoomRate",
157
- value: function setWheelZoomRate(zoomRate) {
158
- this.wheelZoomRate = zoomRate;
159
- }
160
- }, {
161
- key: "isEnabled",
162
- value: function isEnabled() {
163
- return !!this.enabled;
164
- }
165
- }, {
166
- key: "isActive",
167
- value: function isActive() {
168
- return !!this.active || this.finishTimeout !== undefined;
169
- }
170
- }, {
171
- key: "isZooming",
172
- value: function isZooming() {
173
- return !!this.zooming;
174
- }
175
- }, {
176
- key: "enable",
177
- value: function enable(options) {
178
- if (this.isEnabled()) {
179
- return;
180
- }
181
-
182
- this.enabled = true;
183
- this.aroundCenter = options && options.around === 'center';
184
- }
185
- }, {
186
- key: "disable",
187
- value: function disable() {
188
- if (!this.isEnabled()) {
189
- return;
190
- }
191
-
192
- this.enabled = false;
193
- }
194
- }, {
195
- key: "wheel",
196
- value: function wheel(e) {
197
- if (!this.isEnabled()) {
198
- return;
199
- }
200
-
201
- var value = e.deltaMode === window.WheelEvent.DOM_DELTA_LINE ? e.deltaY * 40 : e.deltaY;
202
- var nowTime = now();
203
- var timeDelta = nowTime - (this.lastWheelEventTime || 0);
204
- this.lastWheelEventTime = nowTime;
205
-
206
- if (value !== 0 && value % wheelZoomDelta === 0) {
207
- this.type = 'wheel';
208
- } else if (value !== 0 && Math.abs(value) < 4) {
209
- this.type = 'trackpad';
210
- } else if (timeDelta > 400) {
211
- this.type = null;
212
- this.lastValue = value;
213
- this.timeout = setTimeout(this.onTimeout, 40, e);
214
- } else if (!this.type) {
215
- this.type = Math.abs(timeDelta * value) < 200 ? 'trackpad' : 'wheel';
216
-
217
- if (this.timeout) {
218
- clearTimeout(this.timeout);
219
- this.timeout = null;
220
- value += this.lastValue;
221
- }
222
- }
223
-
224
- if (e.shiftKey && value) {
225
- value = value / 4;
226
- }
227
-
228
- if (this.type) {
229
- this.lastWheelEvent = e;
230
- this.delta -= value;
231
-
232
- if (!this.active) {
233
- this.start(e);
234
- }
235
- }
236
-
237
- e.preventDefault();
238
- }
239
- }, {
240
- key: "renderFrame",
241
- value: function renderFrame() {
242
- return this.onScrollFrame();
243
- }
244
- }, {
245
- key: "reset",
246
- value: function reset() {
247
- this.active = false;
248
- }
249
- }, {
250
- key: "onTimeout",
251
- value: function onTimeout(initialEvent) {
252
- this.type = 'wheel';
253
- this.delta -= this.lastValue;
254
-
255
- if (!this.active && this.start) {
256
- this.start(initialEvent);
257
- }
258
- }
259
- }, {
260
- key: "start",
261
- value: function start(e) {
262
- if (!this.delta) {
263
- return;
264
- }
265
-
266
- if (this.frameId) {
267
- this.frameId = null;
268
- }
269
-
270
- this.active = true;
271
-
272
- if (!this.isZooming()) {
273
- this.zooming = true;
274
- }
275
-
276
- if (this.finishTimeout) {
277
- clearTimeout(this.finishTimeout);
278
- delete this.finishTimeout;
279
- }
280
-
281
- var pos = DOM.mousePos(this.el, e);
282
- this.around = LngLat.convert(this.aroundCenter ? this.map.getCenter() : this.map.unproject(pos));
283
- this.aroundPoint = this.map.transform.locationPoint(this.around);
284
-
285
- if (!this.frameId) {
286
- this.frameId = true;
287
- this.handler.triggerRenderFrame();
288
- }
289
- }
290
- }, {
291
- key: "smoothOutEasing",
292
- value: function smoothOutEasing(duration) {
293
- var easing = ease;
294
-
295
- if (this.prevEase) {
296
- var preEase = this.prevEase;
297
- var t = (now() - preEase.start) / preEase.duration;
298
- var speed = preEase.easing(t + 0.01) - preEase.easing(t);
299
- var x = 0.27 / Math.sqrt(speed * speed + 0.0001) * 0.01;
300
- var y = Math.sqrt(0.27 * 0.27 - x * x);
301
- easing = bezier(x, y, 0.25, 1);
302
- }
303
-
304
- this.prevEase = {
305
- start: now(),
306
- duration: duration,
307
- easing: easing
308
- };
309
- return easing;
310
- }
311
- }]);
312
-
313
- return ScrollZoomHandler;
314
- }();
315
-
316
- export default ScrollZoomHandler;
317
- //# sourceMappingURL=scroll_zoom.js.map