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

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,91 +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/map_event.ts
20
- var map_event_exports = {};
21
- __export(map_event_exports, {
22
- default: () => MapEventHandler
23
- });
24
- module.exports = __toCommonJS(map_event_exports);
25
- var import_events = require("./events");
26
- var MapEventHandler = class {
27
- constructor(map, options) {
28
- this.map = map;
29
- this.clickTolerance = options.clickTolerance;
30
- }
31
- reset() {
32
- delete this.mousedownPos;
33
- }
34
- wheel(e) {
35
- return this.firePreventable(new import_events.MapWheelEvent(e.type, this.map, e));
36
- }
37
- mousedown(e, point) {
38
- this.mousedownPos = point;
39
- return this.firePreventable(new import_events.MapMouseEvent(e.type, this.map, e));
40
- }
41
- mouseup(e) {
42
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
43
- }
44
- click(e, point) {
45
- if (this.mousedownPos && this.mousedownPos.dist(point) >= this.clickTolerance) {
46
- return;
47
- }
48
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
49
- }
50
- dblclick(e) {
51
- return this.firePreventable(new import_events.MapMouseEvent(e.type, this.map, e));
52
- }
53
- mouseover(e) {
54
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
55
- }
56
- mouseout(e) {
57
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
58
- }
59
- touchstart(e) {
60
- return this.firePreventable(new import_events.MapTouchEvent(e.type, this.map, e));
61
- }
62
- touchmove(e) {
63
- this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
64
- }
65
- touchend(e) {
66
- this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
67
- }
68
- touchcancel(e) {
69
- this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
70
- }
71
- firePreventable(mapEvent) {
72
- this.map.emit(mapEvent.type, mapEvent);
73
- if (mapEvent.defaultPrevented) {
74
- return {};
75
- }
76
- }
77
- isEnabled() {
78
- return true;
79
- }
80
- isActive() {
81
- return false;
82
- }
83
- enable() {
84
- return false;
85
- }
86
- disable() {
87
- return false;
88
- }
89
- };
90
- // Annotate the CommonJS export names for ESM import in node:
91
- 0 && (module.exports = {});
@@ -1,38 +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/mouse/index.ts
23
- var mouse_exports = {};
24
- __export(mouse_exports, {
25
- MousePanHandler: () => import_mousepan_handler.default,
26
- MousePitchHandler: () => import_mouserotate_hander.default,
27
- MouseRotateHandler: () => import_mousepitch_hander.default
28
- });
29
- module.exports = __toCommonJS(mouse_exports);
30
- var import_mousepan_handler = __toESM(require("./mousepan_handler"));
31
- var import_mousepitch_hander = __toESM(require("./mousepitch_hander"));
32
- var import_mouserotate_hander = __toESM(require("./mouserotate_hander"));
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- MousePanHandler,
36
- MousePitchHandler,
37
- MouseRotateHandler
38
- });
@@ -1,103 +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/mouse/mouse_handler.ts
23
- var mouse_handler_exports = {};
24
- __export(mouse_handler_exports, {
25
- default: () => MouseHandler
26
- });
27
- module.exports = __toCommonJS(mouse_handler_exports);
28
- var import_dom = __toESM(require("../../utils/dom"));
29
- var import_util = require("./util");
30
- var MouseHandler = class {
31
- constructor(options) {
32
- this.reset();
33
- this.clickTolerance = options.clickTolerance || 1;
34
- }
35
- reset() {
36
- this.active = false;
37
- this.moved = false;
38
- delete this.lastPoint;
39
- delete this.eventButton;
40
- }
41
- mousedown(e, point) {
42
- if (this.lastPoint) {
43
- return;
44
- }
45
- const eventButton = import_dom.default.mouseButton(e);
46
- if (!this.correctButton(e, eventButton)) {
47
- return;
48
- }
49
- this.lastPoint = point;
50
- this.eventButton = eventButton;
51
- }
52
- mousemoveWindow(e, point) {
53
- const lastPoint = this.lastPoint;
54
- if (!lastPoint) {
55
- return;
56
- }
57
- e.preventDefault();
58
- if ((0, import_util.buttonStillPressed)(e, this.eventButton)) {
59
- this.reset();
60
- return;
61
- }
62
- if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {
63
- return;
64
- }
65
- this.moved = true;
66
- this.lastPoint = point;
67
- return this.move(lastPoint, point);
68
- }
69
- mouseupWindow(e) {
70
- if (!this.lastPoint) {
71
- return;
72
- }
73
- const eventButton = import_dom.default.mouseButton(e);
74
- if (eventButton !== this.eventButton) {
75
- return;
76
- }
77
- if (this.moved) {
78
- import_dom.default.suppressClick();
79
- }
80
- this.reset();
81
- }
82
- enable() {
83
- this.enabled = true;
84
- }
85
- disable() {
86
- this.enabled = false;
87
- this.reset();
88
- }
89
- isEnabled() {
90
- return this.enabled;
91
- }
92
- isActive() {
93
- return this.active;
94
- }
95
- correctButton(e, button) {
96
- return false;
97
- }
98
- move(lastPoint, point) {
99
- return;
100
- }
101
- };
102
- // Annotate the CommonJS export names for ESM import in node:
103
- 0 && (module.exports = {});
@@ -1,48 +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/mouse/mousepan_handler.ts
23
- var mousepan_handler_exports = {};
24
- __export(mousepan_handler_exports, {
25
- default: () => MousePanHandler
26
- });
27
- module.exports = __toCommonJS(mousepan_handler_exports);
28
- var import_mouse_handler = __toESM(require("./mouse_handler"));
29
- var import_util = require("./util");
30
- var MousePanHandler = class extends import_mouse_handler.default {
31
- mousedown(e, point) {
32
- super.mousedown(e, point);
33
- if (this.lastPoint) {
34
- this.active = true;
35
- }
36
- }
37
- move(lastPoint, point) {
38
- return {
39
- around: point,
40
- panDelta: point.sub(lastPoint)
41
- };
42
- }
43
- correctButton(e, button) {
44
- return button === import_util.LEFT_BUTTON && !e.ctrlKey;
45
- }
46
- };
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {});
@@ -1,47 +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/mouse/mousepitch_hander.ts
23
- var mousepitch_hander_exports = {};
24
- __export(mousepitch_hander_exports, {
25
- default: () => MousePitchHandler
26
- });
27
- module.exports = __toCommonJS(mousepitch_hander_exports);
28
- var import_mouse_handler = __toESM(require("./mouse_handler"));
29
- var import_util = require("./util");
30
- var MousePitchHandler = class extends import_mouse_handler.default {
31
- correctButton(e, button) {
32
- return button === import_util.LEFT_BUTTON && e.ctrlKey || button === import_util.RIGHT_BUTTON;
33
- }
34
- move(lastPoint, point) {
35
- const degreesPerPixelMoved = -0.5;
36
- const pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;
37
- if (pitchDelta) {
38
- this.active = true;
39
- return { pitchDelta };
40
- }
41
- }
42
- contextmenu(e) {
43
- e.preventDefault();
44
- }
45
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {});
@@ -1,47 +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/mouse/mouserotate_hander.ts
23
- var mouserotate_hander_exports = {};
24
- __export(mouserotate_hander_exports, {
25
- default: () => MouseRotateHandler
26
- });
27
- module.exports = __toCommonJS(mouserotate_hander_exports);
28
- var import_mouse_handler = __toESM(require("./mouse_handler"));
29
- var import_util = require("./util");
30
- var MouseRotateHandler = class extends import_mouse_handler.default {
31
- contextmenu(e) {
32
- e.preventDefault();
33
- }
34
- correctButton(e, button) {
35
- return button === import_util.LEFT_BUTTON && e.ctrlKey || button === import_util.RIGHT_BUTTON;
36
- }
37
- move(lastPoint, point) {
38
- const degreesPerPixelMoved = 0.8;
39
- const bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;
40
- if (bearingDelta) {
41
- this.active = true;
42
- return { bearingDelta };
43
- }
44
- }
45
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {});
@@ -1,44 +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/mouse/util.ts
20
- var util_exports = {};
21
- __export(util_exports, {
22
- BUTTONS_FLAGS: () => BUTTONS_FLAGS,
23
- LEFT_BUTTON: () => LEFT_BUTTON,
24
- RIGHT_BUTTON: () => RIGHT_BUTTON,
25
- buttonStillPressed: () => buttonStillPressed
26
- });
27
- module.exports = __toCommonJS(util_exports);
28
- var LEFT_BUTTON = 0;
29
- var RIGHT_BUTTON = 2;
30
- var BUTTONS_FLAGS = {
31
- [LEFT_BUTTON]: 1,
32
- [RIGHT_BUTTON]: 2
33
- };
34
- function buttonStillPressed(e, button) {
35
- const flag = BUTTONS_FLAGS[button];
36
- return e.buttons === void 0 || (e.buttons & flag) !== flag;
37
- }
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- BUTTONS_FLAGS,
41
- LEFT_BUTTON,
42
- RIGHT_BUTTON,
43
- buttonStillPressed
44
- });
@@ -1,225 +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/scroll_zoom.ts
23
- var scroll_zoom_exports = {};
24
- __export(scroll_zoom_exports, {
25
- default: () => scroll_zoom_default
26
- });
27
- module.exports = __toCommonJS(scroll_zoom_exports);
28
- var import_lng_lat = __toESM(require("../geo/lng_lat"));
29
- var import_util = require("../util");
30
- var import_dom = __toESM(require("../utils/dom"));
31
- var wheelZoomDelta = 4.000244140625;
32
- var defaultZoomRate = 1 / 100;
33
- var wheelZoomRate = 1 / 450;
34
- var maxScalePerFrame = 2;
35
- var ScrollZoomHandler = class {
36
- constructor(map, handler) {
37
- this.onScrollFrame = () => {
38
- if (!this.frameId) {
39
- return;
40
- }
41
- this.frameId = null;
42
- if (!this.isActive()) {
43
- return;
44
- }
45
- const tr = this.map.transform;
46
- if (this.delta !== 0) {
47
- const zoomRate = this.type === "wheel" && Math.abs(this.delta) > wheelZoomDelta ? this.wheelZoomRate : this.defaultZoomRate;
48
- let scale = maxScalePerFrame / (1 + Math.exp(-Math.abs(this.delta * zoomRate)));
49
- if (this.delta < 0 && scale !== 0) {
50
- scale = 1 / scale;
51
- }
52
- const fromScale = typeof this.targetZoom === "number" ? tr.zoomScale(this.targetZoom) : tr.scale;
53
- this.targetZoom = Math.min(tr.maxZoom, Math.max(tr.minZoom, tr.scaleZoom(fromScale * scale)));
54
- if (this.type === "wheel") {
55
- this.startZoom = tr.zoom;
56
- this.easing = this.smoothOutEasing(200);
57
- }
58
- this.delta = 0;
59
- }
60
- const targetZoom = typeof this.targetZoom === "number" ? this.targetZoom : tr.zoom;
61
- const startZoom = this.startZoom;
62
- const easing = this.easing;
63
- let finished = false;
64
- let zoom;
65
- if (this.type === "wheel" && startZoom && easing) {
66
- const t = Math.min(((0, import_util.now)() - this.lastWheelEventTime) / 200, 1);
67
- const k = easing(t);
68
- zoom = (0, import_util.interpolate)(startZoom, targetZoom, k);
69
- if (t < 1) {
70
- if (!this.frameId) {
71
- this.frameId = true;
72
- }
73
- } else {
74
- finished = true;
75
- }
76
- } else {
77
- zoom = targetZoom;
78
- finished = true;
79
- }
80
- this.active = true;
81
- if (finished) {
82
- this.active = false;
83
- this.finishTimeout = setTimeout(() => {
84
- this.zooming = false;
85
- this.handler.triggerRenderFrame();
86
- delete this.targetZoom;
87
- delete this.finishTimeout;
88
- }, 200);
89
- }
90
- return {
91
- noInertia: true,
92
- needsRenderFrame: !finished,
93
- zoomDelta: zoom - tr.zoom,
94
- around: this.aroundPoint,
95
- originalEvent: this.lastWheelEvent
96
- };
97
- };
98
- this.map = map;
99
- this.el = map.getCanvasContainer();
100
- this.handler = handler;
101
- this.delta = 0;
102
- this.defaultZoomRate = defaultZoomRate;
103
- this.wheelZoomRate = wheelZoomRate;
104
- }
105
- setZoomRate(zoomRate) {
106
- this.defaultZoomRate = zoomRate;
107
- }
108
- setWheelZoomRate(zoomRate) {
109
- this.wheelZoomRate = zoomRate;
110
- }
111
- isEnabled() {
112
- return !!this.enabled;
113
- }
114
- isActive() {
115
- return !!this.active || this.finishTimeout !== void 0;
116
- }
117
- isZooming() {
118
- return !!this.zooming;
119
- }
120
- enable(options) {
121
- if (this.isEnabled()) {
122
- return;
123
- }
124
- this.enabled = true;
125
- this.aroundCenter = options && options.around === "center";
126
- }
127
- disable() {
128
- if (!this.isEnabled()) {
129
- return;
130
- }
131
- this.enabled = false;
132
- }
133
- wheel(e) {
134
- if (!this.isEnabled()) {
135
- return;
136
- }
137
- let value = e.deltaMode === window.WheelEvent.DOM_DELTA_LINE ? e.deltaY * 40 : e.deltaY;
138
- const nowTime = (0, import_util.now)();
139
- const timeDelta = nowTime - (this.lastWheelEventTime || 0);
140
- this.lastWheelEventTime = nowTime;
141
- if (value !== 0 && value % wheelZoomDelta === 0) {
142
- this.type = "wheel";
143
- } else if (value !== 0 && Math.abs(value) < 4) {
144
- this.type = "trackpad";
145
- } else if (timeDelta > 400) {
146
- this.type = null;
147
- this.lastValue = value;
148
- this.timeout = setTimeout(this.onTimeout, 40, e);
149
- } else if (!this.type) {
150
- this.type = Math.abs(timeDelta * value) < 200 ? "trackpad" : "wheel";
151
- if (this.timeout) {
152
- clearTimeout(this.timeout);
153
- this.timeout = null;
154
- value += this.lastValue;
155
- }
156
- }
157
- if (e.shiftKey && value) {
158
- value = value / 4;
159
- }
160
- if (this.type) {
161
- this.lastWheelEvent = e;
162
- this.delta -= value;
163
- if (!this.active) {
164
- this.start(e);
165
- }
166
- }
167
- e.preventDefault();
168
- }
169
- renderFrame() {
170
- return this.onScrollFrame();
171
- }
172
- reset() {
173
- this.active = false;
174
- }
175
- onTimeout(initialEvent) {
176
- this.type = "wheel";
177
- this.delta -= this.lastValue;
178
- if (!this.active && this.start) {
179
- this.start(initialEvent);
180
- }
181
- }
182
- start(e) {
183
- if (!this.delta) {
184
- return;
185
- }
186
- if (this.frameId) {
187
- this.frameId = null;
188
- }
189
- this.active = true;
190
- if (!this.isZooming()) {
191
- this.zooming = true;
192
- }
193
- if (this.finishTimeout) {
194
- clearTimeout(this.finishTimeout);
195
- delete this.finishTimeout;
196
- }
197
- const pos = import_dom.default.mousePos(this.el, e);
198
- this.around = import_lng_lat.default.convert(this.aroundCenter ? this.map.getCenter() : this.map.unproject(pos));
199
- this.aroundPoint = this.map.transform.locationPoint(this.around);
200
- if (!this.frameId) {
201
- this.frameId = true;
202
- this.handler.triggerRenderFrame();
203
- }
204
- }
205
- smoothOutEasing(duration) {
206
- let easing = import_util.ease;
207
- if (this.prevEase) {
208
- const preEase = this.prevEase;
209
- const t = ((0, import_util.now)() - preEase.start) / preEase.duration;
210
- const speed = preEase.easing(t + 0.01) - preEase.easing(t);
211
- const x = 0.27 / Math.sqrt(speed * speed + 1e-4) * 0.01;
212
- const y = Math.sqrt(0.27 * 0.27 - x * x);
213
- easing = (0, import_util.bezier)(x, y, 0.25, 1);
214
- }
215
- this.prevEase = {
216
- start: (0, import_util.now)(),
217
- duration,
218
- easing
219
- };
220
- return easing;
221
- }
222
- };
223
- var scroll_zoom_default = ScrollZoomHandler;
224
- // Annotate the CommonJS export names for ESM import in node:
225
- 0 && (module.exports = {});
@@ -1,46 +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/dblclick_zoom.ts
20
- var dblclick_zoom_exports = {};
21
- __export(dblclick_zoom_exports, {
22
- default: () => DoubleClickZoomHandler
23
- });
24
- module.exports = __toCommonJS(dblclick_zoom_exports);
25
- var DoubleClickZoomHandler = class {
26
- constructor(clickZoom, TapZoom) {
27
- this.clickZoom = clickZoom;
28
- this.tapZoom = TapZoom;
29
- }
30
- enable() {
31
- this.clickZoom.enable();
32
- this.tapZoom.enable();
33
- }
34
- disable() {
35
- this.clickZoom.disable();
36
- this.tapZoom.disable();
37
- }
38
- isEnabled() {
39
- return this.clickZoom.isEnabled() && this.tapZoom.isEnabled();
40
- }
41
- isActive() {
42
- return this.clickZoom.isActive() || this.tapZoom.isActive();
43
- }
44
- };
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {});