@antv/l7-map 2.9.19 → 2.9.22-alpha.0

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 (223) hide show
  1. package/es/camera.js +115 -85
  2. package/es/css/l7.css +98 -0
  3. package/es/earthmap.js +27 -43
  4. package/es/geo/edge_insets.js +44 -14
  5. package/es/geo/lng_lat.js +15 -11
  6. package/es/geo/lng_lat_bounds.js +6 -10
  7. package/es/geo/mercator.js +24 -12
  8. package/es/geo/point.js +2 -8
  9. package/es/geo/simple.js +24 -12
  10. package/es/geo/transform.js +421 -120
  11. package/es/handler/IHandler.js +1 -2
  12. package/es/handler/blockable_map_event.js +13 -14
  13. package/es/handler/box_zoom.js +43 -27
  14. package/es/handler/click_zoom.js +3 -8
  15. package/es/handler/events/event.js +3 -6
  16. package/es/handler/events/index.js +4 -5
  17. package/es/handler/events/map_mouse_event.js +30 -20
  18. package/es/handler/events/map_touch_event.js +55 -25
  19. package/es/handler/events/map_wheel_event.js +24 -15
  20. package/es/handler/events/render_event.js +3 -6
  21. package/es/handler/handler_inertia.js +10 -12
  22. package/es/handler/handler_manager.js +75 -72
  23. package/es/handler/handler_util.js +2 -2
  24. package/es/handler/keyboard.js +20 -15
  25. package/es/handler/map_event.js +23 -12
  26. package/es/handler/mouse/index.js +4 -5
  27. package/es/handler/mouse/mouse_handler.js +17 -21
  28. package/es/handler/mouse/mousepan_handler.js +5 -5
  29. package/es/handler/mouse/mousepitch_hander.js +7 -5
  30. package/es/handler/mouse/mouserotate_hander.js +7 -5
  31. package/es/handler/mouse/util.js +3 -3
  32. package/es/handler/scroll_zoom.js +103 -67
  33. package/es/handler/shim/dblclick_zoom.js +35 -8
  34. package/es/handler/shim/drag_pan.js +48 -12
  35. package/es/handler/shim/drag_rotate.js +39 -10
  36. package/es/handler/shim/touch_zoom_rotate.js +59 -16
  37. package/es/handler/tap/single_tap_recognizer.js +7 -17
  38. package/es/handler/tap/tap_drag_zoom.js +5 -18
  39. package/es/handler/tap/tap_recognizer.js +4 -15
  40. package/es/handler/tap/tap_zoom.js +4 -13
  41. package/es/handler/touch/index.js +5 -6
  42. package/es/handler/touch/touch_pan.js +9 -20
  43. package/es/handler/touch/touch_pitch.js +11 -23
  44. package/es/handler/touch/touch_rotate.js +15 -18
  45. package/es/handler/touch/touch_zoom.js +5 -19
  46. package/es/handler/touch/two_touch.js +14 -21
  47. package/es/hash.js +28 -16
  48. package/es/index.js +2 -3
  49. package/es/interface.js +1 -2
  50. package/es/map.js +26 -47
  51. package/es/util.js +15 -6
  52. package/es/utils/Aabb.js +11 -12
  53. package/es/utils/dom.js +30 -11
  54. package/es/utils/performance.js +10 -6
  55. package/es/utils/primitives.js +11 -10
  56. package/es/utils/task_queue.js +6 -13
  57. package/lib/camera.js +508 -721
  58. package/lib/css/l7.css +98 -0
  59. package/lib/earthmap.js +222 -392
  60. package/lib/geo/edge_insets.js +64 -83
  61. package/lib/geo/lng_lat.js +65 -81
  62. package/lib/geo/lng_lat_bounds.js +124 -165
  63. package/lib/geo/mercator.js +62 -78
  64. package/lib/geo/point.js +171 -239
  65. package/lib/geo/simple.js +61 -80
  66. package/lib/geo/transform.js +470 -653
  67. package/lib/handler/IHandler.js +17 -2
  68. package/lib/handler/blockable_map_event.js +63 -83
  69. package/lib/handler/box_zoom.js +123 -176
  70. package/lib/handler/click_zoom.js +56 -68
  71. package/lib/handler/events/event.js +35 -23
  72. package/lib/handler/events/index.js +35 -29
  73. package/lib/handler/events/map_mouse_event.js +42 -72
  74. package/lib/handler/events/map_touch_event.js +45 -80
  75. package/lib/handler/events/map_wheel_event.js +34 -58
  76. package/lib/handler/events/render_event.js +31 -52
  77. package/lib/handler/handler_inertia.js +113 -160
  78. package/lib/handler/handler_manager.js +379 -620
  79. package/lib/handler/handler_util.js +28 -10
  80. package/lib/handler/keyboard.js +114 -146
  81. package/lib/handler/map_event.js +84 -120
  82. package/lib/handler/mouse/index.js +35 -29
  83. package/lib/handler/mouse/mouse_handler.js +90 -123
  84. package/lib/handler/mouse/mousepan_handler.js +46 -65
  85. package/lib/handler/mouse/mousepitch_hander.js +44 -63
  86. package/lib/handler/mouse/mouserotate_hander.js +44 -63
  87. package/lib/handler/mouse/util.js +38 -20
  88. package/lib/handler/scroll_zoom.js +175 -258
  89. package/lib/handler/shim/dblclick_zoom.js +42 -48
  90. package/lib/handler/shim/drag_pan.js +48 -59
  91. package/lib/handler/shim/drag_rotate.js +43 -51
  92. package/lib/handler/shim/touch_zoom_rotate.js +58 -78
  93. package/lib/handler/tap/single_tap_recognizer.js +84 -117
  94. package/lib/handler/tap/tap_drag_zoom.js +92 -115
  95. package/lib/handler/tap/tap_recognizer.js +60 -78
  96. package/lib/handler/tap/tap_zoom.js +88 -119
  97. package/lib/handler/touch/index.js +38 -37
  98. package/lib/handler/touch/touch_pan.js +98 -132
  99. package/lib/handler/touch/touch_pitch.js +73 -117
  100. package/lib/handler/touch/touch_rotate.js +58 -94
  101. package/lib/handler/touch/touch_zoom.js +49 -84
  102. package/lib/handler/touch/two_touch.js +88 -128
  103. package/lib/hash.js +100 -133
  104. package/lib/index.js +19 -31
  105. package/lib/interface.js +17 -2
  106. package/lib/map.js +238 -420
  107. package/lib/util.js +67 -78
  108. package/lib/utils/Aabb.js +80 -132
  109. package/lib/utils/dom.js +84 -141
  110. package/lib/utils/performance.js +54 -42
  111. package/lib/utils/primitives.js +59 -51
  112. package/lib/utils/task_queue.js +61 -108
  113. package/package.json +11 -8
  114. package/es/camera.js.map +0 -1
  115. package/es/earthmap.js.map +0 -1
  116. package/es/geo/edge_insets.js.map +0 -1
  117. package/es/geo/lng_lat.js.map +0 -1
  118. package/es/geo/lng_lat_bounds.js.map +0 -1
  119. package/es/geo/mercator.js.map +0 -1
  120. package/es/geo/point.js.map +0 -1
  121. package/es/geo/simple.js.map +0 -1
  122. package/es/geo/transform.js.map +0 -1
  123. package/es/handler/IHandler.js.map +0 -1
  124. package/es/handler/blockable_map_event.js.map +0 -1
  125. package/es/handler/box_zoom.js.map +0 -1
  126. package/es/handler/click_zoom.js.map +0 -1
  127. package/es/handler/events/event.js.map +0 -1
  128. package/es/handler/events/index.js.map +0 -1
  129. package/es/handler/events/map_mouse_event.js.map +0 -1
  130. package/es/handler/events/map_touch_event.js.map +0 -1
  131. package/es/handler/events/map_wheel_event.js.map +0 -1
  132. package/es/handler/events/render_event.js.map +0 -1
  133. package/es/handler/handler_inertia.js.map +0 -1
  134. package/es/handler/handler_manager.js.map +0 -1
  135. package/es/handler/handler_util.js.map +0 -1
  136. package/es/handler/keyboard.js.map +0 -1
  137. package/es/handler/map_event.js.map +0 -1
  138. package/es/handler/mouse/index.js.map +0 -1
  139. package/es/handler/mouse/mouse_handler.js.map +0 -1
  140. package/es/handler/mouse/mousepan_handler.js.map +0 -1
  141. package/es/handler/mouse/mousepitch_hander.js.map +0 -1
  142. package/es/handler/mouse/mouserotate_hander.js.map +0 -1
  143. package/es/handler/mouse/util.js.map +0 -1
  144. package/es/handler/scroll_zoom.js.map +0 -1
  145. package/es/handler/shim/dblclick_zoom.js.map +0 -1
  146. package/es/handler/shim/drag_pan.js.map +0 -1
  147. package/es/handler/shim/drag_rotate.js.map +0 -1
  148. package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
  149. package/es/handler/tap/single_tap_recognizer.js.map +0 -1
  150. package/es/handler/tap/tap_drag_zoom.js.map +0 -1
  151. package/es/handler/tap/tap_recognizer.js.map +0 -1
  152. package/es/handler/tap/tap_zoom.js.map +0 -1
  153. package/es/handler/touch/index.js.map +0 -1
  154. package/es/handler/touch/touch_pan.js.map +0 -1
  155. package/es/handler/touch/touch_pitch.js.map +0 -1
  156. package/es/handler/touch/touch_rotate.js.map +0 -1
  157. package/es/handler/touch/touch_zoom.js.map +0 -1
  158. package/es/handler/touch/two_touch.js.map +0 -1
  159. package/es/hash.js.map +0 -1
  160. package/es/index.js.map +0 -1
  161. package/es/interface.js.map +0 -1
  162. package/es/map.js.map +0 -1
  163. package/es/util.js.map +0 -1
  164. package/es/utils/Aabb.js.map +0 -1
  165. package/es/utils/dom.js.map +0 -1
  166. package/es/utils/performance.js.map +0 -1
  167. package/es/utils/primitives.js.map +0 -1
  168. package/es/utils/task_queue.js.map +0 -1
  169. package/lib/camera.js.map +0 -1
  170. package/lib/earthmap.js.map +0 -1
  171. package/lib/geo/edge_insets.js.map +0 -1
  172. package/lib/geo/lng_lat.js.map +0 -1
  173. package/lib/geo/lng_lat_bounds.js.map +0 -1
  174. package/lib/geo/mercator.js.map +0 -1
  175. package/lib/geo/point.js.map +0 -1
  176. package/lib/geo/simple.js.map +0 -1
  177. package/lib/geo/transform.js.map +0 -1
  178. package/lib/handler/IHandler.js.map +0 -1
  179. package/lib/handler/blockable_map_event.js.map +0 -1
  180. package/lib/handler/box_zoom.js.map +0 -1
  181. package/lib/handler/click_zoom.js.map +0 -1
  182. package/lib/handler/events/event.js.map +0 -1
  183. package/lib/handler/events/index.js.map +0 -1
  184. package/lib/handler/events/map_mouse_event.js.map +0 -1
  185. package/lib/handler/events/map_touch_event.js.map +0 -1
  186. package/lib/handler/events/map_wheel_event.js.map +0 -1
  187. package/lib/handler/events/render_event.js.map +0 -1
  188. package/lib/handler/handler_inertia.js.map +0 -1
  189. package/lib/handler/handler_manager.js.map +0 -1
  190. package/lib/handler/handler_util.js.map +0 -1
  191. package/lib/handler/keyboard.js.map +0 -1
  192. package/lib/handler/map_event.js.map +0 -1
  193. package/lib/handler/mouse/index.js.map +0 -1
  194. package/lib/handler/mouse/mouse_handler.js.map +0 -1
  195. package/lib/handler/mouse/mousepan_handler.js.map +0 -1
  196. package/lib/handler/mouse/mousepitch_hander.js.map +0 -1
  197. package/lib/handler/mouse/mouserotate_hander.js.map +0 -1
  198. package/lib/handler/mouse/util.js.map +0 -1
  199. package/lib/handler/scroll_zoom.js.map +0 -1
  200. package/lib/handler/shim/dblclick_zoom.js.map +0 -1
  201. package/lib/handler/shim/drag_pan.js.map +0 -1
  202. package/lib/handler/shim/drag_rotate.js.map +0 -1
  203. package/lib/handler/shim/touch_zoom_rotate.js.map +0 -1
  204. package/lib/handler/tap/single_tap_recognizer.js.map +0 -1
  205. package/lib/handler/tap/tap_drag_zoom.js.map +0 -1
  206. package/lib/handler/tap/tap_recognizer.js.map +0 -1
  207. package/lib/handler/tap/tap_zoom.js.map +0 -1
  208. package/lib/handler/touch/index.js.map +0 -1
  209. package/lib/handler/touch/touch_pan.js.map +0 -1
  210. package/lib/handler/touch/touch_pitch.js.map +0 -1
  211. package/lib/handler/touch/touch_rotate.js.map +0 -1
  212. package/lib/handler/touch/touch_zoom.js.map +0 -1
  213. package/lib/handler/touch/two_touch.js.map +0 -1
  214. package/lib/hash.js.map +0 -1
  215. package/lib/index.js.map +0 -1
  216. package/lib/interface.js.map +0 -1
  217. package/lib/map.js.map +0 -1
  218. package/lib/util.js.map +0 -1
  219. package/lib/utils/Aabb.js.map +0 -1
  220. package/lib/utils/dom.js.map +0 -1
  221. package/lib/utils/performance.js.map +0 -1
  222. package/lib/utils/primitives.js.map +0 -1
  223. package/lib/utils/task_queue.js.map +0 -1
@@ -1,66 +1,55 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/handler/shim/drag_pan.ts
20
+ var drag_pan_exports = {};
21
+ __export(drag_pan_exports, {
22
+ default: () => DragPanHandler
7
23
  });
8
- exports.default = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _l7Utils = require("@antv/l7-utils");
17
-
18
- var DragPanHandler = function () {
19
- function DragPanHandler(el, mousePan, touchPan) {
20
- (0, _classCallCheck2.default)(this, DragPanHandler);
21
- (0, _defineProperty2.default)(this, "inertiaOptions", void 0);
22
- (0, _defineProperty2.default)(this, "el", void 0);
23
- (0, _defineProperty2.default)(this, "mousePan", void 0);
24
- (0, _defineProperty2.default)(this, "touchPan", void 0);
24
+ module.exports = __toCommonJS(drag_pan_exports);
25
+ var import_l7_utils = require("@antv/l7-utils");
26
+ var DragPanHandler = class {
27
+ constructor(el, mousePan, touchPan) {
25
28
  this.el = el;
26
29
  this.mousePan = mousePan;
27
30
  this.touchPan = touchPan;
28
31
  }
29
-
30
- (0, _createClass2.default)(DragPanHandler, [{
31
- key: "enable",
32
- value: function enable(options) {
33
- this.inertiaOptions = options || {};
34
- this.mousePan.enable();
35
- this.touchPan.enable();
36
-
37
- if (!_l7Utils.isMini) {
38
- this.el.classList.add('l7-touch-drag-pan');
39
- }
40
- }
41
- }, {
42
- key: "disable",
43
- value: function disable() {
44
- this.mousePan.disable();
45
- this.touchPan.disable();
46
-
47
- if (!_l7Utils.isMini) {
48
- this.el.classList.remove('l7-touch-drag-pan');
49
- }
32
+ enable(options) {
33
+ this.inertiaOptions = options || {};
34
+ this.mousePan.enable();
35
+ this.touchPan.enable();
36
+ if (!import_l7_utils.isMini) {
37
+ this.el.classList.add("l7-touch-drag-pan");
50
38
  }
51
- }, {
52
- key: "isEnabled",
53
- value: function isEnabled() {
54
- return this.mousePan.isEnabled() && this.touchPan.isEnabled();
55
- }
56
- }, {
57
- key: "isActive",
58
- value: function isActive() {
59
- return this.mousePan.isActive() || this.touchPan.isActive();
39
+ }
40
+ disable() {
41
+ this.mousePan.disable();
42
+ this.touchPan.disable();
43
+ if (!import_l7_utils.isMini) {
44
+ this.el.classList.remove("l7-touch-drag-pan");
60
45
  }
61
- }]);
62
- return DragPanHandler;
63
- }();
64
-
65
- exports.default = DragPanHandler;
66
- //# sourceMappingURL=drag_pan.js.map
46
+ }
47
+ isEnabled() {
48
+ return this.mousePan.isEnabled() && this.touchPan.isEnabled();
49
+ }
50
+ isActive() {
51
+ return this.mousePan.isActive() || this.touchPan.isActive();
52
+ }
53
+ };
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {});
@@ -1,57 +1,49 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/handler/shim/drag_rotate.ts
20
+ var drag_rotate_exports = {};
21
+ __export(drag_rotate_exports, {
22
+ default: () => DragRotateHandler
7
23
  });
8
- exports.default = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var DragRotateHandler = function () {
17
- function DragRotateHandler(options, mouseRotate, mousePitch) {
18
- (0, _classCallCheck2.default)(this, DragRotateHandler);
19
- (0, _defineProperty2.default)(this, "mouseRotate", void 0);
20
- (0, _defineProperty2.default)(this, "mousePitch", void 0);
21
- (0, _defineProperty2.default)(this, "pitchWithRotate", void 0);
24
+ module.exports = __toCommonJS(drag_rotate_exports);
25
+ var DragRotateHandler = class {
26
+ constructor(options, mouseRotate, mousePitch) {
22
27
  this.pitchWithRotate = options.pitchWithRotate;
23
28
  this.mouseRotate = mouseRotate;
24
29
  this.mousePitch = mousePitch;
25
30
  }
26
-
27
- (0, _createClass2.default)(DragRotateHandler, [{
28
- key: "enable",
29
- value: function enable() {
30
- this.mouseRotate.enable();
31
-
32
- if (this.pitchWithRotate) {
33
- this.mousePitch.enable();
34
- }
31
+ enable() {
32
+ this.mouseRotate.enable();
33
+ if (this.pitchWithRotate) {
34
+ this.mousePitch.enable();
35
35
  }
36
- }, {
37
- key: "disable",
38
- value: function disable() {
39
- this.mouseRotate.disable();
40
- this.mousePitch.disable();
41
- }
42
- }, {
43
- key: "isEnabled",
44
- value: function isEnabled() {
45
- return this.mouseRotate.isEnabled() && (!this.pitchWithRotate || this.mousePitch.isEnabled());
46
- }
47
- }, {
48
- key: "isActive",
49
- value: function isActive() {
50
- return this.mouseRotate.isActive() || this.mousePitch.isActive();
51
- }
52
- }]);
53
- return DragRotateHandler;
54
- }();
55
-
56
- exports.default = DragRotateHandler;
57
- //# sourceMappingURL=drag_rotate.js.map
36
+ }
37
+ disable() {
38
+ this.mouseRotate.disable();
39
+ this.mousePitch.disable();
40
+ }
41
+ isEnabled() {
42
+ return this.mouseRotate.isEnabled() && (!this.pitchWithRotate || this.mousePitch.isEnabled());
43
+ }
44
+ isActive() {
45
+ return this.mouseRotate.isActive() || this.mousePitch.isActive();
46
+ }
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {});
@@ -1,29 +1,30 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
4
18
 
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
19
+ // src/handler/shim/touch_zoom_rotate.ts
20
+ var touch_zoom_rotate_exports = {};
21
+ __export(touch_zoom_rotate_exports, {
22
+ default: () => TouchZoomRotateHandler
7
23
  });
8
- exports.default = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _l7Utils = require("@antv/l7-utils");
17
-
18
- var TouchZoomRotateHandler = function () {
19
- function TouchZoomRotateHandler(el, touchZoom, touchRotate, tapDragZoom) {
20
- (0, _classCallCheck2.default)(this, TouchZoomRotateHandler);
21
- (0, _defineProperty2.default)(this, "el", void 0);
22
- (0, _defineProperty2.default)(this, "touchZoom", void 0);
23
- (0, _defineProperty2.default)(this, "touchRotate", void 0);
24
- (0, _defineProperty2.default)(this, "tapDragZoom", void 0);
25
- (0, _defineProperty2.default)(this, "rotationDisabled", void 0);
26
- (0, _defineProperty2.default)(this, "enabled", void 0);
24
+ module.exports = __toCommonJS(touch_zoom_rotate_exports);
25
+ var import_l7_utils = require("@antv/l7-utils");
26
+ var TouchZoomRotateHandler = class {
27
+ constructor(el, touchZoom, touchRotate, tapDragZoom) {
27
28
  this.el = el;
28
29
  this.touchZoom = touchZoom;
29
30
  this.touchRotate = touchRotate;
@@ -31,61 +32,40 @@ var TouchZoomRotateHandler = function () {
31
32
  this.rotationDisabled = false;
32
33
  this.enabled = true;
33
34
  }
34
-
35
- (0, _createClass2.default)(TouchZoomRotateHandler, [{
36
- key: "enable",
37
- value: function enable(options) {
38
- this.touchZoom.enable(options);
39
-
40
- if (!this.rotationDisabled) {
41
- this.touchRotate.enable(options);
42
- }
43
-
44
- this.tapDragZoom.enable();
45
-
46
- if (!_l7Utils.isMini) {
47
- this.el.classList.add('l7-touch-zoom-rotate');
48
- }
35
+ enable(options) {
36
+ this.touchZoom.enable(options);
37
+ if (!this.rotationDisabled) {
38
+ this.touchRotate.enable(options);
49
39
  }
50
- }, {
51
- key: "disable",
52
- value: function disable() {
53
- this.touchZoom.disable();
54
- this.touchRotate.disable();
55
- this.tapDragZoom.disable();
56
-
57
- if (!_l7Utils.isMini) {
58
- this.el.classList.remove('l7-touch-zoom-rotate');
59
- }
40
+ this.tapDragZoom.enable();
41
+ if (!import_l7_utils.isMini) {
42
+ this.el.classList.add("l7-touch-zoom-rotate");
60
43
  }
61
- }, {
62
- key: "isEnabled",
63
- value: function isEnabled() {
64
- return this.touchZoom.isEnabled() && (this.rotationDisabled || this.touchRotate.isEnabled()) && this.tapDragZoom.isEnabled();
65
- }
66
- }, {
67
- key: "isActive",
68
- value: function isActive() {
69
- return this.touchZoom.isActive() || this.touchRotate.isActive() || this.tapDragZoom.isActive();
70
- }
71
- }, {
72
- key: "disableRotation",
73
- value: function disableRotation() {
74
- this.rotationDisabled = true;
75
- this.touchRotate.disable();
44
+ }
45
+ disable() {
46
+ this.touchZoom.disable();
47
+ this.touchRotate.disable();
48
+ this.tapDragZoom.disable();
49
+ if (!import_l7_utils.isMini) {
50
+ this.el.classList.remove("l7-touch-zoom-rotate");
76
51
  }
77
- }, {
78
- key: "enableRotation",
79
- value: function enableRotation() {
80
- this.rotationDisabled = false;
81
-
82
- if (this.touchZoom.isEnabled()) {
83
- this.touchRotate.enable();
84
- }
52
+ }
53
+ isEnabled() {
54
+ return this.touchZoom.isEnabled() && (this.rotationDisabled || this.touchRotate.isEnabled()) && this.tapDragZoom.isEnabled();
55
+ }
56
+ isActive() {
57
+ return this.touchZoom.isActive() || this.touchRotate.isActive() || this.tapDragZoom.isActive();
58
+ }
59
+ disableRotation() {
60
+ this.rotationDisabled = true;
61
+ this.touchRotate.disable();
62
+ }
63
+ enableRotation() {
64
+ this.rotationDisabled = false;
65
+ if (this.touchZoom.isEnabled()) {
66
+ this.touchRotate.enable();
85
67
  }
86
- }]);
87
- return TouchZoomRotateHandler;
88
- }();
89
-
90
- exports.default = TouchZoomRotateHandler;
91
- //# sourceMappingURL=touch_zoom_rotate.js.map
68
+ }
69
+ };
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {});
@@ -1,135 +1,102 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/handler/tap/single_tap_recognizer.ts
23
+ var single_tap_recognizer_exports = {};
24
+ __export(single_tap_recognizer_exports, {
25
+ MAX_DIST: () => MAX_DIST,
26
+ MAX_TAP_INTERVAL: () => MAX_TAP_INTERVAL,
27
+ MAX_TOUCH_TIME: () => MAX_TOUCH_TIME,
28
+ default: () => SingleTapRecognizer
7
29
  });
8
- exports.default = exports.MAX_TOUCH_TIME = exports.MAX_TAP_INTERVAL = exports.MAX_DIST = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _point = _interopRequireDefault(require("../../geo/point"));
17
-
18
- var _handler_util = require("../handler_util");
19
-
20
- 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; } } }; }
21
-
22
- 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); }
23
-
24
- 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; }
25
-
30
+ module.exports = __toCommonJS(single_tap_recognizer_exports);
31
+ var import_point = __toESM(require("../../geo/point"));
32
+ var import_handler_util = require("../handler_util");
26
33
  function getCentroid(points) {
27
- var sum = new _point.default(0, 0);
28
-
29
- var _iterator = _createForOfIteratorHelper(points),
30
- _step;
31
-
32
- try {
33
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
34
- var point = _step.value;
35
-
36
- sum._add(point);
37
- }
38
- } catch (err) {
39
- _iterator.e(err);
40
- } finally {
41
- _iterator.f();
34
+ const sum = new import_point.default(0, 0);
35
+ for (const point of points) {
36
+ sum._add(point);
42
37
  }
43
-
44
38
  return sum.div(points.length);
45
39
  }
46
-
47
40
  var MAX_TAP_INTERVAL = 500;
48
- exports.MAX_TAP_INTERVAL = MAX_TAP_INTERVAL;
49
41
  var MAX_TOUCH_TIME = 500;
50
- exports.MAX_TOUCH_TIME = MAX_TOUCH_TIME;
51
42
  var MAX_DIST = 30;
52
- exports.MAX_DIST = MAX_DIST;
53
-
54
- var SingleTapRecognizer = function () {
55
- function SingleTapRecognizer(options) {
56
- (0, _classCallCheck2.default)(this, SingleTapRecognizer);
57
- (0, _defineProperty2.default)(this, "numTouches", void 0);
58
- (0, _defineProperty2.default)(this, "centroid", void 0);
59
- (0, _defineProperty2.default)(this, "startTime", void 0);
60
- (0, _defineProperty2.default)(this, "aborted", void 0);
61
- (0, _defineProperty2.default)(this, "touches", void 0);
43
+ var SingleTapRecognizer = class {
44
+ constructor(options) {
62
45
  this.reset();
63
46
  this.numTouches = options.numTouches;
64
47
  }
65
-
66
- (0, _createClass2.default)(SingleTapRecognizer, [{
67
- key: "reset",
68
- value: function reset() {
69
- delete this.centroid;
70
- delete this.startTime;
71
- delete this.touches;
72
- this.aborted = false;
48
+ reset() {
49
+ delete this.centroid;
50
+ delete this.startTime;
51
+ delete this.touches;
52
+ this.aborted = false;
53
+ }
54
+ touchstart(e, points, mapTouches) {
55
+ if (this.centroid || mapTouches.length > this.numTouches) {
56
+ this.aborted = true;
73
57
  }
74
- }, {
75
- key: "touchstart",
76
- value: function touchstart(e, points, mapTouches) {
77
- if (this.centroid || mapTouches.length > this.numTouches) {
78
- this.aborted = true;
79
- }
80
-
81
- if (this.aborted) {
82
- return;
83
- }
84
-
85
- if (this.startTime === undefined) {
86
- this.startTime = e.timeStamp;
87
- }
88
-
89
- if (mapTouches.length === this.numTouches) {
90
- this.centroid = getCentroid(points);
91
- this.touches = (0, _handler_util.indexTouches)(mapTouches, points);
92
- }
58
+ if (this.aborted) {
59
+ return;
93
60
  }
94
- }, {
95
- key: "touchmove",
96
- value: function touchmove(e, points, mapTouches) {
97
- if (this.aborted || !this.centroid) {
98
- return;
99
- }
100
-
101
- var newTouches = (0, _handler_util.indexTouches)(mapTouches, points);
102
-
103
- for (var id in this.touches) {
104
- if (this.touches[id]) {
105
- var prevPos = this.touches[id];
106
- var pos = newTouches[id];
107
-
108
- if (!pos || pos.dist(prevPos) > MAX_DIST) {
109
- this.aborted = true;
110
- }
61
+ if (this.startTime === void 0) {
62
+ this.startTime = e.timeStamp;
63
+ }
64
+ if (mapTouches.length === this.numTouches) {
65
+ this.centroid = getCentroid(points);
66
+ this.touches = (0, import_handler_util.indexTouches)(mapTouches, points);
67
+ }
68
+ }
69
+ touchmove(e, points, mapTouches) {
70
+ if (this.aborted || !this.centroid) {
71
+ return;
72
+ }
73
+ const newTouches = (0, import_handler_util.indexTouches)(mapTouches, points);
74
+ for (const id in this.touches) {
75
+ if (this.touches[id]) {
76
+ const prevPos = this.touches[id];
77
+ const pos = newTouches[id];
78
+ if (!pos || pos.dist(prevPos) > MAX_DIST) {
79
+ this.aborted = true;
111
80
  }
112
81
  }
113
82
  }
114
- }, {
115
- key: "touchend",
116
- value: function touchend(e, points, mapTouches) {
117
- if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {
118
- this.aborted = true;
119
- }
120
-
121
- if (mapTouches.length === 0) {
122
- var centroid = !this.aborted && this.centroid;
123
- this.reset();
124
-
125
- if (centroid) {
126
- return centroid;
127
- }
83
+ }
84
+ touchend(e, points, mapTouches) {
85
+ if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {
86
+ this.aborted = true;
87
+ }
88
+ if (mapTouches.length === 0) {
89
+ const centroid = !this.aborted && this.centroid;
90
+ this.reset();
91
+ if (centroid) {
92
+ return centroid;
128
93
  }
129
94
  }
130
- }]);
131
- return SingleTapRecognizer;
132
- }();
133
-
134
- exports.default = SingleTapRecognizer;
135
- //# sourceMappingURL=single_tap_recognizer.js.map
95
+ }
96
+ };
97
+ // Annotate the CommonJS export names for ESM import in node:
98
+ 0 && (module.exports = {
99
+ MAX_DIST,
100
+ MAX_TAP_INTERVAL,
101
+ MAX_TOUCH_TIME
102
+ });