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

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/es/camera.d.ts +84 -0
  2. package/es/camera.js +765 -0
  3. package/es/css/l7.css +98 -0
  4. package/es/earthmap.d.ts +66 -0
  5. package/es/earthmap.js +421 -0
  6. package/es/geo/edge_insets.d.ts +54 -0
  7. package/es/geo/edge_insets.js +118 -0
  8. package/es/geo/lng_lat.d.ts +18 -0
  9. package/es/geo/lng_lat.js +81 -0
  10. package/es/geo/lng_lat_bounds.d.ts +24 -0
  11. package/es/geo/lng_lat_bounds.js +167 -0
  12. package/es/geo/mercator.d.ts +28 -0
  13. package/es/geo/mercator.js +91 -0
  14. package/es/geo/point.d.ts +40 -0
  15. package/es/geo/point.js +231 -0
  16. package/es/geo/simple.d.ts +28 -0
  17. package/es/geo/simple.js +90 -0
  18. package/es/geo/transform.d.ts +198 -0
  19. package/es/geo/transform.js +971 -0
  20. package/es/handler/IHandler.d.ts +34 -0
  21. package/es/handler/IHandler.js +1 -0
  22. package/es/handler/blockable_map_event.d.ts +17 -0
  23. package/es/handler/blockable_map_event.js +83 -0
  24. package/es/handler/box_zoom.d.ts +59 -0
  25. package/es/handler/box_zoom.js +200 -0
  26. package/es/handler/click_zoom.d.ts +16 -0
  27. package/es/handler/click_zoom.js +59 -0
  28. package/es/handler/events/event.d.ts +4 -0
  29. package/es/handler/events/event.js +12 -0
  30. package/es/handler/events/index.d.ts +4 -0
  31. package/es/handler/events/index.js +4 -0
  32. package/es/handler/events/map_mouse_event.d.ts +34 -0
  33. package/es/handler/events/map_mouse_event.js +75 -0
  34. package/es/handler/events/map_touch_event.d.ts +57 -0
  35. package/es/handler/events/map_touch_event.js +105 -0
  36. package/es/handler/events/map_wheel_event.d.ts +33 -0
  37. package/es/handler/events/map_wheel_event.js +61 -0
  38. package/es/handler/events/render_event.d.ts +5 -0
  39. package/es/handler/events/render_event.js +39 -0
  40. package/es/handler/handler_inertia.d.ts +23 -0
  41. package/es/handler/handler_inertia.js +184 -0
  42. package/es/handler/handler_manager.d.ts +61 -0
  43. package/es/handler/handler_manager.js +684 -0
  44. package/es/handler/handler_util.d.ts +4 -0
  45. package/es/handler/handler_util.js +10 -0
  46. package/es/handler/keyboard.d.ts +36 -0
  47. package/es/handler/keyboard.js +162 -0
  48. package/es/handler/map_event.d.ts +29 -0
  49. package/es/handler/map_event.js +131 -0
  50. package/es/handler/mouse/index.d.ts +4 -0
  51. package/es/handler/mouse/index.js +4 -0
  52. package/es/handler/mouse/mouse_handler.d.ts +22 -0
  53. package/es/handler/mouse/mouse_handler.js +129 -0
  54. package/es/handler/mouse/mousepan_handler.d.ts +10 -0
  55. package/es/handler/mouse/mousepan_handler.js +54 -0
  56. package/es/handler/mouse/mousepitch_hander.d.ts +9 -0
  57. package/es/handler/mouse/mousepitch_hander.js +56 -0
  58. package/es/handler/mouse/mouserotate_hander.d.ts +9 -0
  59. package/es/handler/mouse/mouserotate_hander.js +56 -0
  60. package/es/handler/mouse/util.d.ts +6 -0
  61. package/es/handler/mouse/util.js +12 -0
  62. package/es/handler/scroll_zoom.d.ts +93 -0
  63. package/es/handler/scroll_zoom.js +353 -0
  64. package/es/handler/shim/dblclick_zoom.d.ts +40 -0
  65. package/es/handler/shim/dblclick_zoom.js +72 -0
  66. package/es/handler/shim/drag_pan.d.ts +61 -0
  67. package/es/handler/shim/drag_pan.js +96 -0
  68. package/es/handler/shim/drag_rotate.d.ts +46 -0
  69. package/es/handler/shim/drag_rotate.js +80 -0
  70. package/es/handler/shim/touch_zoom_rotate.d.ts +70 -0
  71. package/es/handler/shim/touch_zoom_rotate.js +130 -0
  72. package/es/handler/tap/single_tap_recognizer.d.ts +20 -0
  73. package/es/handler/tap/single_tap_recognizer.js +120 -0
  74. package/es/handler/tap/tap_drag_zoom.d.ts +22 -0
  75. package/es/handler/tap/tap_drag_zoom.js +114 -0
  76. package/es/handler/tap/tap_recognizer.d.ts +17 -0
  77. package/es/handler/tap/tap_recognizer.js +62 -0
  78. package/es/handler/tap/tap_zoom.d.ts +22 -0
  79. package/es/handler/tap/tap_zoom.js +115 -0
  80. package/es/handler/touch/index.d.ts +5 -0
  81. package/es/handler/touch/index.js +5 -0
  82. package/es/handler/touch/touch_pan.d.ts +30 -0
  83. package/es/handler/touch/touch_pan.js +128 -0
  84. package/es/handler/touch/touch_pitch.d.ts +13 -0
  85. package/es/handler/touch/touch_pitch.js +110 -0
  86. package/es/handler/touch/touch_rotate.d.ts +12 -0
  87. package/es/handler/touch/touch_rotate.js +88 -0
  88. package/es/handler/touch/touch_zoom.d.ts +12 -0
  89. package/es/handler/touch/touch_zoom.js +67 -0
  90. package/es/handler/touch/two_touch.d.ts +23 -0
  91. package/es/handler/touch/two_touch.js +134 -0
  92. package/es/hash.d.ts +14 -0
  93. package/es/hash.js +156 -0
  94. package/es/index.d.ts +3 -0
  95. package/es/index.js +3 -0
  96. package/es/interface.d.ts +34 -0
  97. package/es/interface.js +1 -0
  98. package/es/map.d.ts +70 -0
  99. package/es/map.js +463 -0
  100. package/es/util.d.ts +18 -0
  101. package/es/util.js +84 -0
  102. package/es/utils/Aabb.d.ts +12 -0
  103. package/es/utils/Aabb.js +133 -0
  104. package/es/utils/dom.d.ts +4 -0
  105. package/es/utils/dom.js +218 -0
  106. package/es/utils/performance.d.ts +17 -0
  107. package/es/utils/performance.js +62 -0
  108. package/es/utils/primitives.d.ts +6 -0
  109. package/es/utils/primitives.js +45 -0
  110. package/es/utils/task_queue.d.ts +13 -0
  111. package/es/utils/task_queue.js +106 -0
  112. package/lib/camera.js +533 -0
  113. package/lib/css/l7.css +98 -0
  114. package/lib/earthmap.js +278 -0
  115. package/lib/geo/edge_insets.js +76 -0
  116. package/lib/geo/lng_lat.js +73 -0
  117. package/lib/geo/lng_lat_bounds.js +138 -0
  118. package/lib/geo/mercator.js +91 -0
  119. package/lib/geo/point.js +176 -0
  120. package/lib/geo/simple.js +87 -0
  121. package/lib/geo/transform.js +503 -0
  122. package/lib/handler/IHandler.js +17 -0
  123. package/lib/handler/blockable_map_event.js +71 -0
  124. package/lib/handler/box_zoom.js +139 -0
  125. package/lib/handler/click_zoom.js +59 -0
  126. package/lib/handler/events/event.js +38 -0
  127. package/lib/handler/events/index.js +38 -0
  128. package/lib/handler/events/map_mouse_event.js +44 -0
  129. package/lib/handler/events/map_touch_event.js +48 -0
  130. package/lib/handler/events/map_wheel_event.js +36 -0
  131. package/lib/handler/events/render_event.js +33 -0
  132. package/lib/handler/handler_inertia.js +149 -0
  133. package/lib/handler/handler_manager.js +455 -0
  134. package/lib/handler/handler_util.js +35 -0
  135. package/lib/handler/keyboard.js +131 -0
  136. package/lib/handler/map_event.js +91 -0
  137. package/lib/handler/mouse/index.js +38 -0
  138. package/lib/handler/mouse/mouse_handler.js +103 -0
  139. package/lib/handler/mouse/mousepan_handler.js +48 -0
  140. package/lib/handler/mouse/mousepitch_hander.js +47 -0
  141. package/lib/handler/mouse/mouserotate_hander.js +47 -0
  142. package/lib/handler/mouse/util.js +44 -0
  143. package/lib/handler/scroll_zoom.js +225 -0
  144. package/lib/handler/shim/dblclick_zoom.js +46 -0
  145. package/lib/handler/shim/drag_pan.js +55 -0
  146. package/lib/handler/shim/drag_rotate.js +49 -0
  147. package/lib/handler/shim/touch_zoom_rotate.js +71 -0
  148. package/lib/handler/tap/single_tap_recognizer.js +102 -0
  149. package/lib/handler/tap/tap_drag_zoom.js +106 -0
  150. package/lib/handler/tap/tap_recognizer.js +66 -0
  151. package/lib/handler/tap/tap_zoom.js +99 -0
  152. package/lib/handler/touch/index.js +41 -0
  153. package/lib/handler/touch/touch_pan.js +110 -0
  154. package/lib/handler/touch/touch_pitch.js +86 -0
  155. package/lib/handler/touch/touch_rotate.js +65 -0
  156. package/lib/handler/touch/touch_zoom.js +56 -0
  157. package/lib/handler/touch/two_touch.js +105 -0
  158. package/lib/hash.js +120 -0
  159. package/lib/index.js +21 -0
  160. package/lib/interface.js +17 -0
  161. package/lib/map.js +308 -0
  162. package/lib/util.js +97 -0
  163. package/lib/utils/Aabb.js +90 -0
  164. package/lib/utils/dom.js +159 -0
  165. package/lib/utils/performance.js +80 -0
  166. package/lib/utils/primitives.js +63 -0
  167. package/lib/utils/task_queue.js +72 -0
  168. package/package.json +3 -3
@@ -0,0 +1,80 @@
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/utils/performance.ts
20
+ var performance_exports = {};
21
+ __export(performance_exports, {
22
+ PerformanceMarkers: () => PerformanceMarkers,
23
+ PerformanceUtils: () => PerformanceUtils
24
+ });
25
+ module.exports = __toCommonJS(performance_exports);
26
+ var import_l7_utils = require("@antv/l7-utils");
27
+ var lastFrameTime = null;
28
+ var frameTimes = [];
29
+ var minFramerateTarget = 30;
30
+ var frameTimeTarget = 1e3 / minFramerateTarget;
31
+ var performance = import_l7_utils.$window.performance;
32
+ var PerformanceMarkers = {
33
+ create: "create",
34
+ load: "load",
35
+ fullLoad: "fullLoad"
36
+ };
37
+ var PerformanceUtils = {
38
+ mark(marker) {
39
+ performance.mark(marker);
40
+ },
41
+ frame(timestamp) {
42
+ const currTimestamp = timestamp;
43
+ if (lastFrameTime != null) {
44
+ const frameTime = currTimestamp - lastFrameTime;
45
+ frameTimes.push(frameTime);
46
+ }
47
+ lastFrameTime = currTimestamp;
48
+ },
49
+ clearMetrics() {
50
+ lastFrameTime = null;
51
+ frameTimes = [];
52
+ performance.clearMeasures("loadTime");
53
+ performance.clearMeasures("fullLoadTime");
54
+ for (const marker in PerformanceMarkers) {
55
+ performance.clearMarks(PerformanceMarkers[marker]);
56
+ }
57
+ },
58
+ getPerformanceMetrics() {
59
+ const loadTime = performance.measure("loadTime", PerformanceMarkers.create, PerformanceMarkers.load).duration;
60
+ const fullLoadTime = performance.measure("fullLoadTime", PerformanceMarkers.create, PerformanceMarkers.fullLoad).duration;
61
+ const totalFrames = frameTimes.length;
62
+ const avgFrameTime = frameTimes.reduce((prev, curr) => prev + curr, 0) / totalFrames / 1e3;
63
+ const fps = 1 / avgFrameTime;
64
+ const droppedFrames = frameTimes.filter((frameTime) => frameTime > frameTimeTarget).reduce((acc, curr) => {
65
+ return acc + (curr - frameTimeTarget) / frameTimeTarget;
66
+ }, 0);
67
+ const percentDroppedFrames = droppedFrames / (totalFrames + droppedFrames) * 100;
68
+ return {
69
+ loadTime,
70
+ fullLoadTime,
71
+ fps,
72
+ percentDroppedFrames
73
+ };
74
+ }
75
+ };
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ PerformanceMarkers,
79
+ PerformanceUtils
80
+ });
@@ -0,0 +1,63 @@
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/utils/primitives.ts
20
+ var primitives_exports = {};
21
+ __export(primitives_exports, {
22
+ default: () => Frustum
23
+ });
24
+ module.exports = __toCommonJS(primitives_exports);
25
+ var import_gl_matrix = require("gl-matrix");
26
+ var Frustum = class {
27
+ static fromInvProjectionMatrix(invProj, worldSize, zoom) {
28
+ const clipSpaceCorners = [
29
+ [-1, 1, -1, 1],
30
+ [1, 1, -1, 1],
31
+ [1, -1, -1, 1],
32
+ [-1, -1, -1, 1],
33
+ [-1, 1, 1, 1],
34
+ [1, 1, 1, 1],
35
+ [1, -1, 1, 1],
36
+ [-1, -1, 1, 1]
37
+ ];
38
+ const scale = Math.pow(2, zoom);
39
+ const frustumCoords = clipSpaceCorners.map((v) => import_gl_matrix.vec4.transformMat4(new Float32Array([]), v, invProj)).map((v) => import_gl_matrix.vec4.scale(new Float32Array([]), v, 1 / v[3] / worldSize * scale));
40
+ const frustumPlanePointIndices = [
41
+ [0, 1, 2],
42
+ [6, 5, 4],
43
+ [0, 3, 7],
44
+ [2, 1, 5],
45
+ [3, 2, 6],
46
+ [0, 4, 5]
47
+ ];
48
+ const frustumPlanes = frustumPlanePointIndices.map((p) => {
49
+ const a = import_gl_matrix.vec3.sub(new Float32Array(3), new Float32Array(frustumCoords[p[0]]), new Float32Array(frustumCoords[p[1]]));
50
+ const b = import_gl_matrix.vec3.sub(new Float32Array(3), new Float32Array(frustumCoords[p[2]]), new Float32Array(frustumCoords[p[1]]));
51
+ const n = import_gl_matrix.vec3.normalize(new Float32Array(3), import_gl_matrix.vec3.cross(new Float32Array(3), a, b));
52
+ const d = -import_gl_matrix.vec3.dot(n, new Float32Array(frustumCoords[p[1]]));
53
+ return n.concat(d);
54
+ });
55
+ return new Frustum(frustumCoords, frustumPlanes);
56
+ }
57
+ constructor(points, planes) {
58
+ this.points = points;
59
+ this.planes = planes;
60
+ }
61
+ };
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {});
@@ -0,0 +1,72 @@
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/utils/task_queue.ts
20
+ var task_queue_exports = {};
21
+ __export(task_queue_exports, {
22
+ default: () => task_queue_default
23
+ });
24
+ module.exports = __toCommonJS(task_queue_exports);
25
+ var TaskQueue = class {
26
+ constructor() {
27
+ this.queue = [];
28
+ this.id = 0;
29
+ this.cleared = false;
30
+ this.currentlyRunning = false;
31
+ }
32
+ add(callback) {
33
+ const id = ++this.id;
34
+ const queue = this.queue;
35
+ queue.push({ callback, id, cancelled: false });
36
+ return id;
37
+ }
38
+ remove(id) {
39
+ const running = this.currentlyRunning;
40
+ const queue = running ? this.queue.concat(running) : this.queue;
41
+ for (const task of queue) {
42
+ if (task.id === id) {
43
+ task.cancelled = true;
44
+ return;
45
+ }
46
+ }
47
+ }
48
+ run(timeStamp = 0) {
49
+ const queue = this.currentlyRunning = this.queue;
50
+ this.queue = [];
51
+ for (const task of queue) {
52
+ if (task.cancelled) {
53
+ continue;
54
+ }
55
+ task.callback(timeStamp);
56
+ if (this.cleared) {
57
+ break;
58
+ }
59
+ }
60
+ this.cleared = false;
61
+ this.currentlyRunning = false;
62
+ }
63
+ clear() {
64
+ if (this.currentlyRunning) {
65
+ this.cleared = true;
66
+ }
67
+ this.queue = [];
68
+ }
69
+ };
70
+ var task_queue_default = TaskQueue;
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-map",
3
- "version": "2.9.32-alpha.2",
3
+ "version": "2.9.33",
4
4
  "description": "l7 map",
5
5
  "keywords": [],
6
6
  "author": "thinkinggis <lzx199065@gmail.com>",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/antvis/L7#readme",
41
41
  "dependencies": {
42
- "@antv/l7-utils": "2.9.32-alpha.2",
42
+ "@antv/l7-utils": "2.9.33",
43
43
  "@babel/runtime": "^7.7.7",
44
44
  "@mapbox/point-geometry": "^0.1.0",
45
45
  "@mapbox/unitbezier": "^0.0.0",
@@ -47,5 +47,5 @@
47
47
  "gl-matrix": "^3.1.0",
48
48
  "lodash": "^4.17.15"
49
49
  },
50
- "gitHead": "16555be9682edaeeabec85082fc8c9e49fefabc0"
50
+ "gitHead": "87c41d6197d0cb14993201968be0378af6429164"
51
51
  }