@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.
- package/es/camera.d.ts +84 -0
- package/es/camera.js +765 -0
- package/es/css/l7.css +98 -0
- package/es/earthmap.d.ts +66 -0
- package/es/earthmap.js +421 -0
- package/es/geo/edge_insets.d.ts +54 -0
- package/es/geo/edge_insets.js +118 -0
- package/es/geo/lng_lat.d.ts +18 -0
- package/es/geo/lng_lat.js +81 -0
- package/es/geo/lng_lat_bounds.d.ts +24 -0
- package/es/geo/lng_lat_bounds.js +167 -0
- package/es/geo/mercator.d.ts +28 -0
- package/es/geo/mercator.js +91 -0
- package/es/geo/point.d.ts +40 -0
- package/es/geo/point.js +231 -0
- package/es/geo/simple.d.ts +28 -0
- package/es/geo/simple.js +90 -0
- package/es/geo/transform.d.ts +198 -0
- package/es/geo/transform.js +971 -0
- package/es/handler/IHandler.d.ts +34 -0
- package/es/handler/IHandler.js +1 -0
- package/es/handler/blockable_map_event.d.ts +17 -0
- package/es/handler/blockable_map_event.js +83 -0
- package/es/handler/box_zoom.d.ts +59 -0
- package/es/handler/box_zoom.js +200 -0
- package/es/handler/click_zoom.d.ts +16 -0
- package/es/handler/click_zoom.js +59 -0
- package/es/handler/events/event.d.ts +4 -0
- package/es/handler/events/event.js +12 -0
- package/es/handler/events/index.d.ts +4 -0
- package/es/handler/events/index.js +4 -0
- package/es/handler/events/map_mouse_event.d.ts +34 -0
- package/es/handler/events/map_mouse_event.js +75 -0
- package/es/handler/events/map_touch_event.d.ts +57 -0
- package/es/handler/events/map_touch_event.js +105 -0
- package/es/handler/events/map_wheel_event.d.ts +33 -0
- package/es/handler/events/map_wheel_event.js +61 -0
- package/es/handler/events/render_event.d.ts +5 -0
- package/es/handler/events/render_event.js +39 -0
- package/es/handler/handler_inertia.d.ts +23 -0
- package/es/handler/handler_inertia.js +184 -0
- package/es/handler/handler_manager.d.ts +61 -0
- package/es/handler/handler_manager.js +684 -0
- package/es/handler/handler_util.d.ts +4 -0
- package/es/handler/handler_util.js +10 -0
- package/es/handler/keyboard.d.ts +36 -0
- package/es/handler/keyboard.js +162 -0
- package/es/handler/map_event.d.ts +29 -0
- package/es/handler/map_event.js +131 -0
- package/es/handler/mouse/index.d.ts +4 -0
- package/es/handler/mouse/index.js +4 -0
- package/es/handler/mouse/mouse_handler.d.ts +22 -0
- package/es/handler/mouse/mouse_handler.js +129 -0
- package/es/handler/mouse/mousepan_handler.d.ts +10 -0
- package/es/handler/mouse/mousepan_handler.js +54 -0
- package/es/handler/mouse/mousepitch_hander.d.ts +9 -0
- package/es/handler/mouse/mousepitch_hander.js +56 -0
- package/es/handler/mouse/mouserotate_hander.d.ts +9 -0
- package/es/handler/mouse/mouserotate_hander.js +56 -0
- package/es/handler/mouse/util.d.ts +6 -0
- package/es/handler/mouse/util.js +12 -0
- package/es/handler/scroll_zoom.d.ts +93 -0
- package/es/handler/scroll_zoom.js +353 -0
- package/es/handler/shim/dblclick_zoom.d.ts +40 -0
- package/es/handler/shim/dblclick_zoom.js +72 -0
- package/es/handler/shim/drag_pan.d.ts +61 -0
- package/es/handler/shim/drag_pan.js +96 -0
- package/es/handler/shim/drag_rotate.d.ts +46 -0
- package/es/handler/shim/drag_rotate.js +80 -0
- package/es/handler/shim/touch_zoom_rotate.d.ts +70 -0
- package/es/handler/shim/touch_zoom_rotate.js +130 -0
- package/es/handler/tap/single_tap_recognizer.d.ts +20 -0
- package/es/handler/tap/single_tap_recognizer.js +120 -0
- package/es/handler/tap/tap_drag_zoom.d.ts +22 -0
- package/es/handler/tap/tap_drag_zoom.js +114 -0
- package/es/handler/tap/tap_recognizer.d.ts +17 -0
- package/es/handler/tap/tap_recognizer.js +62 -0
- package/es/handler/tap/tap_zoom.d.ts +22 -0
- package/es/handler/tap/tap_zoom.js +115 -0
- package/es/handler/touch/index.d.ts +5 -0
- package/es/handler/touch/index.js +5 -0
- package/es/handler/touch/touch_pan.d.ts +30 -0
- package/es/handler/touch/touch_pan.js +128 -0
- package/es/handler/touch/touch_pitch.d.ts +13 -0
- package/es/handler/touch/touch_pitch.js +110 -0
- package/es/handler/touch/touch_rotate.d.ts +12 -0
- package/es/handler/touch/touch_rotate.js +88 -0
- package/es/handler/touch/touch_zoom.d.ts +12 -0
- package/es/handler/touch/touch_zoom.js +67 -0
- package/es/handler/touch/two_touch.d.ts +23 -0
- package/es/handler/touch/two_touch.js +134 -0
- package/es/hash.d.ts +14 -0
- package/es/hash.js +156 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/interface.d.ts +34 -0
- package/es/interface.js +1 -0
- package/es/map.d.ts +70 -0
- package/es/map.js +463 -0
- package/es/util.d.ts +18 -0
- package/es/util.js +84 -0
- package/es/utils/Aabb.d.ts +12 -0
- package/es/utils/Aabb.js +133 -0
- package/es/utils/dom.d.ts +4 -0
- package/es/utils/dom.js +218 -0
- package/es/utils/performance.d.ts +17 -0
- package/es/utils/performance.js +62 -0
- package/es/utils/primitives.d.ts +6 -0
- package/es/utils/primitives.js +45 -0
- package/es/utils/task_queue.d.ts +13 -0
- package/es/utils/task_queue.js +106 -0
- package/lib/camera.js +533 -0
- package/lib/css/l7.css +98 -0
- package/lib/earthmap.js +278 -0
- package/lib/geo/edge_insets.js +76 -0
- package/lib/geo/lng_lat.js +73 -0
- package/lib/geo/lng_lat_bounds.js +138 -0
- package/lib/geo/mercator.js +91 -0
- package/lib/geo/point.js +176 -0
- package/lib/geo/simple.js +87 -0
- package/lib/geo/transform.js +503 -0
- package/lib/handler/IHandler.js +17 -0
- package/lib/handler/blockable_map_event.js +71 -0
- package/lib/handler/box_zoom.js +139 -0
- package/lib/handler/click_zoom.js +59 -0
- package/lib/handler/events/event.js +38 -0
- package/lib/handler/events/index.js +38 -0
- package/lib/handler/events/map_mouse_event.js +44 -0
- package/lib/handler/events/map_touch_event.js +48 -0
- package/lib/handler/events/map_wheel_event.js +36 -0
- package/lib/handler/events/render_event.js +33 -0
- package/lib/handler/handler_inertia.js +149 -0
- package/lib/handler/handler_manager.js +455 -0
- package/lib/handler/handler_util.js +35 -0
- package/lib/handler/keyboard.js +131 -0
- package/lib/handler/map_event.js +91 -0
- package/lib/handler/mouse/index.js +38 -0
- package/lib/handler/mouse/mouse_handler.js +103 -0
- package/lib/handler/mouse/mousepan_handler.js +48 -0
- package/lib/handler/mouse/mousepitch_hander.js +47 -0
- package/lib/handler/mouse/mouserotate_hander.js +47 -0
- package/lib/handler/mouse/util.js +44 -0
- package/lib/handler/scroll_zoom.js +225 -0
- package/lib/handler/shim/dblclick_zoom.js +46 -0
- package/lib/handler/shim/drag_pan.js +55 -0
- package/lib/handler/shim/drag_rotate.js +49 -0
- package/lib/handler/shim/touch_zoom_rotate.js +71 -0
- package/lib/handler/tap/single_tap_recognizer.js +102 -0
- package/lib/handler/tap/tap_drag_zoom.js +106 -0
- package/lib/handler/tap/tap_recognizer.js +66 -0
- package/lib/handler/tap/tap_zoom.js +99 -0
- package/lib/handler/touch/index.js +41 -0
- package/lib/handler/touch/touch_pan.js +110 -0
- package/lib/handler/touch/touch_pitch.js +86 -0
- package/lib/handler/touch/touch_rotate.js +65 -0
- package/lib/handler/touch/touch_zoom.js +56 -0
- package/lib/handler/touch/two_touch.js +105 -0
- package/lib/hash.js +120 -0
- package/lib/index.js +21 -0
- package/lib/interface.js +17 -0
- package/lib/map.js +308 -0
- package/lib/util.js +97 -0
- package/lib/utils/Aabb.js +90 -0
- package/lib/utils/dom.js +159 -0
- package/lib/utils/performance.js +80 -0
- package/lib/utils/primitives.js +63 -0
- package/lib/utils/task_queue.js +72 -0
- package/package.json +3 -3
package/lib/geo/point.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
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/geo/point.ts
|
|
20
|
+
var point_exports = {};
|
|
21
|
+
__export(point_exports, {
|
|
22
|
+
default: () => Point
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(point_exports);
|
|
25
|
+
var Point = class {
|
|
26
|
+
static convert(a) {
|
|
27
|
+
if (a instanceof Point) {
|
|
28
|
+
return a;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(a)) {
|
|
31
|
+
return new Point(a[0], a[1]);
|
|
32
|
+
}
|
|
33
|
+
return a;
|
|
34
|
+
}
|
|
35
|
+
constructor(x, y) {
|
|
36
|
+
this.x = x;
|
|
37
|
+
this.y = y;
|
|
38
|
+
}
|
|
39
|
+
clone() {
|
|
40
|
+
return new Point(this.x, this.y);
|
|
41
|
+
}
|
|
42
|
+
_add(p) {
|
|
43
|
+
this.x += p.x;
|
|
44
|
+
this.y += p.y;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
add(p) {
|
|
48
|
+
return this.clone()._add(p);
|
|
49
|
+
}
|
|
50
|
+
_sub(p) {
|
|
51
|
+
this.x -= p.x;
|
|
52
|
+
this.y -= p.y;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
sub(p) {
|
|
56
|
+
return this.clone()._sub(p);
|
|
57
|
+
}
|
|
58
|
+
_multByPoint(p) {
|
|
59
|
+
this.x *= p.x;
|
|
60
|
+
this.y *= p.y;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
multByPoint(p) {
|
|
64
|
+
return this.clone()._multByPoint(p);
|
|
65
|
+
}
|
|
66
|
+
_divByPoint(p) {
|
|
67
|
+
this.x /= p.x;
|
|
68
|
+
this.y /= p.y;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
divByPoint(p) {
|
|
72
|
+
return this.clone()._divByPoint(p);
|
|
73
|
+
}
|
|
74
|
+
_mult(k) {
|
|
75
|
+
this.x *= k;
|
|
76
|
+
this.y *= k;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
mult(k) {
|
|
80
|
+
return this.clone()._mult(k);
|
|
81
|
+
}
|
|
82
|
+
_div(k) {
|
|
83
|
+
this.x /= k;
|
|
84
|
+
this.y /= k;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
div(k) {
|
|
88
|
+
return this.clone()._div(k);
|
|
89
|
+
}
|
|
90
|
+
_rotate(angle) {
|
|
91
|
+
const cos = Math.cos(angle);
|
|
92
|
+
const sin = Math.sin(angle);
|
|
93
|
+
const x = cos * this.x - sin * this.y;
|
|
94
|
+
const y = sin * this.x + cos * this.y;
|
|
95
|
+
this.x = x;
|
|
96
|
+
this.y = y;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
rotate(angle) {
|
|
100
|
+
return this.clone()._rotate(angle);
|
|
101
|
+
}
|
|
102
|
+
_rotateAround(angle, p) {
|
|
103
|
+
const cos = Math.cos(angle);
|
|
104
|
+
const sin = Math.sin(angle);
|
|
105
|
+
const x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y);
|
|
106
|
+
const y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
|
|
107
|
+
this.x = x;
|
|
108
|
+
this.y = y;
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
roateAround(angle, p) {
|
|
112
|
+
return this.clone()._rotateAround(angle, p);
|
|
113
|
+
}
|
|
114
|
+
_matMult(m) {
|
|
115
|
+
const x = m[0] * this.x + m[1] * this.y;
|
|
116
|
+
const y = m[2] * this.x + m[3] * this.y;
|
|
117
|
+
this.x = x;
|
|
118
|
+
this.y = y;
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
matMult(m) {
|
|
122
|
+
return this.clone()._matMult(m);
|
|
123
|
+
}
|
|
124
|
+
_unit() {
|
|
125
|
+
this.div(this.mag());
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
unit() {
|
|
129
|
+
return this.clone()._unit();
|
|
130
|
+
}
|
|
131
|
+
_perp() {
|
|
132
|
+
const y = this.y;
|
|
133
|
+
this.y = this.x;
|
|
134
|
+
this.x = -y;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
perp() {
|
|
138
|
+
return this.clone()._perp();
|
|
139
|
+
}
|
|
140
|
+
_round() {
|
|
141
|
+
this.x = Math.round(this.x);
|
|
142
|
+
this.y = Math.round(this.y);
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
round() {
|
|
146
|
+
return this.clone()._round();
|
|
147
|
+
}
|
|
148
|
+
mag() {
|
|
149
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
150
|
+
}
|
|
151
|
+
equals(other) {
|
|
152
|
+
return this.x === other.x && this.y === other.y;
|
|
153
|
+
}
|
|
154
|
+
dist(p) {
|
|
155
|
+
return Math.sqrt(this.distSqr(p));
|
|
156
|
+
}
|
|
157
|
+
distSqr(p) {
|
|
158
|
+
const dx = p.x - this.x;
|
|
159
|
+
const dy = p.y - this.y;
|
|
160
|
+
return dx * dx + dy * dy;
|
|
161
|
+
}
|
|
162
|
+
angle() {
|
|
163
|
+
return Math.atan2(this.y, this.x);
|
|
164
|
+
}
|
|
165
|
+
angleTo(b) {
|
|
166
|
+
return Math.atan2(this.y - b.y, this.x - b.x);
|
|
167
|
+
}
|
|
168
|
+
angleWith(b) {
|
|
169
|
+
return this.angleWithSep(b.x, b.y);
|
|
170
|
+
}
|
|
171
|
+
angleWithSep(x, y) {
|
|
172
|
+
return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
176
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,87 @@
|
|
|
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/geo/simple.ts
|
|
23
|
+
var simple_exports = {};
|
|
24
|
+
__export(simple_exports, {
|
|
25
|
+
altitudeFromMercatorZ: () => altitudeFromMercatorZ,
|
|
26
|
+
default: () => SimpleCoordinate,
|
|
27
|
+
latFromMercatorY: () => latFromMercatorY,
|
|
28
|
+
lngFromMercatorX: () => lngFromMercatorX,
|
|
29
|
+
mercatorScale: () => mercatorScale,
|
|
30
|
+
mercatorXfromLng: () => mercatorXfromLng,
|
|
31
|
+
mercatorYfromLat: () => mercatorYfromLat,
|
|
32
|
+
mercatorZfromAltitude: () => mercatorZfromAltitude
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(simple_exports);
|
|
35
|
+
var import_lng_lat = __toESM(require("../geo/lng_lat"));
|
|
36
|
+
var earthCircumfrence = 2 * Math.PI * import_lng_lat.earthRadius;
|
|
37
|
+
function mercatorXfromLng(lng) {
|
|
38
|
+
return lng;
|
|
39
|
+
}
|
|
40
|
+
function mercatorYfromLat(lat) {
|
|
41
|
+
return lat;
|
|
42
|
+
}
|
|
43
|
+
function mercatorZfromAltitude(altitude, lat) {
|
|
44
|
+
return altitude;
|
|
45
|
+
}
|
|
46
|
+
function lngFromMercatorX(x) {
|
|
47
|
+
return x;
|
|
48
|
+
}
|
|
49
|
+
function latFromMercatorY(y) {
|
|
50
|
+
return y;
|
|
51
|
+
}
|
|
52
|
+
function altitudeFromMercatorZ(z, y) {
|
|
53
|
+
return z;
|
|
54
|
+
}
|
|
55
|
+
function mercatorScale(lat) {
|
|
56
|
+
return 1;
|
|
57
|
+
}
|
|
58
|
+
var SimpleCoordinate = class {
|
|
59
|
+
static fromLngLat(lngLatLike, altitude = 0) {
|
|
60
|
+
const lngLat = import_lng_lat.default.convert(lngLatLike);
|
|
61
|
+
return new SimpleCoordinate(mercatorXfromLng(lngLat.lng), mercatorYfromLat(lngLat.lat), mercatorZfromAltitude(altitude, lngLat.lat));
|
|
62
|
+
}
|
|
63
|
+
constructor(x, y, z = 0) {
|
|
64
|
+
this.x = +x;
|
|
65
|
+
this.y = +y;
|
|
66
|
+
this.z = +z;
|
|
67
|
+
}
|
|
68
|
+
toLngLat() {
|
|
69
|
+
return new import_lng_lat.default(this.x, this.y);
|
|
70
|
+
}
|
|
71
|
+
toAltitude() {
|
|
72
|
+
return this.z;
|
|
73
|
+
}
|
|
74
|
+
meterInMercatorCoordinateUnits() {
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
altitudeFromMercatorZ,
|
|
81
|
+
latFromMercatorY,
|
|
82
|
+
lngFromMercatorX,
|
|
83
|
+
mercatorScale,
|
|
84
|
+
mercatorXfromLng,
|
|
85
|
+
mercatorYfromLat,
|
|
86
|
+
mercatorZfromAltitude
|
|
87
|
+
});
|