@antv/l7-map 2.9.32-alpha.1 → 2.9.32-alpha.3

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 (168) hide show
  1. package/package.json +3 -3
  2. package/es/camera.d.ts +0 -84
  3. package/es/camera.js +0 -765
  4. package/es/css/l7.css +0 -98
  5. package/es/earthmap.d.ts +0 -66
  6. package/es/earthmap.js +0 -421
  7. package/es/geo/edge_insets.d.ts +0 -54
  8. package/es/geo/edge_insets.js +0 -118
  9. package/es/geo/lng_lat.d.ts +0 -18
  10. package/es/geo/lng_lat.js +0 -81
  11. package/es/geo/lng_lat_bounds.d.ts +0 -24
  12. package/es/geo/lng_lat_bounds.js +0 -167
  13. package/es/geo/mercator.d.ts +0 -28
  14. package/es/geo/mercator.js +0 -91
  15. package/es/geo/point.d.ts +0 -40
  16. package/es/geo/point.js +0 -231
  17. package/es/geo/simple.d.ts +0 -28
  18. package/es/geo/simple.js +0 -90
  19. package/es/geo/transform.d.ts +0 -198
  20. package/es/geo/transform.js +0 -971
  21. package/es/handler/IHandler.d.ts +0 -34
  22. package/es/handler/IHandler.js +0 -1
  23. package/es/handler/blockable_map_event.d.ts +0 -17
  24. package/es/handler/blockable_map_event.js +0 -83
  25. package/es/handler/box_zoom.d.ts +0 -59
  26. package/es/handler/box_zoom.js +0 -200
  27. package/es/handler/click_zoom.d.ts +0 -16
  28. package/es/handler/click_zoom.js +0 -59
  29. package/es/handler/events/event.d.ts +0 -4
  30. package/es/handler/events/event.js +0 -12
  31. package/es/handler/events/index.d.ts +0 -4
  32. package/es/handler/events/index.js +0 -4
  33. package/es/handler/events/map_mouse_event.d.ts +0 -34
  34. package/es/handler/events/map_mouse_event.js +0 -75
  35. package/es/handler/events/map_touch_event.d.ts +0 -57
  36. package/es/handler/events/map_touch_event.js +0 -105
  37. package/es/handler/events/map_wheel_event.d.ts +0 -33
  38. package/es/handler/events/map_wheel_event.js +0 -61
  39. package/es/handler/events/render_event.d.ts +0 -5
  40. package/es/handler/events/render_event.js +0 -39
  41. package/es/handler/handler_inertia.d.ts +0 -23
  42. package/es/handler/handler_inertia.js +0 -184
  43. package/es/handler/handler_manager.d.ts +0 -61
  44. package/es/handler/handler_manager.js +0 -684
  45. package/es/handler/handler_util.d.ts +0 -4
  46. package/es/handler/handler_util.js +0 -10
  47. package/es/handler/keyboard.d.ts +0 -36
  48. package/es/handler/keyboard.js +0 -162
  49. package/es/handler/map_event.d.ts +0 -29
  50. package/es/handler/map_event.js +0 -131
  51. package/es/handler/mouse/index.d.ts +0 -4
  52. package/es/handler/mouse/index.js +0 -4
  53. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  54. package/es/handler/mouse/mouse_handler.js +0 -129
  55. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  56. package/es/handler/mouse/mousepan_handler.js +0 -54
  57. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  58. package/es/handler/mouse/mousepitch_hander.js +0 -56
  59. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  60. package/es/handler/mouse/mouserotate_hander.js +0 -56
  61. package/es/handler/mouse/util.d.ts +0 -6
  62. package/es/handler/mouse/util.js +0 -12
  63. package/es/handler/scroll_zoom.d.ts +0 -93
  64. package/es/handler/scroll_zoom.js +0 -353
  65. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  66. package/es/handler/shim/dblclick_zoom.js +0 -72
  67. package/es/handler/shim/drag_pan.d.ts +0 -61
  68. package/es/handler/shim/drag_pan.js +0 -96
  69. package/es/handler/shim/drag_rotate.d.ts +0 -46
  70. package/es/handler/shim/drag_rotate.js +0 -80
  71. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  72. package/es/handler/shim/touch_zoom_rotate.js +0 -130
  73. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  74. package/es/handler/tap/single_tap_recognizer.js +0 -120
  75. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  76. package/es/handler/tap/tap_drag_zoom.js +0 -114
  77. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  78. package/es/handler/tap/tap_recognizer.js +0 -62
  79. package/es/handler/tap/tap_zoom.d.ts +0 -22
  80. package/es/handler/tap/tap_zoom.js +0 -115
  81. package/es/handler/touch/index.d.ts +0 -5
  82. package/es/handler/touch/index.js +0 -5
  83. package/es/handler/touch/touch_pan.d.ts +0 -30
  84. package/es/handler/touch/touch_pan.js +0 -128
  85. package/es/handler/touch/touch_pitch.d.ts +0 -13
  86. package/es/handler/touch/touch_pitch.js +0 -110
  87. package/es/handler/touch/touch_rotate.d.ts +0 -12
  88. package/es/handler/touch/touch_rotate.js +0 -88
  89. package/es/handler/touch/touch_zoom.d.ts +0 -12
  90. package/es/handler/touch/touch_zoom.js +0 -67
  91. package/es/handler/touch/two_touch.d.ts +0 -23
  92. package/es/handler/touch/two_touch.js +0 -134
  93. package/es/hash.d.ts +0 -14
  94. package/es/hash.js +0 -156
  95. package/es/index.d.ts +0 -3
  96. package/es/index.js +0 -3
  97. package/es/interface.d.ts +0 -34
  98. package/es/interface.js +0 -1
  99. package/es/map.d.ts +0 -70
  100. package/es/map.js +0 -463
  101. package/es/util.d.ts +0 -18
  102. package/es/util.js +0 -84
  103. package/es/utils/Aabb.d.ts +0 -12
  104. package/es/utils/Aabb.js +0 -133
  105. package/es/utils/dom.d.ts +0 -4
  106. package/es/utils/dom.js +0 -218
  107. package/es/utils/performance.d.ts +0 -17
  108. package/es/utils/performance.js +0 -62
  109. package/es/utils/primitives.d.ts +0 -6
  110. package/es/utils/primitives.js +0 -45
  111. package/es/utils/task_queue.d.ts +0 -13
  112. package/es/utils/task_queue.js +0 -106
  113. package/lib/camera.js +0 -533
  114. package/lib/css/l7.css +0 -98
  115. package/lib/earthmap.js +0 -278
  116. package/lib/geo/edge_insets.js +0 -76
  117. package/lib/geo/lng_lat.js +0 -73
  118. package/lib/geo/lng_lat_bounds.js +0 -138
  119. package/lib/geo/mercator.js +0 -91
  120. package/lib/geo/point.js +0 -176
  121. package/lib/geo/simple.js +0 -87
  122. package/lib/geo/transform.js +0 -503
  123. package/lib/handler/IHandler.js +0 -17
  124. package/lib/handler/blockable_map_event.js +0 -71
  125. package/lib/handler/box_zoom.js +0 -139
  126. package/lib/handler/click_zoom.js +0 -59
  127. package/lib/handler/events/event.js +0 -38
  128. package/lib/handler/events/index.js +0 -38
  129. package/lib/handler/events/map_mouse_event.js +0 -44
  130. package/lib/handler/events/map_touch_event.js +0 -48
  131. package/lib/handler/events/map_wheel_event.js +0 -36
  132. package/lib/handler/events/render_event.js +0 -33
  133. package/lib/handler/handler_inertia.js +0 -149
  134. package/lib/handler/handler_manager.js +0 -455
  135. package/lib/handler/handler_util.js +0 -35
  136. package/lib/handler/keyboard.js +0 -131
  137. package/lib/handler/map_event.js +0 -91
  138. package/lib/handler/mouse/index.js +0 -38
  139. package/lib/handler/mouse/mouse_handler.js +0 -103
  140. package/lib/handler/mouse/mousepan_handler.js +0 -48
  141. package/lib/handler/mouse/mousepitch_hander.js +0 -47
  142. package/lib/handler/mouse/mouserotate_hander.js +0 -47
  143. package/lib/handler/mouse/util.js +0 -44
  144. package/lib/handler/scroll_zoom.js +0 -225
  145. package/lib/handler/shim/dblclick_zoom.js +0 -46
  146. package/lib/handler/shim/drag_pan.js +0 -55
  147. package/lib/handler/shim/drag_rotate.js +0 -49
  148. package/lib/handler/shim/touch_zoom_rotate.js +0 -71
  149. package/lib/handler/tap/single_tap_recognizer.js +0 -102
  150. package/lib/handler/tap/tap_drag_zoom.js +0 -106
  151. package/lib/handler/tap/tap_recognizer.js +0 -66
  152. package/lib/handler/tap/tap_zoom.js +0 -99
  153. package/lib/handler/touch/index.js +0 -41
  154. package/lib/handler/touch/touch_pan.js +0 -110
  155. package/lib/handler/touch/touch_pitch.js +0 -86
  156. package/lib/handler/touch/touch_rotate.js +0 -65
  157. package/lib/handler/touch/touch_zoom.js +0 -56
  158. package/lib/handler/touch/two_touch.js +0 -105
  159. package/lib/hash.js +0 -120
  160. package/lib/index.js +0 -21
  161. package/lib/interface.js +0 -17
  162. package/lib/map.js +0 -308
  163. package/lib/util.js +0 -97
  164. package/lib/utils/Aabb.js +0 -90
  165. package/lib/utils/dom.js +0 -159
  166. package/lib/utils/performance.js +0 -80
  167. package/lib/utils/primitives.js +0 -63
  168. package/lib/utils/task_queue.js +0 -72
@@ -1,55 +0,0 @@
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
23
- });
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) {
28
- this.el = el;
29
- this.mousePan = mousePan;
30
- this.touchPan = touchPan;
31
- }
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");
38
- }
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");
45
- }
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,49 +0,0 @@
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
23
- });
24
- module.exports = __toCommonJS(drag_rotate_exports);
25
- var DragRotateHandler = class {
26
- constructor(options, mouseRotate, mousePitch) {
27
- this.pitchWithRotate = options.pitchWithRotate;
28
- this.mouseRotate = mouseRotate;
29
- this.mousePitch = mousePitch;
30
- }
31
- enable() {
32
- this.mouseRotate.enable();
33
- if (this.pitchWithRotate) {
34
- this.mousePitch.enable();
35
- }
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,71 +0,0 @@
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/touch_zoom_rotate.ts
20
- var touch_zoom_rotate_exports = {};
21
- __export(touch_zoom_rotate_exports, {
22
- default: () => TouchZoomRotateHandler
23
- });
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) {
28
- this.el = el;
29
- this.touchZoom = touchZoom;
30
- this.touchRotate = touchRotate;
31
- this.tapDragZoom = tapDragZoom;
32
- this.rotationDisabled = false;
33
- this.enabled = true;
34
- }
35
- enable(options) {
36
- this.touchZoom.enable(options);
37
- if (!this.rotationDisabled) {
38
- this.touchRotate.enable(options);
39
- }
40
- this.tapDragZoom.enable();
41
- if (!import_l7_utils.isMini) {
42
- this.el.classList.add("l7-touch-zoom-rotate");
43
- }
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");
51
- }
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();
67
- }
68
- }
69
- };
70
- // Annotate the CommonJS export names for ESM import in node:
71
- 0 && (module.exports = {});
@@ -1,102 +0,0 @@
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
29
- });
30
- module.exports = __toCommonJS(single_tap_recognizer_exports);
31
- var import_point = __toESM(require("../../geo/point"));
32
- var import_handler_util = require("../handler_util");
33
- function getCentroid(points) {
34
- const sum = new import_point.default(0, 0);
35
- for (const point of points) {
36
- sum._add(point);
37
- }
38
- return sum.div(points.length);
39
- }
40
- var MAX_TAP_INTERVAL = 500;
41
- var MAX_TOUCH_TIME = 500;
42
- var MAX_DIST = 30;
43
- var SingleTapRecognizer = class {
44
- constructor(options) {
45
- this.reset();
46
- this.numTouches = options.numTouches;
47
- }
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;
57
- }
58
- if (this.aborted) {
59
- return;
60
- }
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;
80
- }
81
- }
82
- }
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;
93
- }
94
- }
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
- });
@@ -1,106 +0,0 @@
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/tap_drag_zoom.ts
23
- var tap_drag_zoom_exports = {};
24
- __export(tap_drag_zoom_exports, {
25
- default: () => TapDragZoomHandler
26
- });
27
- module.exports = __toCommonJS(tap_drag_zoom_exports);
28
- var import_single_tap_recognizer = require("./single_tap_recognizer");
29
- var import_tap_recognizer = __toESM(require("./tap_recognizer"));
30
- var TapDragZoomHandler = class {
31
- constructor() {
32
- this.tap = new import_tap_recognizer.default({
33
- numTouches: 1,
34
- numTaps: 1
35
- });
36
- this.reset();
37
- }
38
- reset() {
39
- this.active = false;
40
- delete this.swipePoint;
41
- delete this.swipeTouch;
42
- delete this.tapTime;
43
- this.tap.reset();
44
- }
45
- touchstart(e, points, mapTouches) {
46
- if (this.swipePoint) {
47
- return;
48
- }
49
- if (this.tapTime && e.timeStamp - this.tapTime > import_single_tap_recognizer.MAX_TAP_INTERVAL) {
50
- this.reset();
51
- }
52
- if (!this.tapTime) {
53
- this.tap.touchstart(e, points, mapTouches);
54
- } else if (mapTouches.length > 0) {
55
- this.swipePoint = points[0];
56
- this.swipeTouch = mapTouches[0].identifier;
57
- }
58
- }
59
- 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
- const newSwipePoint = points[0];
67
- const dist = newSwipePoint.y - this.swipePoint.y;
68
- this.swipePoint = newSwipePoint;
69
- e.preventDefault();
70
- this.active = true;
71
- return {
72
- zoomDelta: dist / 128
73
- };
74
- }
75
- }
76
- touchend(e, points, mapTouches) {
77
- if (!this.tapTime) {
78
- const point = this.tap.touchend(e, points, mapTouches);
79
- if (point) {
80
- this.tapTime = e.timeStamp;
81
- }
82
- } else if (this.swipePoint) {
83
- if (mapTouches.length === 0) {
84
- this.reset();
85
- }
86
- }
87
- }
88
- touchcancel() {
89
- this.reset();
90
- }
91
- enable() {
92
- this.enabled = true;
93
- }
94
- disable() {
95
- this.enabled = false;
96
- this.reset();
97
- }
98
- isEnabled() {
99
- return this.enabled;
100
- }
101
- isActive() {
102
- return this.active;
103
- }
104
- };
105
- // Annotate the CommonJS export names for ESM import in node:
106
- 0 && (module.exports = {});
@@ -1,66 +0,0 @@
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/tap_recognizer.ts
23
- var tap_recognizer_exports = {};
24
- __export(tap_recognizer_exports, {
25
- default: () => TapRecognizer
26
- });
27
- module.exports = __toCommonJS(tap_recognizer_exports);
28
- var import_single_tap_recognizer = __toESM(require("./single_tap_recognizer"));
29
- var TapRecognizer = class {
30
- constructor(options) {
31
- this.singleTap = new import_single_tap_recognizer.default(options);
32
- this.numTaps = options.numTaps;
33
- this.reset();
34
- }
35
- reset() {
36
- this.lastTime = Infinity;
37
- delete this.lastTap;
38
- this.count = 0;
39
- this.singleTap.reset();
40
- }
41
- touchstart(e, points, mapTouches) {
42
- this.singleTap.touchstart(e, points, mapTouches);
43
- }
44
- touchmove(e, points, mapTouches) {
45
- this.singleTap.touchmove(e, points, mapTouches);
46
- }
47
- touchend(e, points, mapTouches) {
48
- const tap = this.singleTap.touchend(e, points, mapTouches);
49
- if (tap) {
50
- const soonEnough = e.timeStamp - this.lastTime < import_single_tap_recognizer.MAX_TAP_INTERVAL;
51
- const closeEnough = !this.lastTap || this.lastTap.dist(tap) < import_single_tap_recognizer.MAX_DIST;
52
- if (!soonEnough || !closeEnough) {
53
- this.reset();
54
- }
55
- this.count++;
56
- this.lastTime = e.timeStamp;
57
- this.lastTap = tap;
58
- if (this.count === this.numTaps) {
59
- this.reset();
60
- return tap;
61
- }
62
- }
63
- }
64
- };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {});
@@ -1,99 +0,0 @@
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/tap_zoom.ts
23
- var tap_zoom_exports = {};
24
- __export(tap_zoom_exports, {
25
- default: () => TapZoomHandler
26
- });
27
- module.exports = __toCommonJS(tap_zoom_exports);
28
- var import_tap_recognizer = __toESM(require("./tap_recognizer"));
29
- var TapZoomHandler = class {
30
- constructor() {
31
- this.zoomIn = new import_tap_recognizer.default({
32
- numTouches: 1,
33
- numTaps: 2
34
- });
35
- this.zoomOut = new import_tap_recognizer.default({
36
- numTouches: 2,
37
- numTaps: 1
38
- });
39
- this.reset();
40
- }
41
- reset() {
42
- this.active = false;
43
- this.zoomIn.reset();
44
- this.zoomOut.reset();
45
- }
46
- touchstart(e, points, mapTouches) {
47
- this.zoomIn.touchstart(e, points, mapTouches);
48
- this.zoomOut.touchstart(e, points, mapTouches);
49
- }
50
- touchmove(e, points, mapTouches) {
51
- this.zoomIn.touchmove(e, points, mapTouches);
52
- this.zoomOut.touchmove(e, points, mapTouches);
53
- }
54
- touchend(e, points, mapTouches) {
55
- const zoomInPoint = this.zoomIn.touchend(e, points, mapTouches);
56
- const zoomOutPoint = this.zoomOut.touchend(e, points, mapTouches);
57
- if (zoomInPoint) {
58
- this.active = true;
59
- e.preventDefault();
60
- setTimeout(() => this.reset(), 0);
61
- return {
62
- cameraAnimation: (map) => map.easeTo({
63
- duration: 300,
64
- zoom: map.getZoom() + 1,
65
- around: map.unproject(zoomInPoint)
66
- }, { originalEvent: e })
67
- };
68
- } else if (zoomOutPoint) {
69
- this.active = true;
70
- e.preventDefault();
71
- setTimeout(() => this.reset(), 0);
72
- return {
73
- cameraAnimation: (map) => map.easeTo({
74
- duration: 300,
75
- zoom: map.getZoom() - 1,
76
- around: map.unproject(zoomOutPoint)
77
- }, { originalEvent: e })
78
- };
79
- }
80
- }
81
- touchcancel() {
82
- this.reset();
83
- }
84
- enable() {
85
- this.enabled = true;
86
- }
87
- disable() {
88
- this.enabled = false;
89
- this.reset();
90
- }
91
- isEnabled() {
92
- return this.enabled;
93
- }
94
- isActive() {
95
- return this.active;
96
- }
97
- };
98
- // Annotate the CommonJS export names for ESM import in node:
99
- 0 && (module.exports = {});
@@ -1,41 +0,0 @@
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/touch/index.ts
23
- var touch_exports = {};
24
- __export(touch_exports, {
25
- TouchPanHandler: () => import_touch_pan.default,
26
- TouchPitchHandler: () => import_touch_pitch.default,
27
- TouchRotateHandler: () => import_touch_rotate.default,
28
- TouchZoomHandler: () => import_touch_zoom.default
29
- });
30
- module.exports = __toCommonJS(touch_exports);
31
- var import_touch_pan = __toESM(require("./touch_pan"));
32
- var import_touch_pitch = __toESM(require("./touch_pitch"));
33
- var import_touch_rotate = __toESM(require("./touch_rotate"));
34
- var import_touch_zoom = __toESM(require("./touch_zoom"));
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- TouchPanHandler,
38
- TouchPitchHandler,
39
- TouchRotateHandler,
40
- TouchZoomHandler
41
- });