@antv/l7-map 2.5.36 → 2.5.37-mini

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 (186) 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/handler/handler_manager.js +55 -33
  5. package/lib/handler/handler_manager.js.map +1 -1
  6. package/lib/handler/shim/drag_pan.js +10 -2
  7. package/lib/handler/shim/drag_pan.js.map +1 -1
  8. package/lib/handler/shim/touch_zoom_rotate.js +10 -2
  9. package/lib/handler/shim/touch_zoom_rotate.js.map +1 -1
  10. package/lib/hash.js +9 -4
  11. package/lib/hash.js.map +1 -1
  12. package/lib/map.js +39 -19
  13. package/lib/map.js.map +1 -1
  14. package/lib/util.js +7 -5
  15. package/lib/util.js.map +1 -1
  16. package/lib/utils/dom.js +66 -26
  17. package/lib/utils/dom.js.map +1 -1
  18. package/lib/utils/performance.js +4 -1
  19. package/lib/utils/performance.js.map +1 -1
  20. package/package.json +3 -3
  21. package/LICENSE.md +0 -21
  22. package/es/camera.d.ts +0 -82
  23. package/es/camera.js +0 -729
  24. package/es/camera.js.map +0 -1
  25. package/es/earthmap.d.ts +0 -67
  26. package/es/earthmap.js +0 -454
  27. package/es/earthmap.js.map +0 -1
  28. package/es/geo/edge_insets.d.ts +0 -54
  29. package/es/geo/edge_insets.js +0 -88
  30. package/es/geo/edge_insets.js.map +0 -1
  31. package/es/geo/lng_lat.d.ts +0 -18
  32. package/es/geo/lng_lat.js +0 -77
  33. package/es/geo/lng_lat.js.map +0 -1
  34. package/es/geo/lng_lat_bounds.d.ts +0 -24
  35. package/es/geo/lng_lat_bounds.js +0 -170
  36. package/es/geo/lng_lat_bounds.js.map +0 -1
  37. package/es/geo/mercator.d.ts +0 -28
  38. package/es/geo/mercator.js +0 -79
  39. package/es/geo/mercator.js.map +0 -1
  40. package/es/geo/point.d.ts +0 -40
  41. package/es/geo/point.js +0 -237
  42. package/es/geo/point.js.map +0 -1
  43. package/es/geo/simple.d.ts +0 -28
  44. package/es/geo/simple.js +0 -78
  45. package/es/geo/simple.js.map +0 -1
  46. package/es/geo/transform.d.ts +0 -198
  47. package/es/geo/transform.js +0 -663
  48. package/es/geo/transform.js.map +0 -1
  49. package/es/handler/IHandler.d.ts +0 -34
  50. package/es/handler/IHandler.js +0 -2
  51. package/es/handler/IHandler.js.map +0 -1
  52. package/es/handler/blockable_map_event.d.ts +0 -17
  53. package/es/handler/blockable_map_event.js +0 -84
  54. package/es/handler/blockable_map_event.js.map +0 -1
  55. package/es/handler/box_zoom.d.ts +0 -59
  56. package/es/handler/box_zoom.js +0 -184
  57. package/es/handler/box_zoom.js.map +0 -1
  58. package/es/handler/click_zoom.d.ts +0 -16
  59. package/es/handler/click_zoom.js +0 -64
  60. package/es/handler/click_zoom.js.map +0 -1
  61. package/es/handler/events/event.d.ts +0 -4
  62. package/es/handler/events/event.js +0 -14
  63. package/es/handler/events/event.js.map +0 -1
  64. package/es/handler/events/index.d.ts +0 -4
  65. package/es/handler/events/index.js +0 -5
  66. package/es/handler/events/index.js.map +0 -1
  67. package/es/handler/events/map_mouse_event.d.ts +0 -34
  68. package/es/handler/events/map_mouse_event.js +0 -65
  69. package/es/handler/events/map_mouse_event.js.map +0 -1
  70. package/es/handler/events/map_touch_event.d.ts +0 -57
  71. package/es/handler/events/map_touch_event.js +0 -75
  72. package/es/handler/events/map_touch_event.js.map +0 -1
  73. package/es/handler/events/map_wheel_event.d.ts +0 -33
  74. package/es/handler/events/map_wheel_event.js +0 -52
  75. package/es/handler/events/map_wheel_event.js.map +0 -1
  76. package/es/handler/events/render_event.d.ts +0 -5
  77. package/es/handler/events/render_event.js +0 -41
  78. package/es/handler/events/render_event.js.map +0 -1
  79. package/es/handler/handler_inertia.d.ts +0 -23
  80. package/es/handler/handler_inertia.js +0 -186
  81. package/es/handler/handler_inertia.js.map +0 -1
  82. package/es/handler/handler_manager.d.ts +0 -57
  83. package/es/handler/handler_manager.js +0 -655
  84. package/es/handler/handler_manager.js.map +0 -1
  85. package/es/handler/handler_util.d.ts +0 -4
  86. package/es/handler/handler_util.js +0 -10
  87. package/es/handler/handler_util.js.map +0 -1
  88. package/es/handler/keyboard.d.ts +0 -36
  89. package/es/handler/keyboard.js +0 -157
  90. package/es/handler/keyboard.js.map +0 -1
  91. package/es/handler/map_event.d.ts +0 -29
  92. package/es/handler/map_event.js +0 -120
  93. package/es/handler/map_event.js.map +0 -1
  94. package/es/handler/mouse/index.d.ts +0 -4
  95. package/es/handler/mouse/index.js +0 -5
  96. package/es/handler/mouse/index.js.map +0 -1
  97. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  98. package/es/handler/mouse/mouse_handler.js +0 -131
  99. package/es/handler/mouse/mouse_handler.js.map +0 -1
  100. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  101. package/es/handler/mouse/mousepan_handler.js +0 -54
  102. package/es/handler/mouse/mousepan_handler.js.map +0 -1
  103. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  104. package/es/handler/mouse/mousepitch_hander.js +0 -54
  105. package/es/handler/mouse/mousepitch_hander.js.map +0 -1
  106. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  107. package/es/handler/mouse/mouserotate_hander.js +0 -54
  108. package/es/handler/mouse/mouserotate_hander.js.map +0 -1
  109. package/es/handler/mouse/util.d.ts +0 -6
  110. package/es/handler/mouse/util.js +0 -12
  111. package/es/handler/mouse/util.js.map +0 -1
  112. package/es/handler/scroll_zoom.d.ts +0 -93
  113. package/es/handler/scroll_zoom.js +0 -317
  114. package/es/handler/scroll_zoom.js.map +0 -1
  115. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  116. package/es/handler/shim/dblclick_zoom.js +0 -45
  117. package/es/handler/shim/dblclick_zoom.js.map +0 -1
  118. package/es/handler/shim/drag_pan.d.ts +0 -61
  119. package/es/handler/shim/drag_pan.js +0 -53
  120. package/es/handler/shim/drag_pan.js.map +0 -1
  121. package/es/handler/shim/drag_rotate.d.ts +0 -46
  122. package/es/handler/shim/drag_rotate.js +0 -51
  123. package/es/handler/shim/drag_rotate.js.map +0 -1
  124. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  125. package/es/handler/shim/touch_zoom_rotate.js +0 -80
  126. package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
  127. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  128. package/es/handler/tap/single_tap_recognizer.js +0 -127
  129. package/es/handler/tap/single_tap_recognizer.js.map +0 -1
  130. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  131. package/es/handler/tap/tap_drag_zoom.js +0 -124
  132. package/es/handler/tap/tap_drag_zoom.js.map +0 -1
  133. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  134. package/es/handler/tap/tap_recognizer.js +0 -72
  135. package/es/handler/tap/tap_recognizer.js.map +0 -1
  136. package/es/handler/tap/tap_zoom.d.ts +0 -22
  137. package/es/handler/tap/tap_zoom.js +0 -124
  138. package/es/handler/tap/tap_zoom.js.map +0 -1
  139. package/es/handler/touch/index.d.ts +0 -5
  140. package/es/handler/touch/index.js +0 -6
  141. package/es/handler/touch/index.js.map +0 -1
  142. package/es/handler/touch/touch_pan.d.ts +0 -30
  143. package/es/handler/touch/touch_pan.js +0 -139
  144. package/es/handler/touch/touch_pan.js.map +0 -1
  145. package/es/handler/touch/touch_pitch.d.ts +0 -13
  146. package/es/handler/touch/touch_pitch.js +0 -120
  147. package/es/handler/touch/touch_pitch.js.map +0 -1
  148. package/es/handler/touch/touch_rotate.d.ts +0 -12
  149. package/es/handler/touch/touch_rotate.js +0 -88
  150. package/es/handler/touch/touch_rotate.js.map +0 -1
  151. package/es/handler/touch/touch_zoom.d.ts +0 -12
  152. package/es/handler/touch/touch_zoom.js +0 -79
  153. package/es/handler/touch/touch_zoom.js.map +0 -1
  154. package/es/handler/touch/two_touch.d.ts +0 -23
  155. package/es/handler/touch/two_touch.js +0 -140
  156. package/es/handler/touch/two_touch.js.map +0 -1
  157. package/es/hash.d.ts +0 -15
  158. package/es/hash.js +0 -143
  159. package/es/hash.js.map +0 -1
  160. package/es/index.d.ts +0 -2
  161. package/es/index.js +0 -3
  162. package/es/index.js.map +0 -1
  163. package/es/interface.d.ts +0 -31
  164. package/es/interface.js +0 -2
  165. package/es/interface.js.map +0 -1
  166. package/es/map.d.ts +0 -67
  167. package/es/map.js +0 -454
  168. package/es/map.js.map +0 -1
  169. package/es/util.d.ts +0 -18
  170. package/es/util.js +0 -74
  171. package/es/util.js.map +0 -1
  172. package/es/utils/Aabb.d.ts +0 -12
  173. package/es/utils/Aabb.js +0 -134
  174. package/es/utils/Aabb.js.map +0 -1
  175. package/es/utils/dom.d.ts +0 -4
  176. package/es/utils/dom.js +0 -165
  177. package/es/utils/dom.js.map +0 -1
  178. package/es/utils/performance.d.ts +0 -17
  179. package/es/utils/performance.js +0 -57
  180. package/es/utils/performance.js.map +0 -1
  181. package/es/utils/primitives.d.ts +0 -6
  182. package/es/utils/primitives.js +0 -44
  183. package/es/utils/primitives.js.map +0 -1
  184. package/es/utils/task_queue.d.ts +0 -13
  185. package/es/utils/task_queue.js +0 -113
  186. package/es/utils/task_queue.js.map +0 -1
@@ -1,127 +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
-
5
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
-
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
-
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
-
11
- import Point from '../../geo/point';
12
- import { indexTouches } from '../handler_util';
13
-
14
- function getCentroid(points) {
15
- var sum = new Point(0, 0);
16
-
17
- var _iterator = _createForOfIteratorHelper(points),
18
- _step;
19
-
20
- try {
21
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
22
- var point = _step.value;
23
-
24
- sum._add(point);
25
- }
26
- } catch (err) {
27
- _iterator.e(err);
28
- } finally {
29
- _iterator.f();
30
- }
31
-
32
- return sum.div(points.length);
33
- }
34
-
35
- export var MAX_TAP_INTERVAL = 500;
36
- export var MAX_TOUCH_TIME = 500;
37
- export var MAX_DIST = 30;
38
-
39
- var SingleTapRecognizer = function () {
40
- function SingleTapRecognizer(options) {
41
- _classCallCheck(this, SingleTapRecognizer);
42
-
43
- _defineProperty(this, "numTouches", void 0);
44
-
45
- _defineProperty(this, "centroid", void 0);
46
-
47
- _defineProperty(this, "startTime", void 0);
48
-
49
- _defineProperty(this, "aborted", void 0);
50
-
51
- _defineProperty(this, "touches", void 0);
52
-
53
- this.reset();
54
- this.numTouches = options.numTouches;
55
- }
56
-
57
- _createClass(SingleTapRecognizer, [{
58
- key: "reset",
59
- value: function reset() {
60
- delete this.centroid;
61
- delete this.startTime;
62
- delete this.touches;
63
- this.aborted = false;
64
- }
65
- }, {
66
- key: "touchstart",
67
- value: function touchstart(e, points, mapTouches) {
68
- if (this.centroid || mapTouches.length > this.numTouches) {
69
- this.aborted = true;
70
- }
71
-
72
- if (this.aborted) {
73
- return;
74
- }
75
-
76
- if (this.startTime === undefined) {
77
- this.startTime = e.timeStamp;
78
- }
79
-
80
- if (mapTouches.length === this.numTouches) {
81
- this.centroid = getCentroid(points);
82
- this.touches = indexTouches(mapTouches, points);
83
- }
84
- }
85
- }, {
86
- key: "touchmove",
87
- value: function touchmove(e, points, mapTouches) {
88
- if (this.aborted || !this.centroid) {
89
- return;
90
- }
91
-
92
- var newTouches = indexTouches(mapTouches, points);
93
-
94
- for (var id in this.touches) {
95
- if (this.touches[id]) {
96
- var prevPos = this.touches[id];
97
- var pos = newTouches[id];
98
-
99
- if (!pos || pos.dist(prevPos) > MAX_DIST) {
100
- this.aborted = true;
101
- }
102
- }
103
- }
104
- }
105
- }, {
106
- key: "touchend",
107
- value: function touchend(e, points, mapTouches) {
108
- if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {
109
- this.aborted = true;
110
- }
111
-
112
- if (mapTouches.length === 0) {
113
- var centroid = !this.aborted && this.centroid;
114
- this.reset();
115
-
116
- if (centroid) {
117
- return centroid;
118
- }
119
- }
120
- }
121
- }]);
122
-
123
- return SingleTapRecognizer;
124
- }();
125
-
126
- export { SingleTapRecognizer as default };
127
- //# sourceMappingURL=single_tap_recognizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/tap/single_tap_recognizer.ts"],"names":["Point","indexTouches","getCentroid","points","sum","point","_add","div","length","MAX_TAP_INTERVAL","MAX_TOUCH_TIME","MAX_DIST","SingleTapRecognizer","options","reset","numTouches","centroid","startTime","touches","aborted","e","mapTouches","undefined","timeStamp","newTouches","id","prevPos","pos","dist"],"mappings":";;;;;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W,CAACC,MAAD,CAA3B;AACA,aAAKe,OAAL,GAAejB,YAAY,CAACoB,UAAD,EAAalB,MAAb,CAA3B;AACD;AACF;;;WAED,mBAAiBiB,CAAjB,EAAgCjB,MAAhC,EAAiDkB,UAAjD,EAAsE;AACpE,UAAI,KAAKF,OAAL,IAAgB,CAAC,KAAKH,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMQ,UAAU,GAAGvB,YAAY,CAACoB,UAAD,EAAalB,MAAb,CAA/B;;AACA,WAAK,IAAMsB,EAAX,IAAiB,KAAKP,OAAtB,EAA+B;AAC7B,YAAI,KAAKA,OAAL,CAAaO,EAAb,CAAJ,EAAsB;AACpB,cAAMC,OAAO,GAAG,KAAKR,OAAL,CAAaO,EAAb,CAAhB;AACA,cAAME,GAAG,GAAGH,UAAU,CAACC,EAAD,CAAtB;;AACA,cAAI,CAACE,GAAD,IAAQA,GAAG,CAACC,IAAJ,CAASF,OAAT,IAAoBf,QAAhC,EAA0C;AACxC,iBAAKQ,OAAL,GAAe,IAAf;AACD;AACF;AACF;AACF;;;WAED,kBAAgBC,CAAhB,EAA+BjB,MAA/B,EAAgDkB,UAAhD,EAAqE;AACnE,UAAI,CAAC,KAAKL,QAAN,IAAkBI,CAAC,CAACG,SAAF,GAAc,KAAKN,SAAnB,GAA+BP,cAArD,EAAqE;AACnE,aAAKS,OAAL,GAAe,IAAf;AACD;;AAED,UAAIE,UAAU,CAACb,MAAX,KAAsB,CAA1B,EAA6B;AAC3B,YAAMQ,QAAQ,GAAG,CAAC,KAAKG,OAAN,IAAiB,KAAKH,QAAvC;AACA,aAAKF,KAAL;;AACA,YAAIE,QAAJ,EAAc;AACZ,iBAAOA,QAAP;AACD;AACF;AACF;;;;;;SAlEkBJ,mB","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport { indexTouches } from '../handler_util';\n\nfunction getCentroid(points: Point[]) {\n const sum = new Point(0, 0);\n for (const point of points) {\n sum._add(point);\n }\n // @ts-ignore\n return sum.div(points.length);\n}\n\nexport const MAX_TAP_INTERVAL = 500;\nexport const MAX_TOUCH_TIME = 500;\nexport const MAX_DIST = 30;\n\nexport default class SingleTapRecognizer {\n public numTouches: number;\n public centroid: Point;\n public startTime: number;\n public aborted: boolean;\n public touches: { [key: string]: Point };\n\n constructor(options: { numTouches: number }) {\n this.reset();\n this.numTouches = options.numTouches;\n }\n\n public reset() {\n delete this.centroid;\n delete this.startTime;\n delete this.touches;\n this.aborted = false;\n }\n\n public touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (this.centroid || mapTouches.length > this.numTouches) {\n this.aborted = true;\n }\n if (this.aborted) {\n return;\n }\n\n if (this.startTime === undefined) {\n this.startTime = e.timeStamp;\n }\n\n if (mapTouches.length === this.numTouches) {\n this.centroid = getCentroid(points);\n this.touches = indexTouches(mapTouches, points);\n }\n }\n\n public touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (this.aborted || !this.centroid) {\n return;\n }\n\n const newTouches = indexTouches(mapTouches, points);\n for (const id in this.touches) {\n if (this.touches[id]) {\n const prevPos = this.touches[id];\n const pos = newTouches[id];\n if (!pos || pos.dist(prevPos) > MAX_DIST) {\n this.aborted = true;\n }\n }\n }\n }\n\n public touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {\n this.aborted = true;\n }\n\n if (mapTouches.length === 0) {\n const centroid = !this.aborted && this.centroid;\n this.reset();\n if (centroid) {\n return centroid;\n }\n }\n }\n}\n"],"file":"single_tap_recognizer.js"}
@@ -1,22 +0,0 @@
1
- import Point from '../../geo/point';
2
- import TapRecognizer from './tap_recognizer';
3
- export default class TapDragZoomHandler {
4
- enabled: boolean;
5
- active: boolean;
6
- swipePoint: Point;
7
- swipeTouch: number;
8
- tapTime: number;
9
- tap: TapRecognizer;
10
- constructor();
11
- reset(): void;
12
- touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
13
- touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]): {
14
- zoomDelta: number;
15
- } | undefined;
16
- touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
17
- touchcancel(): void;
18
- enable(): void;
19
- disable(): void;
20
- isEnabled(): boolean;
21
- isActive(): boolean;
22
- }
@@ -1,124 +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 { MAX_TAP_INTERVAL } from './single_tap_recognizer';
5
- import TapRecognizer from './tap_recognizer';
6
-
7
- var TapDragZoomHandler = function () {
8
- function TapDragZoomHandler() {
9
- _classCallCheck(this, TapDragZoomHandler);
10
-
11
- _defineProperty(this, "enabled", void 0);
12
-
13
- _defineProperty(this, "active", void 0);
14
-
15
- _defineProperty(this, "swipePoint", void 0);
16
-
17
- _defineProperty(this, "swipeTouch", void 0);
18
-
19
- _defineProperty(this, "tapTime", void 0);
20
-
21
- _defineProperty(this, "tap", void 0);
22
-
23
- this.tap = new TapRecognizer({
24
- numTouches: 1,
25
- numTaps: 1
26
- });
27
- this.reset();
28
- }
29
-
30
- _createClass(TapDragZoomHandler, [{
31
- key: "reset",
32
- value: function reset() {
33
- this.active = false;
34
- delete this.swipePoint;
35
- delete this.swipeTouch;
36
- delete this.tapTime;
37
- this.tap.reset();
38
- }
39
- }, {
40
- key: "touchstart",
41
- value: function touchstart(e, points, mapTouches) {
42
- if (this.swipePoint) {
43
- return;
44
- }
45
-
46
- if (this.tapTime && e.timeStamp - this.tapTime > MAX_TAP_INTERVAL) {
47
- this.reset();
48
- }
49
-
50
- if (!this.tapTime) {
51
- this.tap.touchstart(e, points, mapTouches);
52
- } else if (mapTouches.length > 0) {
53
- this.swipePoint = points[0];
54
- this.swipeTouch = mapTouches[0].identifier;
55
- }
56
- }
57
- }, {
58
- key: "touchmove",
59
- value: function touchmove(e, points, mapTouches) {
60
- if (!this.tapTime) {
61
- this.tap.touchmove(e, points, mapTouches);
62
- } else if (this.swipePoint) {
63
- if (mapTouches[0].identifier !== this.swipeTouch) {
64
- return;
65
- }
66
-
67
- var newSwipePoint = points[0];
68
- var dist = newSwipePoint.y - this.swipePoint.y;
69
- this.swipePoint = newSwipePoint;
70
- e.preventDefault();
71
- this.active = true;
72
- return {
73
- zoomDelta: dist / 128
74
- };
75
- }
76
- }
77
- }, {
78
- key: "touchend",
79
- value: function touchend(e, points, mapTouches) {
80
- if (!this.tapTime) {
81
- var point = this.tap.touchend(e, points, mapTouches);
82
-
83
- if (point) {
84
- this.tapTime = e.timeStamp;
85
- }
86
- } else if (this.swipePoint) {
87
- if (mapTouches.length === 0) {
88
- this.reset();
89
- }
90
- }
91
- }
92
- }, {
93
- key: "touchcancel",
94
- value: function touchcancel() {
95
- this.reset();
96
- }
97
- }, {
98
- key: "enable",
99
- value: function enable() {
100
- this.enabled = true;
101
- }
102
- }, {
103
- key: "disable",
104
- value: function disable() {
105
- this.enabled = false;
106
- this.reset();
107
- }
108
- }, {
109
- key: "isEnabled",
110
- value: function isEnabled() {
111
- return this.enabled;
112
- }
113
- }, {
114
- key: "isActive",
115
- value: function isActive() {
116
- return this.active;
117
- }
118
- }]);
119
-
120
- return TapDragZoomHandler;
121
- }();
122
-
123
- export { TapDragZoomHandler as default };
124
- //# sourceMappingURL=tap_drag_zoom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/tap/tap_drag_zoom.ts"],"names":["MAX_TAP_INTERVAL","TapRecognizer","TapDragZoomHandler","tap","numTouches","numTaps","reset","active","swipePoint","swipeTouch","tapTime","e","points","mapTouches","timeStamp","touchstart","length","identifier","touchmove","newSwipePoint","dist","y","preventDefault","zoomDelta","point","touchend","enabled"],"mappings":";;;AAEA,SAASA,gBAAT,QAAiC,yBAAjC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;;IAEqBC,kB;AAQnB,gCAAc;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;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AMQ,IAAI,GAAGD,aAAa,CAACE,CAAd,GAAkB,KAAKb,UAAL,CAAgBa,CAA/C;AACA,aAAKb,UAAL,GAAkBW,aAAlB;AAEAR,QAAAA,CAAC,CAACW,cAAF;AACA,aAAKf,MAAL,GAAc,IAAd;AAEA,eAAO;AACLgB,UAAAA,SAAS,EAAEH,IAAI,GAAG;AADb,SAAP;AAGD;AACF;;;WAED,kBAAgBT,CAAhB,EAA+BC,MAA/B,EAAgDC,UAAhD,EAAqE;AACnE,UAAI,CAAC,KAAKH,OAAV,EAAmB;AACjB,YAAMc,KAAK,GAAG,KAAKrB,GAAL,CAASsB,QAAT,CAAkBd,CAAlB,EAAqBC,MAArB,EAA6BC,UAA7B,CAAd;;AACA,YAAIW,KAAJ,EAAW;AACT,eAAKd,OAAL,GAAeC,CAAC,CAACG,SAAjB;AACD;AACF,OALD,MAKO,IAAI,KAAKN,UAAT,EAAqB;AAC1B,YAAIK,UAAU,CAACG,MAAX,KAAsB,CAA1B,EAA6B;AAC3B,eAAKV,KAAL;AACD;AACF;AACF;;;WAED,uBAAqB;AACnB,WAAKA,KAAL;AACD;;;WAED,kBAAgB;AACd,WAAKoB,OAAL,GAAe,IAAf;AACD;;;WAED,mBAAiB;AACf,WAAKA,OAAL,GAAe,KAAf;AACA,WAAKpB,KAAL;AACD;;;WAED,qBAAmB;AACjB,aAAO,KAAKoB,OAAZ;AACD;;;WAED,oBAAkB;AAChB,aAAO,KAAKnB,MAAZ;AACD;;;;;;SA/FkBL,kB","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport { MAX_TAP_INTERVAL } from './single_tap_recognizer';\nimport TapRecognizer from './tap_recognizer';\n\nexport default class TapDragZoomHandler {\n public enabled: boolean;\n public active: boolean;\n public swipePoint: Point;\n public swipeTouch: number;\n public tapTime: number;\n public tap: TapRecognizer;\n\n constructor() {\n this.tap = new TapRecognizer({\n numTouches: 1,\n numTaps: 1,\n });\n\n this.reset();\n }\n\n public reset() {\n this.active = false;\n delete this.swipePoint;\n delete this.swipeTouch;\n delete this.tapTime;\n this.tap.reset();\n }\n\n public touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (this.swipePoint) {\n return;\n }\n\n if (this.tapTime && e.timeStamp - this.tapTime > MAX_TAP_INTERVAL) {\n this.reset();\n }\n\n if (!this.tapTime) {\n this.tap.touchstart(e, points, mapTouches);\n } else if (mapTouches.length > 0) {\n this.swipePoint = points[0];\n this.swipeTouch = mapTouches[0].identifier;\n }\n }\n\n public touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (!this.tapTime) {\n this.tap.touchmove(e, points, mapTouches);\n } else if (this.swipePoint) {\n if (mapTouches[0].identifier !== this.swipeTouch) {\n return;\n }\n\n const newSwipePoint = points[0];\n const dist = newSwipePoint.y - this.swipePoint.y;\n this.swipePoint = newSwipePoint;\n\n e.preventDefault();\n this.active = true;\n\n return {\n zoomDelta: dist / 128,\n };\n }\n }\n\n public touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n if (!this.tapTime) {\n const point = this.tap.touchend(e, points, mapTouches);\n if (point) {\n this.tapTime = e.timeStamp;\n }\n } else if (this.swipePoint) {\n if (mapTouches.length === 0) {\n this.reset();\n }\n }\n }\n\n public touchcancel() {\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"],"file":"tap_drag_zoom.js"}
@@ -1,17 +0,0 @@
1
- import Point from '../../geo/point';
2
- import SingleTapRecognizer from './single_tap_recognizer';
3
- export default class TapRecognizer {
4
- singleTap: SingleTapRecognizer;
5
- numTaps: number;
6
- lastTime: number;
7
- lastTap: Point;
8
- count: number;
9
- constructor(options: {
10
- numTaps: number;
11
- numTouches: number;
12
- });
13
- reset(): void;
14
- touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
15
- touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
16
- touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]): Point | undefined;
17
- }
@@ -1,72 +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 SingleTapRecognizer, { MAX_DIST, MAX_TAP_INTERVAL } from './single_tap_recognizer';
5
-
6
- var TapRecognizer = function () {
7
- function TapRecognizer(options) {
8
- _classCallCheck(this, TapRecognizer);
9
-
10
- _defineProperty(this, "singleTap", void 0);
11
-
12
- _defineProperty(this, "numTaps", void 0);
13
-
14
- _defineProperty(this, "lastTime", void 0);
15
-
16
- _defineProperty(this, "lastTap", void 0);
17
-
18
- _defineProperty(this, "count", void 0);
19
-
20
- this.singleTap = new SingleTapRecognizer(options);
21
- this.numTaps = options.numTaps;
22
- this.reset();
23
- }
24
-
25
- _createClass(TapRecognizer, [{
26
- key: "reset",
27
- value: function reset() {
28
- this.lastTime = Infinity;
29
- delete this.lastTap;
30
- this.count = 0;
31
- this.singleTap.reset();
32
- }
33
- }, {
34
- key: "touchstart",
35
- value: function touchstart(e, points, mapTouches) {
36
- this.singleTap.touchstart(e, points, mapTouches);
37
- }
38
- }, {
39
- key: "touchmove",
40
- value: function touchmove(e, points, mapTouches) {
41
- this.singleTap.touchmove(e, points, mapTouches);
42
- }
43
- }, {
44
- key: "touchend",
45
- value: function touchend(e, points, mapTouches) {
46
- var tap = this.singleTap.touchend(e, points, mapTouches);
47
-
48
- if (tap) {
49
- var soonEnough = e.timeStamp - this.lastTime < MAX_TAP_INTERVAL;
50
- var closeEnough = !this.lastTap || this.lastTap.dist(tap) < MAX_DIST;
51
-
52
- if (!soonEnough || !closeEnough) {
53
- this.reset();
54
- }
55
-
56
- this.count++;
57
- this.lastTime = e.timeStamp;
58
- this.lastTap = tap;
59
-
60
- if (this.count === this.numTaps) {
61
- this.reset();
62
- return tap;
63
- }
64
- }
65
- }
66
- }]);
67
-
68
- return TapRecognizer;
69
- }();
70
-
71
- export { TapRecognizer as default };
72
- //# sourceMappingURL=tap_recognizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/tap/tap_recognizer.ts"],"names":["SingleTapRecognizer","MAX_DIST","MAX_TAP_INTERVAL","TapRecognizer","options","singleTap","numTaps","reset","lastTime","Infinity","lastTap","count","e","points","mapTouches","touchstart","touchmove","tap","touchend","soonEnough","timeStamp","closeEnough","dist"],"mappings":";;;AAEA,OAAOA,mBAAP,IACEC,QADF,EAEEC,gBAFF,QAGO,yBAHP;;IAKqBC,a;AAOnB,yBAAYC,OAAZ,EAA8D;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAC5D,SAAKC,SAAL,GAAiB,IAAIL,mBAAJ,CAAwBI,OAAxB,CAAjB;AACA,SAAKE,OAAL,GAAeF,OAAO,CAACE,OAAvB;AACA,SAAKC,KAAL;AACD;;;;WAED,iBAAe;AACb,WAAKC,QAAL,GAAgBC,QAAhB;AACA,aAAO,KAAKC,OAAZ;AACA,WAAKC,KAAL,GAAa,CAAb;AACA,WAAKN,SAAL,CAAeE,KAAf;AACD;;;WAED,oBAAkBK,CAAlB,EAAiCC,MAAjC,EAAkDC,UAAlD,EAAuE;AACrE,WAAKT,SAAL,CAAeU,UAAf,CAA0BH,CAA1B,EAA6BC,MAA7B,EAAqCC,UAArC;AACD;;;WAED,mBAAiBF,CAAjB,EAAgCC,MAAhC,EAAiDC,UAAjD,EAAsE;AACpE,WAAKT,SAAL,CAAeW,SAAf,CAAyBJ,CAAzB,EAA4BC,MAA5B,EAAoCC,UAApC;AACD;;;WAED,kBAAgBF,CAAhB,EAA+BC,MAA/B,EAAgDC,UAAhD,EAAqE;AACnE,UAAMG,GAAG,GAAG,KAAKZ,SAAL,CAAea,QAAf,CAAwBN,CAAxB,EAA2BC,MAA3B,EAAmCC,UAAnC,CAAZ;;AACA,UAAIG,GAAJ,EAAS;AACP,YAAME,UAAU,GAAGP,CAAC,CAACQ,SAAF,GAAc,KAAKZ,QAAnB,GAA8BN,gBAAjD;AACA,YAAMmB,WAAW,GAAG,CAAC,KAAKX,OAAN,IAAiB,KAAKA,OAAL,CAAaY,IAAb,CAAkBL,GAAlB,IAAyBhB,QAA9D;;AAEA,YAAI,CAACkB,UAAD,IAAe,CAACE,WAApB,EAAiC;AAC/B,eAAKd,KAAL;AACD;;AAED,aAAKI,KAAL;AACA,aAAKH,QAAL,GAAgBI,CAAC,CAACQ,SAAlB;AACA,aAAKV,OAAL,GAAeO,GAAf;;AAEA,YAAI,KAAKN,KAAL,KAAe,KAAKL,OAAxB,EAAiC;AAC/B,eAAKC,KAAL;AACA,iBAAOU,GAAP;AACD;AACF;AACF;;;;;;SA/CkBd,a","sourcesContent":["// @ts-ignore\nimport Point from '../../geo/point';\nimport SingleTapRecognizer, {\n MAX_DIST,\n MAX_TAP_INTERVAL,\n} from './single_tap_recognizer';\n\nexport default class TapRecognizer {\n public singleTap: SingleTapRecognizer;\n public numTaps: number;\n public lastTime: number;\n public lastTap: Point;\n public count: number;\n\n constructor(options: { numTaps: number; numTouches: number }) {\n this.singleTap = new SingleTapRecognizer(options);\n this.numTaps = options.numTaps;\n this.reset();\n }\n\n public reset() {\n this.lastTime = Infinity;\n delete this.lastTap;\n this.count = 0;\n this.singleTap.reset();\n }\n\n public touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n this.singleTap.touchstart(e, points, mapTouches);\n }\n\n public touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n this.singleTap.touchmove(e, points, mapTouches);\n }\n\n public touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n const tap = this.singleTap.touchend(e, points, mapTouches);\n if (tap) {\n const soonEnough = e.timeStamp - this.lastTime < MAX_TAP_INTERVAL;\n const closeEnough = !this.lastTap || this.lastTap.dist(tap) < MAX_DIST;\n\n if (!soonEnough || !closeEnough) {\n this.reset();\n }\n\n this.count++;\n this.lastTime = e.timeStamp;\n this.lastTap = tap;\n\n if (this.count === this.numTaps) {\n this.reset();\n return tap;\n }\n }\n }\n}\n"],"file":"tap_recognizer.js"}
@@ -1,22 +0,0 @@
1
- import { EarthMap } from '../../earthmap';
2
- import Point from '../../geo/point';
3
- import { Map } from '../../map';
4
- import TapRecognizer from './tap_recognizer';
5
- export default class TapZoomHandler {
6
- enabled: boolean;
7
- active: boolean;
8
- zoomIn: TapRecognizer;
9
- zoomOut: TapRecognizer;
10
- constructor();
11
- reset(): void;
12
- touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
13
- touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
14
- touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]): {
15
- cameraAnimation: (map: Map | EarthMap) => Map | EarthMap;
16
- } | undefined;
17
- touchcancel(): void;
18
- enable(): void;
19
- disable(): void;
20
- isEnabled(): boolean;
21
- isActive(): boolean;
22
- }
@@ -1,124 +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 TapRecognizer from './tap_recognizer';
5
-
6
- var TapZoomHandler = function () {
7
- function TapZoomHandler() {
8
- _classCallCheck(this, TapZoomHandler);
9
-
10
- _defineProperty(this, "enabled", void 0);
11
-
12
- _defineProperty(this, "active", void 0);
13
-
14
- _defineProperty(this, "zoomIn", void 0);
15
-
16
- _defineProperty(this, "zoomOut", void 0);
17
-
18
- this.zoomIn = new TapRecognizer({
19
- numTouches: 1,
20
- numTaps: 2
21
- });
22
- this.zoomOut = new TapRecognizer({
23
- numTouches: 2,
24
- numTaps: 1
25
- });
26
- this.reset();
27
- }
28
-
29
- _createClass(TapZoomHandler, [{
30
- key: "reset",
31
- value: function reset() {
32
- this.active = false;
33
- this.zoomIn.reset();
34
- this.zoomOut.reset();
35
- }
36
- }, {
37
- key: "touchstart",
38
- value: function touchstart(e, points, mapTouches) {
39
- this.zoomIn.touchstart(e, points, mapTouches);
40
- this.zoomOut.touchstart(e, points, mapTouches);
41
- }
42
- }, {
43
- key: "touchmove",
44
- value: function touchmove(e, points, mapTouches) {
45
- this.zoomIn.touchmove(e, points, mapTouches);
46
- this.zoomOut.touchmove(e, points, mapTouches);
47
- }
48
- }, {
49
- key: "touchend",
50
- value: function touchend(e, points, mapTouches) {
51
- var _this = this;
52
-
53
- var zoomInPoint = this.zoomIn.touchend(e, points, mapTouches);
54
- var zoomOutPoint = this.zoomOut.touchend(e, points, mapTouches);
55
-
56
- if (zoomInPoint) {
57
- this.active = true;
58
- e.preventDefault();
59
- setTimeout(function () {
60
- return _this.reset();
61
- }, 0);
62
- return {
63
- cameraAnimation: function cameraAnimation(map) {
64
- return map.easeTo({
65
- duration: 300,
66
- zoom: map.getZoom() + 1,
67
- around: map.unproject(zoomInPoint)
68
- }, {
69
- originalEvent: e
70
- });
71
- }
72
- };
73
- } else if (zoomOutPoint) {
74
- this.active = true;
75
- e.preventDefault();
76
- setTimeout(function () {
77
- return _this.reset();
78
- }, 0);
79
- return {
80
- cameraAnimation: function cameraAnimation(map) {
81
- return map.easeTo({
82
- duration: 300,
83
- zoom: map.getZoom() - 1,
84
- around: map.unproject(zoomOutPoint)
85
- }, {
86
- originalEvent: e
87
- });
88
- }
89
- };
90
- }
91
- }
92
- }, {
93
- key: "touchcancel",
94
- value: function touchcancel() {
95
- this.reset();
96
- }
97
- }, {
98
- key: "enable",
99
- value: function enable() {
100
- this.enabled = true;
101
- }
102
- }, {
103
- key: "disable",
104
- value: function disable() {
105
- this.enabled = false;
106
- this.reset();
107
- }
108
- }, {
109
- key: "isEnabled",
110
- value: function isEnabled() {
111
- return this.enabled;
112
- }
113
- }, {
114
- key: "isActive",
115
- value: function isActive() {
116
- return this.active;
117
- }
118
- }]);
119
-
120
- return TapZoomHandler;
121
- }();
122
-
123
- export { TapZoomHandler as default };
124
- //# sourceMappingURL=tap_zoom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/tap/tap_zoom.ts"],"names":["TapRecognizer","TapZoomHandler","zoomIn","numTouches","numTaps","zoomOut","reset","active","e","points","mapTouches","touchstart","touchmove","zoomInPoint","touchend","zoomOutPoint","preventDefault","setTimeout","cameraAnimation","map","easeTo","duration","zoom","getZoom","around","unproject","originalEvent","enabled"],"mappings":";;;AAIA,OAAOA,aAAP,MAA0B,kBAA1B;;IAEqBC,c;AAMnB,4BAAc;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACZ,SAAKC,MAAL,GAAc,IAAIF,aAAJ,CAAkB;AAC9BG,MAAAA,UAAU,EAAE,CADkB;AAE9BC,MAAAA,OAAO,EAAE;AAFqB,KAAlB,CAAd;AAKA,SAAKC,OAAL,GAAe,IAAIL,aAAJ,CAAkB;AAC/BG,MAAAA,UAAU,EAAE,CADmB;AAE/BC,MAAAA,OAAO,EAAE;AAFsB,KAAlB,CAAf;AAKA,SAAKE,KAAL;AACD;;;;WAED,iBAAe;AACb,WAAKC,MAAL,GAAc,KAAd;AACA,WAAKL,MAAL,CAAYI,KAAZ;AACA,WAAKD,OAAL,CAAaC,KAAb;AACD;;;WAED,oBAAkBE,CAAlB,EAAiCC,MAAjC,EAAkDC,UAAlD,EAAuE;AACrE,WAAKR,MAAL,CAAYS,UAAZ,CAAuBH,CAAvB,EAA0BC,MAA1B,EAAkCC,UAAlC;AACA,WAAKL,OAAL,CAAaM,UAAb,CAAwBH,CAAxB,EAA2BC,MAA3B,EAAmCC,UAAnC;AACD;;;WAED,mBAAiBF,CAAjB,EAAgCC,MAAhC,EAAiDC,UAAjD,EAAsE;AACpE,WAAKR,MAAL,CAAYU,SAAZ,CAAsBJ,CAAtB,EAAyBC,MAAzB,EAAiCC,UAAjC;AACA,WAAKL,OAAL,CAAaO,SAAb,CAAuBJ,CAAvB,EAA0BC,MAA1B,EAAkCC,UAAlC;AACD;;;WAED,kBAAgBF,CAAhB,EAA+BC,MAA/B,EAAgD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ADe;AAAA;AADZ,SAAP;AAWD;AACF;;;WAED,uBAAqB;AACnB,WAAKF,KAAL;AACD;;;WAED,kBAAgB;AACd,WAAKqB,OAAL,GAAe,IAAf;AACD;;;WAED,mBAAiB;AACf,WAAKA,OAAL,GAAe,KAAf;AACA,WAAKrB,KAAL;AACD;;;WAED,qBAAmB;AACjB,aAAO,KAAKqB,OAAZ;AACD;;;WAED,oBAAkB;AAChB,aAAO,KAAKpB,MAAZ;AACD;;;;;;SA5FkBN,c","sourcesContent":["// @ts-ignore\nimport { EarthMap } from '../../earthmap';\nimport Point from '../../geo/point';\nimport { Map } from '../../map';\nimport TapRecognizer from './tap_recognizer';\n\nexport default class TapZoomHandler {\n public enabled: boolean;\n public active: boolean;\n public zoomIn: TapRecognizer;\n public zoomOut: TapRecognizer;\n\n constructor() {\n this.zoomIn = new TapRecognizer({\n numTouches: 1,\n numTaps: 2,\n });\n\n this.zoomOut = new TapRecognizer({\n numTouches: 2,\n numTaps: 1,\n });\n\n this.reset();\n }\n\n public reset() {\n this.active = false;\n this.zoomIn.reset();\n this.zoomOut.reset();\n }\n\n public touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n this.zoomIn.touchstart(e, points, mapTouches);\n this.zoomOut.touchstart(e, points, mapTouches);\n }\n\n public touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n this.zoomIn.touchmove(e, points, mapTouches);\n this.zoomOut.touchmove(e, points, mapTouches);\n }\n\n public touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]) {\n const zoomInPoint = this.zoomIn.touchend(e, points, mapTouches);\n const zoomOutPoint = this.zoomOut.touchend(e, points, mapTouches);\n\n if (zoomInPoint) {\n this.active = true;\n e.preventDefault();\n setTimeout(() => this.reset(), 0);\n return {\n cameraAnimation: (map: Map | EarthMap) =>\n map.easeTo(\n {\n duration: 300,\n zoom: map.getZoom() + 1,\n around: map.unproject(zoomInPoint),\n },\n { originalEvent: e },\n ),\n };\n } else if (zoomOutPoint) {\n this.active = true;\n e.preventDefault();\n setTimeout(() => this.reset(), 0);\n return {\n cameraAnimation: (map: Map | EarthMap) =>\n map.easeTo(\n {\n duration: 300,\n zoom: map.getZoom() - 1,\n around: map.unproject(zoomOutPoint),\n },\n { originalEvent: e },\n ),\n };\n }\n }\n\n public touchcancel() {\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"],"file":"tap_zoom.js"}
@@ -1,5 +0,0 @@
1
- import TouchPanHandler from './touch_pan';
2
- import TouchPitchHandler from './touch_pitch';
3
- import TouchRotateHandler from './touch_rotate';
4
- import TouchZoomHandler from './touch_zoom';
5
- export { TouchPanHandler, TouchPitchHandler, TouchRotateHandler, TouchZoomHandler, };
@@ -1,6 +0,0 @@
1
- import TouchPanHandler from './touch_pan';
2
- import TouchPitchHandler from './touch_pitch';
3
- import TouchRotateHandler from './touch_rotate';
4
- import TouchZoomHandler from './touch_zoom';
5
- export { TouchPanHandler, TouchPitchHandler, TouchRotateHandler, TouchZoomHandler };
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/handler/touch/index.ts"],"names":["TouchPanHandler","TouchPitchHandler","TouchRotateHandler","TouchZoomHandler"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,aAA5B;AACA,OAAOC,iBAAP,MAA8B,eAA9B;AACA,OAAOC,kBAAP,MAA+B,gBAA/B;AACA,OAAOC,gBAAP,MAA6B,cAA7B;AAEA,SACEH,eADF,EAEEC,iBAFF,EAGEC,kBAHF,EAIEC,gBAJF","sourcesContent":["import TouchPanHandler from './touch_pan';\nimport TouchPitchHandler from './touch_pitch';\nimport TouchRotateHandler from './touch_rotate';\nimport TouchZoomHandler from './touch_zoom';\n\nexport {\n TouchPanHandler,\n TouchPitchHandler,\n TouchRotateHandler,\n TouchZoomHandler,\n};\n"],"file":"index.js"}
@@ -1,30 +0,0 @@
1
- import Point from '../../geo/point';
2
- export default class TouchPanHandler {
3
- enabled: boolean;
4
- active: boolean;
5
- touches: {
6
- [key: string]: Point;
7
- };
8
- minTouches: number;
9
- clickTolerance: number;
10
- sum: Point;
11
- constructor(options: {
12
- clickTolerance: number;
13
- });
14
- reset(): void;
15
- touchstart(e: TouchEvent, points: Point[], mapTouches: Touch[]): {
16
- around: Point;
17
- panDelta: Point;
18
- } | undefined;
19
- touchmove(e: TouchEvent, points: Point[], mapTouches: Touch[]): {
20
- around: Point;
21
- panDelta: Point;
22
- } | undefined;
23
- touchend(e: TouchEvent, points: Point[], mapTouches: Touch[]): void;
24
- touchcancel(): void;
25
- enable(): void;
26
- disable(): void;
27
- isEnabled(): boolean;
28
- isActive(): boolean;
29
- private calculateTransform;
30
- }