bluestar-maplibre 1.1.7 → 1.1.9
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/dist/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var wn = Object.defineProperty;
|
|
2
|
+
var pr = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var g = (r, e, t) =>
|
|
7
|
-
var a = (r, e, t) => (
|
|
8
|
-
var
|
|
5
|
+
var Ln = (r, e, t) => e in r ? wn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var g = (r, e, t) => Ln(r, typeof e != "symbol" ? e + "" : e, t), Ft = (r, e, t) => e.has(r) || pr("Cannot " + t);
|
|
7
|
+
var a = (r, e, t) => (Ft(r, e, "read from private field"), t ? t.call(r) : e.get(r)), E = (r, e, t) => e.has(r) ? pr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), x = (r, e, t, n) => (Ft(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), S = (r, e, t) => (Ft(r, e, "access private method"), t);
|
|
8
|
+
var Pt = (r, e, t, n) => ({
|
|
9
9
|
set _(o) {
|
|
10
|
-
|
|
10
|
+
x(r, e, o, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return a(r, e, n);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { reactive as
|
|
17
|
-
import { addSourceType as
|
|
18
|
-
import { v4 as
|
|
19
|
-
import { Color as
|
|
20
|
-
const
|
|
16
|
+
import { reactive as Ne, watch as P, provide as Sn, onMounted as lr, onUnmounted as _n, inject as kn, defineComponent as $e, getCurrentInstance as Mn, onBeforeUnmount as Dt, openBlock as Z, createElementBlock as G, normalizeClass as pe, normalizeStyle as tt, renderSlot as Zt, Fragment as xe, renderList as Ge, computed as mr, shallowRef as Vn, unref as Wt, withModifiers as Bn, createCommentVNode as be, ref as le, toRaw as vr, createElementVNode as y, createTextVNode as qe, toDisplayString as ce, withDirectives as ke, vModelText as et, withKeys as zt, createVNode as Kt, Transition as Dn, withCtx as Yr, useModel as Zn, createBlock as Fr, createStaticVNode as Gn, vModelDynamic as Nn, vModelSelect as Yn } from "vue";
|
|
17
|
+
import { addSourceType as Pr, Evented as Xr, Event as Wr, Map as Fn, addProtocol as Pn, removeProtocol as Xn } from "maplibre-gl";
|
|
18
|
+
import { v4 as At } from "uuid";
|
|
19
|
+
import { Color as pt, EventListenControl as Wn, createUseApiInterceptor as zr, fontSize as Ot, decodeWegFile as yr, encodeGzip as zn, WebGLTool as Kn } from "bluestar-util";
|
|
20
|
+
const On = 8, Hn = "Mapbox Standard", Un = [
|
|
21
21
|
-10,
|
|
22
22
|
30
|
|
23
|
-
],
|
|
23
|
+
], Qn = 1.5, jn = 0, Jn = 0, $n = {}, qn = {
|
|
24
24
|
name: "globe"
|
|
25
|
-
},
|
|
26
|
-
version:
|
|
27
|
-
name:
|
|
28
|
-
center:
|
|
29
|
-
zoom:
|
|
30
|
-
bearing:
|
|
31
|
-
pitch:
|
|
32
|
-
sources:
|
|
33
|
-
projection:
|
|
34
|
-
layers:
|
|
35
|
-
id:
|
|
36
|
-
owner:
|
|
37
|
-
visibility:
|
|
25
|
+
}, eo = [], to = "standard", ro = "mapbox", no = "public", oo = !1, ao = {
|
|
26
|
+
version: On,
|
|
27
|
+
name: Hn,
|
|
28
|
+
center: Un,
|
|
29
|
+
zoom: Qn,
|
|
30
|
+
bearing: jn,
|
|
31
|
+
pitch: Jn,
|
|
32
|
+
sources: $n,
|
|
33
|
+
projection: qn,
|
|
34
|
+
layers: eo,
|
|
35
|
+
id: to,
|
|
36
|
+
owner: ro,
|
|
37
|
+
visibility: no,
|
|
38
38
|
protected: !0,
|
|
39
|
-
draft:
|
|
39
|
+
draft: oo
|
|
40
40
|
};
|
|
41
|
-
var
|
|
41
|
+
var H = /* @__PURE__ */ (() => {
|
|
42
42
|
for (var r = new Uint8Array(128), e = 0; e < 64; e++) r[e < 26 ? e + 65 : e < 52 ? e + 71 : e < 62 ? e - 4 : e * 4 - 205] = e;
|
|
43
43
|
return (t) => {
|
|
44
44
|
for (var n = t.length, o = new Uint8Array((n - (t[n - 1] == "=") - (t[n - 2] == "=")) * 3 / 4 | 0), i = 0, s = 0; i < n; ) {
|
|
@@ -48,29 +48,29 @@ var O = /* @__PURE__ */ (() => {
|
|
|
48
48
|
return o;
|
|
49
49
|
};
|
|
50
50
|
})();
|
|
51
|
-
function
|
|
51
|
+
function Kr(r, e) {
|
|
52
52
|
const t = Array.isArray(r) ? r[0] : r, n = Array.isArray(e) ? e[0] : e;
|
|
53
53
|
return t.lon[0] === n.lon[0] && t.lon[1] === n.lon[1] && t.lat[0] === n.lat[0] && t.lat[1] === n.lat[1];
|
|
54
54
|
}
|
|
55
|
-
var
|
|
55
|
+
var nt, ne, ue, Xe, yt, Sr, io = (Sr = class extends Xr {
|
|
56
56
|
constructor(e, t, n, o) {
|
|
57
57
|
super();
|
|
58
|
-
|
|
58
|
+
E(this, Xe);
|
|
59
59
|
g(this, "id");
|
|
60
60
|
g(this, "maxzoom", 0);
|
|
61
61
|
g(this, "minzoom", 22);
|
|
62
62
|
g(this, "tileSize", 512);
|
|
63
63
|
g(this, "type");
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.id = e, this.type = t.type,
|
|
64
|
+
E(this, nt);
|
|
65
|
+
E(this, ne, null);
|
|
66
|
+
E(this, ue);
|
|
67
|
+
this.id = e, this.type = t.type, x(this, ue, /* @__PURE__ */ new WeakMap());
|
|
68
68
|
}
|
|
69
69
|
setData(e) {
|
|
70
|
-
return a(this,
|
|
70
|
+
return a(this, ne) === e ? this : (a(this, ne) && !a(this, ue).has(a(this, ne)) && S(this, Xe, yt).call(this, a(this, ne)), x(this, ne, e), this.fire(new Wr("data", { dataType: "source", data: e })), this);
|
|
71
71
|
}
|
|
72
72
|
lastData() {
|
|
73
|
-
return a(this,
|
|
73
|
+
return a(this, ne);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* @internal
|
|
@@ -83,19 +83,19 @@ var rt, re, ue, Xe, vt, Lr, ao = (Lr = class extends Pr {
|
|
|
83
83
|
*/
|
|
84
84
|
unlink(e) {
|
|
85
85
|
const t = a(this, ue).get(e) - 1;
|
|
86
|
-
t > 0 ? a(this, ue).set(e, t) : (a(this, ue).delete(e), e !== a(this,
|
|
86
|
+
t > 0 ? a(this, ue).set(e, t) : (a(this, ue).delete(e), e !== a(this, ne) && S(this, Xe, yt).call(this, e));
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* @internal
|
|
90
90
|
*/
|
|
91
91
|
onAdd(e) {
|
|
92
|
-
|
|
92
|
+
x(this, nt, e.painter.context.gl);
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* @internal
|
|
96
96
|
*/
|
|
97
97
|
onRemove(e) {
|
|
98
|
-
a(this,
|
|
98
|
+
a(this, ne) && S(this, Xe, yt).call(this, a(this, ne)), x(this, ne, null);
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* @internal
|
|
@@ -119,62 +119,62 @@ var rt, re, ue, Xe, vt, Lr, ao = (Lr = class extends Pr {
|
|
|
119
119
|
*/
|
|
120
120
|
serialize() {
|
|
121
121
|
}
|
|
122
|
-
},
|
|
122
|
+
}, nt = new WeakMap(), ne = new WeakMap(), ue = new WeakMap(), Xe = new WeakSet(), yt = function(e) {
|
|
123
123
|
var o, i;
|
|
124
|
-
const t = a(this,
|
|
124
|
+
const t = a(this, nt), n = (o = e.texture) == null ? void 0 : o.get(t);
|
|
125
125
|
n !== void 0 && Object.values(n).forEach((s) => s.forEach((l) => t.deleteTexture(l))), (i = e.texture) == null || i.delete(t);
|
|
126
|
-
},
|
|
127
|
-
function
|
|
126
|
+
}, Sr);
|
|
127
|
+
function so({ x: r, y: e, z: t }, n) {
|
|
128
128
|
if (!n) return !0;
|
|
129
129
|
const [o, i] = xt([r, e, t]), [s, l] = xt([r + 1, e + 1, t]), u = Math.min(...n.lat), c = Math.max(...n.lat);
|
|
130
130
|
let [h, d] = n.lon;
|
|
131
131
|
return d > 180 && s <= 0 && (h -= 360, d -= 360), !(u > i || c < l || h > s || d < o);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
const l = 2 ** t, u = 120 / o / l, { x: c, y: h, lon: d, lat: p } = n, f = Math.abs((d[1] - d[0]) / (c - 1)), m = Math.abs((p[1] - p[0]) / (h - 1)), v = Math.ceil(u / f) * f,
|
|
133
|
+
function Or({ x: r, y: e, z: t }, n, o, i, s = 1) {
|
|
134
|
+
const l = 2 ** t, u = 120 / o / l, { x: c, y: h, lon: d, lat: p } = n, f = Math.abs((d[1] - d[0]) / (c - 1)), m = Math.abs((p[1] - p[0]) / (h - 1)), v = Math.ceil(u / f) * f, A = Math.ceil(u / m) * m;
|
|
135
135
|
let [R, C] = xt([r, e, t]), [b, B] = xt([r + 1, e + 1, t]);
|
|
136
|
-
if (R -= v * s, b += v * s, C = Math.min(C + v * s, 85), B = Math.max(B - v * s, -85), R = R - (R - d[0]) % v, C = C - (C - p[0]) %
|
|
136
|
+
if (R -= v * s, b += v * s, C = Math.min(C + v * s, 85), B = Math.max(B - v * s, -85), R = R - (R - d[0]) % v, C = C - (C - p[0]) % A, i) {
|
|
137
137
|
let [T, I] = i.lon;
|
|
138
138
|
I > 180 && b <= 0 && (T -= 360, I -= 360);
|
|
139
139
|
const w = (T - d[0]) % v;
|
|
140
140
|
R = Math.max(R, w === 0 ? T : T - w + v), b = Math.min(b, I);
|
|
141
141
|
let _ = Math.max(...i.lat);
|
|
142
|
-
const k = (_ - p[0]) %
|
|
143
|
-
C = Math.min(C, k === 0 ? _ : _ - k -
|
|
142
|
+
const k = (_ - p[0]) % A;
|
|
143
|
+
C = Math.min(C, k === 0 ? _ : _ - k - A), B = Math.max(B, Math.min(...i.lat));
|
|
144
144
|
}
|
|
145
145
|
const L = [];
|
|
146
146
|
for (let T = R; T <= b; T += v) L.push(T);
|
|
147
147
|
const M = [];
|
|
148
|
-
for (let T = C; T >= B; T -=
|
|
148
|
+
for (let T = C; T >= B; T -= A) M.push(T);
|
|
149
149
|
return [L, M];
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
const [o, i] =
|
|
151
|
+
function Hr(r, e, t, n) {
|
|
152
|
+
const [o, i] = Or(r, e, t, n), s = [];
|
|
153
153
|
for (const l of i)
|
|
154
154
|
for (const u of o)
|
|
155
155
|
s.push([u, l]);
|
|
156
156
|
return s;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return [
|
|
158
|
+
function Ur(r, [e, t]) {
|
|
159
|
+
return [Qr(r, e), jr(r, t)];
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return so(t) * 2 ** e - r;
|
|
163
|
-
}
|
|
164
|
-
function Qr({ y: r, z: e }, t) {
|
|
161
|
+
function Qr({ x: r, z: e }, t) {
|
|
165
162
|
return lo(t) * 2 ** e - r;
|
|
166
163
|
}
|
|
167
|
-
function
|
|
168
|
-
return (
|
|
164
|
+
function jr({ y: r, z: e }, t) {
|
|
165
|
+
return co(t) * 2 ** e - r;
|
|
169
166
|
}
|
|
170
167
|
function lo(r) {
|
|
168
|
+
return (180 + r) / 360;
|
|
169
|
+
}
|
|
170
|
+
function co(r) {
|
|
171
171
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360;
|
|
172
172
|
}
|
|
173
173
|
function xt([r, e, t]) {
|
|
174
174
|
const n = 2 ** t, o = r / n, i = e / n;
|
|
175
175
|
return [o * 360 - 180, 360 / Math.PI * Math.atan(Math.exp((180 - i * 360) * Math.PI / 180)) - 90];
|
|
176
176
|
}
|
|
177
|
-
var
|
|
177
|
+
var Jr = class {
|
|
178
178
|
constructor(r) {
|
|
179
179
|
g(this, "id");
|
|
180
180
|
g(this, "source");
|
|
@@ -182,17 +182,17 @@ var jr = class {
|
|
|
182
182
|
this.id = r.id, this.source = r.source;
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
|
-
function
|
|
185
|
+
function $r(r, e) {
|
|
186
186
|
if (!r || !e || r.length !== e.length) return !0;
|
|
187
187
|
for (let t = 0; t < r.length; t++) if (r[t] !== e[t]) return !0;
|
|
188
188
|
return !1;
|
|
189
189
|
}
|
|
190
|
-
var We,
|
|
190
|
+
var We, ot, de, Me, Ee, Ve, ze, me, Ke, Se, Ht, at, Et, Rt, Tt, Ut, _r, cr = (_r = class {
|
|
191
191
|
/**
|
|
192
192
|
* @internal
|
|
193
193
|
*/
|
|
194
194
|
constructor(r) {
|
|
195
|
-
|
|
195
|
+
E(this, Se);
|
|
196
196
|
g(this, "id");
|
|
197
197
|
g(this, "source");
|
|
198
198
|
g(this, "type", "raster");
|
|
@@ -203,19 +203,19 @@ var We, nt, de, Me, Ae, Ve, ze, me, He, Se, Kt, ot, Et, At, Rt, Ot, Sr, lr = (Sr
|
|
|
203
203
|
* @internal
|
|
204
204
|
*/
|
|
205
205
|
g(this, "paint", { "raster-fade-duration": 0 });
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
E(this, We);
|
|
207
|
+
E(this, ot);
|
|
208
|
+
E(this, de);
|
|
209
|
+
E(this, Me, 0);
|
|
210
|
+
E(this, Ee, 0);
|
|
211
|
+
E(this, Ve);
|
|
212
|
+
E(this, ze);
|
|
213
213
|
// current,next
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (!r.texture || r.updateTime < Math.max(a(this, Me), a(this,
|
|
218
|
-
const e = Date.now(), t = a(this, Ve) ?? a(this, de).transition, n = t > 0 ? Math.max(0, a(this,
|
|
214
|
+
E(this, me, null);
|
|
215
|
+
E(this, Ke, null);
|
|
216
|
+
E(this, at, async (r) => {
|
|
217
|
+
if (!r.texture || r.updateTime < Math.max(a(this, Me), a(this, Ee))) {
|
|
218
|
+
const e = Date.now(), t = a(this, Ve) ?? a(this, de).transition, n = t > 0 ? Math.max(0, a(this, Ee) - e) / t : 0, o = await this.loadTile(r.tileID.canonical, n);
|
|
219
219
|
if (r.aborted || !o) {
|
|
220
220
|
r.state = "unloaded";
|
|
221
221
|
return;
|
|
@@ -227,21 +227,21 @@ var We, nt, de, Me, Ae, Ve, ze, me, He, Se, Kt, ot, Et, At, Rt, Ot, Sr, lr = (Sr
|
|
|
227
227
|
let c = a(this, de).renderFactory.getTexture(l);
|
|
228
228
|
c ? u.bindTexture(u.TEXTURE_2D, c) : (c = u.createTexture(), u.bindTexture(u.TEXTURE_2D, c), u.texStorage2D(u.TEXTURE_2D, 1, u.RGBA8, i, s), u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.LINEAR_MIPMAP_LINEAR), u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MAG_FILTER, u.LINEAR), u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.CLAMP_TO_EDGE), u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.CLAMP_TO_EDGE)), r.texture = { bind: () => u.bindTexture(u.TEXTURE_2D, c), texture: c };
|
|
229
229
|
}
|
|
230
|
-
u.texSubImage2D(u.TEXTURE_2D, 0, 0, 0, i, s, u.RGBA, u.UNSIGNED_BYTE, o), o.close(), r.updateTime = e, r.state = "loaded", n > 0 && requestAnimationFrame(() => a(this,
|
|
230
|
+
u.texSubImage2D(u.TEXTURE_2D, 0, 0, 0, i, s, u.RGBA, u.UNSIGNED_BYTE, o), o.close(), r.updateTime = e, r.state = "loaded", n > 0 && requestAnimationFrame(() => a(this, at).call(this, r));
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
E(this, Et, async (r) => {
|
|
234
234
|
var e;
|
|
235
235
|
(e = r.texture) != null && e.texture && a(this, de).renderFactory.setTexture(this.tileSize * 2, r.texture.texture);
|
|
236
236
|
});
|
|
237
|
-
|
|
237
|
+
E(this, Rt, ({ canonical: r }) => a(this, me) ? so(r, a(this, ze)) : !1);
|
|
238
238
|
//
|
|
239
239
|
// /**
|
|
240
240
|
// * @internal
|
|
241
241
|
// */
|
|
242
242
|
// abstract hasTransition(): boolean;
|
|
243
|
-
|
|
244
|
-
this.id = r.id, this.minzoom = r.minzoom ?? 1, this.maxzoom = r.maxzoom ?? 22, this.tileSize = r.tileSize ?? 512,
|
|
243
|
+
E(this, Tt, () => !0);
|
|
244
|
+
this.id = r.id, this.minzoom = r.minzoom ?? 1, this.maxzoom = r.maxzoom ?? 22, this.tileSize = r.tileSize ?? 512, x(this, We, r.source), x(this, Ve, r.transition), x(this, ze, r.bound === void 0 ? null : r.bound), this.source = "#proxy-" + this.id;
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* @internal
|
|
@@ -253,23 +253,23 @@ var We, nt, de, Me, Ae, Ve, ze, me, He, Se, Kt, ot, Et, At, Rt, Ot, Sr, lr = (Sr
|
|
|
253
253
|
maxzoom: this.maxzoom,
|
|
254
254
|
tileSize: this.tileSize,
|
|
255
255
|
onAdd: (e) => this.onAdd(e),
|
|
256
|
-
hasTile: a(this,
|
|
257
|
-
loadTile: a(this,
|
|
256
|
+
hasTile: a(this, Rt),
|
|
257
|
+
loadTile: a(this, at),
|
|
258
258
|
unloadTile: a(this, Et),
|
|
259
|
-
hasTransition: a(this,
|
|
259
|
+
hasTransition: a(this, Tt),
|
|
260
260
|
loaded: () => !0
|
|
261
|
-
}),
|
|
261
|
+
}), x(this, ot, r.getSource(this.source));
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* @internal
|
|
265
265
|
*/
|
|
266
266
|
onAdd(r) {
|
|
267
|
-
|
|
267
|
+
x(this, de, r);
|
|
268
268
|
const e = r.getSource(a(this, We));
|
|
269
269
|
if (!e) throw new Error(`The source(id:${a(this, We)}) not found!`);
|
|
270
270
|
e.on("data", ({ data: t }) => {
|
|
271
|
-
S(this, Se,
|
|
272
|
-
}), S(this, Se,
|
|
271
|
+
S(this, Se, Ut).call(this, t), S(this, Se, Ht).call(this);
|
|
272
|
+
}), S(this, Se, Ut).call(this, e.lastData());
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* @internal
|
|
@@ -287,30 +287,30 @@ var We, nt, de, Me, Ae, Ve, ze, me, He, Se, Kt, ot, Et, At, Rt, Ot, Sr, lr = (Sr
|
|
|
287
287
|
* @internal
|
|
288
288
|
*/
|
|
289
289
|
get data1() {
|
|
290
|
-
return a(this,
|
|
290
|
+
return a(this, Ke);
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
293
293
|
* @internal
|
|
294
294
|
*/
|
|
295
295
|
setOptions({ transition: r, bound: e }) {
|
|
296
|
-
r !== void 0 &&
|
|
296
|
+
r !== void 0 && x(this, Ve, r), e !== void 0 && x(this, ze, e), x(this, Me, Date.now()), x(this, Ee, 0), S(this, Se, Ht).call(this);
|
|
297
297
|
}
|
|
298
|
-
}, We = new WeakMap(),
|
|
298
|
+
}, We = new WeakMap(), ot = new WeakMap(), de = new WeakMap(), Me = new WeakMap(), Ee = new WeakMap(), Ve = new WeakMap(), ze = new WeakMap(), me = new WeakMap(), Ke = new WeakMap(), Se = new WeakSet(), /**
|
|
299
299
|
* @internal
|
|
300
300
|
*/
|
|
301
|
-
|
|
302
|
-
a(this,
|
|
303
|
-
},
|
|
301
|
+
Ht = function() {
|
|
302
|
+
a(this, ot).fire({ type: "data", dataType: "source", sourceDataType: "content", sourceDataChanged: !0 });
|
|
303
|
+
}, at = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), Tt = new WeakMap(), Ut = function(r) {
|
|
304
304
|
if (!r) {
|
|
305
|
-
|
|
305
|
+
x(this, me, null), x(this, Ke, null);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
308
|
+
if (x(this, Me, Date.now()), a(this, me)) {
|
|
309
309
|
const e = a(this, Ve) ?? a(this, de).transition;
|
|
310
|
-
e > 0 && (
|
|
310
|
+
e > 0 && (Kr(a(this, me), r) ? (x(this, Ke, a(this, me)), x(this, Ee, a(this, Me) + e)) : x(this, Ee, 0));
|
|
311
311
|
}
|
|
312
|
-
|
|
313
|
-
},
|
|
312
|
+
x(this, me, r), a(this, de).triggerRepaint();
|
|
313
|
+
}, _r), uo = class extends Xr {
|
|
314
314
|
constructor(e, t, n, o) {
|
|
315
315
|
super();
|
|
316
316
|
g(this, "type", "raster");
|
|
@@ -328,13 +328,13 @@ Kt = function() {
|
|
|
328
328
|
g(this, "unloadTile");
|
|
329
329
|
g(this, "hasTransition");
|
|
330
330
|
g(this, "loaded");
|
|
331
|
-
this.id = e, this.setEventedParent(o), this.minzoom = t.minzoom, this.maxzoom = t.maxzoom, this.tileSize = t.tileSize, this.roundZoom = !0, this.loadTile = t.loadTile, this.loaded = t.loaded, this.hasTransition = t.hasTransition, this.onAdd = t.onAdd, this.onRemove = t.onRemove, this.prepare = t.prepare, this.hasTile = t.hasTile, this.abortTile = t.abortTile, this.unloadTile = t.unloadTile, this.fire(new
|
|
331
|
+
this.id = e, this.setEventedParent(o), this.minzoom = t.minzoom, this.maxzoom = t.maxzoom, this.tileSize = t.tileSize, this.roundZoom = !0, this.loadTile = t.loadTile, this.loaded = t.loaded, this.hasTransition = t.hasTransition, this.onAdd = t.onAdd, this.onRemove = t.onRemove, this.prepare = t.prepare, this.hasTile = t.hasTile, this.abortTile = t.abortTile, this.unloadTile = t.unloadTile, this.fire(new Wr("data", { dataType: "source", sourceDataType: "metadata" }));
|
|
332
332
|
}
|
|
333
333
|
serialize() {
|
|
334
334
|
return { id: this.id, type: "proxy" };
|
|
335
335
|
}
|
|
336
|
-
},
|
|
337
|
-
function
|
|
336
|
+
}, Xt = 128;
|
|
337
|
+
function ho(r, e, t, n) {
|
|
338
338
|
const o = r.createProgram();
|
|
339
339
|
if (r.attachShader(o, e), r.attachShader(o, t), n && r.transformFeedbackVaryings(o, n, r.SEPARATE_ATTRIBS), r.linkProgram(o), !r.getProgramParameter(o, r.LINK_STATUS))
|
|
340
340
|
throw new Error("Unable to initialize the shader program: " + r.getProgramInfoLog(o));
|
|
@@ -357,13 +357,13 @@ function uo(r, e, t, n) {
|
|
|
357
357
|
return h;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function ho(r, e) {
|
|
361
|
-
return $r(r, r.VERTEX_SHADER, e);
|
|
362
|
-
}
|
|
363
360
|
function fo(r, e) {
|
|
364
|
-
return
|
|
361
|
+
return qr(r, r.VERTEX_SHADER, e);
|
|
362
|
+
}
|
|
363
|
+
function po(r, e) {
|
|
364
|
+
return qr(r, r.FRAGMENT_SHADER, e);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function qr(r, e, t) {
|
|
367
367
|
const n = r.createShader(e);
|
|
368
368
|
if (r.shaderSource(n, t), r.compileShader(n), !r.getShaderParameter(n, r.COMPILE_STATUS)) {
|
|
369
369
|
const o = "An error occurred compiling the shaders: " + r.getShaderInfoLog(n);
|
|
@@ -371,14 +371,14 @@ function $r(r, e, t) {
|
|
|
371
371
|
}
|
|
372
372
|
return n;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Qt(r, e, t, n) {
|
|
375
375
|
const o = r.createVertexArray();
|
|
376
|
-
r.bindVertexArray(o),
|
|
376
|
+
r.bindVertexArray(o), vo(e, t), r.bindVertexArray(null);
|
|
377
377
|
const i = t.count, s = t.attribute.indices, l = s !== void 0, u = r.UNSIGNED_SHORT, c = l ? s.offset ?? 0 : 0;
|
|
378
378
|
return { gl: r, vao: o, count: i, mode: n, type: u, offset: c, indices: l };
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
const n =
|
|
380
|
+
function mo(r, { x: e, y: t } = { x: 64, y: 64 }) {
|
|
381
|
+
const n = Xt / e, o = Xt / t, i = e + 1, s = new Uint8Array(i * (t + 1) * 2), l = new Uint16Array((i * 2 + 1) * t);
|
|
382
382
|
let u = 0, c = 0;
|
|
383
383
|
for (let h = 0; h < t; h++) {
|
|
384
384
|
for (let d = 0; d <= e; d++) {
|
|
@@ -389,13 +389,13 @@ function po(r, { x: e, y: t } = { x: 64, y: 64 }) {
|
|
|
389
389
|
l[c++] = 65535;
|
|
390
390
|
}
|
|
391
391
|
for (let h = 0; h <= e; h++)
|
|
392
|
-
s[u++] = h * n, s[u++] =
|
|
393
|
-
return
|
|
392
|
+
s[u++] = h * n, s[u++] = Xt;
|
|
393
|
+
return ur(r, {
|
|
394
394
|
a_pos: { size: 2, data: s, type: r.UNSIGNED_BYTE },
|
|
395
395
|
indices: { size: 1, data: l, type: r.UNSIGNED_SHORT }
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function ur(r, e) {
|
|
399
399
|
const t = {}, n = e.indices;
|
|
400
400
|
if (n && n.data.byteLength / n.data.length !== 2)
|
|
401
401
|
throw new Error("The buffer data of indices must be Uint16Array!");
|
|
@@ -410,7 +410,7 @@ function cr(r, e) {
|
|
|
410
410
|
}
|
|
411
411
|
return n && (o = n.data.length), r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, null), r.bindBuffer(r.ARRAY_BUFFER, null), { gl: r, count: o, attribute: t };
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function gt(r, e) {
|
|
414
414
|
const { gl: t, uniform: n } = r;
|
|
415
415
|
let o = 0;
|
|
416
416
|
for (const i in n) {
|
|
@@ -492,7 +492,7 @@ function yt(r, e) {
|
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function vo(r, e) {
|
|
496
496
|
const { gl: t, attribute: n } = r, o = e.attribute, i = o.indices;
|
|
497
497
|
i && t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, i.buffer);
|
|
498
498
|
for (const s in n)
|
|
@@ -522,11 +522,11 @@ function mo(r, e) {
|
|
|
522
522
|
t.enableVertexAttribArray(u), m && t.vertexAttribDivisor && t.vertexAttribDivisor(u, m);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function jt(r) {
|
|
526
526
|
const { gl: e, vao: t, count: n, mode: o, type: i, offset: s, indices: l } = r;
|
|
527
527
|
e.bindVertexArray(t), l ? e.drawElements(o, n, i, s) : e.drawArrays(o, s, n), e.bindVertexArray(null);
|
|
528
528
|
}
|
|
529
|
-
var
|
|
529
|
+
var yo = H("I3ZlcnNpb24gMzAwIGVzDQo="), go = H("I3ZlcnNpb24gMzAwIGVzDQo="), bo = H("dW5pZm9ybSBmbG9hdCB1X29wYWNpdHk7DQp1bmlmb3JtIGhpZ2hwIHZlYzIgdV9kYXRhX2JvdW5kOw0KYm9vbCBpbnZhbGlkRGlzcGxheShjb25zdCBpbiBmbG9hdCB2YWwpIHsNCiAgICByZXR1cm4gaXNuYW4odmFsKSB8fCB2YWwgPCB1X2RhdGFfYm91bmQueCB8fCB2YWwgPiB1X2RhdGFfYm91bmQueTsNCn0NCg=="), Io = H("dW5pZm9ybSB2ZWM0IHVfYm91bmQ7DQpib29sIGludmFsaWRCb3VuZChjb25zdCBpbiB2ZWMyIHBvcykgew0KICAgIGJvb2wgYiA9IGJvb2wodV9ib3VuZC54ICE9IHVfYm91bmQueiAmJiB1X2JvdW5kLnkgIT0gdV9ib3VuZC53ICYmIChhbnkobGVzc1RoYW4ocG9zLCB1X2JvdW5kLnh5KSkgfHwgYW55KGdyZWF0ZXJUaGFuKHBvcywgdV9ib3VuZC56dykpKSk7DQogICAgaWYgKHVfYm91bmQueiA8PSBGMTgwKSByZXR1cm4gYjsNCiAgICB2ZWMyIHBvczM2MCA9IHZlYzIocG9zLnggKyBGMzYwLCBwb3MueSk7DQogICAgcmV0dXJuIGIgJiYgKGFueShsZXNzVGhhbihwb3MzNjAsIHVfYm91bmQueHkpKSB8fCBhbnkoZ3JlYXRlclRoYW4ocG9zMzYwLCB1X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NjAgPSAzNjAuOw0KY29uc3QgZmxvYXQgRjAgPSAwLjsNCmNvbnN0IGZsb2F0IEYxID0gMS47DQpjb25zdCBmbG9hdCBGXzEgPSAtMS47DQo="), Ro = H("dmVjMyBwcm9qZWN0aW9uR2xvYmUodmVjMyBwb3MpIHsNCiAgICBmbG9hdCB0aGV0YSA9ICgxLjUgLSAyLiAqIHBvcy54KSAqIFBJOw0KICAgIGZsb2F0IHBoaSA9IHBvcy55ICogUEk7DQogICAgZmxvYXQgbGVuID0gc2luKHBoaSk7DQogICAgcmV0dXJuIHZlYzMoY29zKHRoZXRhKSAqIGxlbiwgY29zKHBoaSksIHNpbih0aGV0YSkgKiBsZW4pICogcG9zLno7DQp9DQoNCnZlYzIgc2ltcGxlTG9uTGF0KHZlYzIgdXYpIHsNCiAgICByZXR1cm4gbWl4KHZlYzIoLUYxODAsIEY5MCksIHZlYzIoRjE4MCwgLUY5MCksIHV2KTsNCn0NCg0KdmVjMiBtZXJjYXRvclJldmVyc2UodmVjMiB1dikgew0KICAgIHZlYzIgcmUgPSBtaXgodmVjMigtRjE4MCksIHZlYzIoRjE4MCksIHV2KTsNCiAgICByZS55ID0gMTE0LjU5MTU1OTAyNjE2NDY1ICogYXRhbihleHAocmUueSAqIC0wLjAxNzQ1MzI5MjUxOTk0MzI5NSkpIC0gRjkwOw0KICAgIHJldHVybiByZTsNCn0NCg0KdmVjMiBtZXJjYXRvcih2ZWMyIGxsKSB7DQogICAgcmV0dXJuIHZlYzIoKEYxODAgKyBsbC54KSAvIEYzNjAsIChGMTgwIC0gKEYxODAgLyBQSSAqIGxvZyh0YW4oUEkgLyA0LiArIGxsLnkgKiBQSSAvIEYzNjApKSkpIC8gRjM2MCk7DQp9DQo="), To = `// src/xmap/layer/text/worker.ts
|
|
530
530
|
var TYPE_TEXT_TILE = "text-tile";
|
|
531
531
|
function textTile({ canvas: canvas2, data }) {
|
|
532
532
|
const { width, height } = canvas2;
|
|
@@ -963,7 +963,7 @@ function iso(xs, ys, data, interval) {
|
|
|
963
963
|
const max = Math.max(v0, v1);
|
|
964
964
|
if (array) {
|
|
965
965
|
for (const v of interval) {
|
|
966
|
-
const o =
|
|
966
|
+
const o = 10 ** (4 + (Math.abs(v) > 1e-9 ? ~~Math.log10(Math.abs(v) + 1e-9) : 0));
|
|
967
967
|
const ov = Math.round(o * v);
|
|
968
968
|
if (Math.round(o * min) < ov && ov <= Math.round(o * max)) {
|
|
969
969
|
const c = { x: x2, y: y2, z };
|
|
@@ -1040,31 +1040,31 @@ self.onmessage = (event) => {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
};
|
|
1043
|
-
`,
|
|
1044
|
-
function
|
|
1043
|
+
`, wo = { header_vertex: yo, header_fragment: go, use_mask: Ao, use_display: bo, use_bound: Io, use_color: Co, data_grid: xo, constant: Eo, projection: Ro };
|
|
1044
|
+
function gr(r, e) {
|
|
1045
1045
|
const t = typeof r == "string";
|
|
1046
1046
|
let n = t ? r : String.fromCharCode(...r);
|
|
1047
|
-
for (const [o, i] of Object.entries(
|
|
1047
|
+
for (const [o, i] of Object.entries(wo))
|
|
1048
1048
|
n = n.replaceAll(`#include <${o}>`, t ? i : String.fromCharCode(...i));
|
|
1049
1049
|
return e !== void 0 && (n = n.replaceAll("#include <define>", e)), n;
|
|
1050
1050
|
}
|
|
1051
|
-
var
|
|
1051
|
+
var wt, Lt, St, _t, kt, Be, Ie, it, Re, _e, en, So, st, Jt, kr, Lo = (kr = class {
|
|
1052
1052
|
constructor(r, e = 2) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1053
|
+
E(this, _e);
|
|
1054
|
+
E(this, wt, {});
|
|
1055
|
+
E(this, Lt, {});
|
|
1056
|
+
E(this, St, {});
|
|
1057
|
+
E(this, _t, {});
|
|
1058
|
+
E(this, kt, {});
|
|
1059
|
+
E(this, Be);
|
|
1060
|
+
E(this, Ie);
|
|
1061
|
+
E(this, it, 0);
|
|
1062
|
+
E(this, Re);
|
|
1063
|
+
E(this, st, /* @__PURE__ */ new Map());
|
|
1064
|
+
x(this, Be, r), r.getExtension("OES_texture_float_linear"), x(this, Re, /* @__PURE__ */ new Map()), x(this, Ie, S(this, _e, en).call(this, e));
|
|
1065
1065
|
}
|
|
1066
1066
|
vao(r, e) {
|
|
1067
|
-
const t = a(this,
|
|
1067
|
+
const t = a(this, wt);
|
|
1068
1068
|
if (!t[r]) {
|
|
1069
1069
|
if (!e) throw new Error("Can't supply the vao! The vao key: " + r);
|
|
1070
1070
|
t[r] = e();
|
|
@@ -1072,7 +1072,7 @@ var Tt, wt, Lt, St, _t, Be, Ie, at, Re, _e, qr, Lo, it, jt, _r, wo = (_r = class
|
|
|
1072
1072
|
return t[r];
|
|
1073
1073
|
}
|
|
1074
1074
|
buffer(r, e) {
|
|
1075
|
-
const t = a(this,
|
|
1075
|
+
const t = a(this, Lt);
|
|
1076
1076
|
if (!t[r]) {
|
|
1077
1077
|
if (!e) throw new Error("Can't supply the buffer! The buffer key: " + r);
|
|
1078
1078
|
t[r] = e();
|
|
@@ -1080,19 +1080,19 @@ var Tt, wt, Lt, St, _t, Be, Ie, at, Re, _e, qr, Lo, it, jt, _r, wo = (_r = class
|
|
|
1080
1080
|
return t[r];
|
|
1081
1081
|
}
|
|
1082
1082
|
vertex(r, e, t) {
|
|
1083
|
-
const n = a(this,
|
|
1084
|
-
return n[r] || (n[r] =
|
|
1083
|
+
const n = a(this, St);
|
|
1084
|
+
return n[r] || (n[r] = fo(a(this, Be), gr(e, t ? t() : void 0))), n[r];
|
|
1085
1085
|
}
|
|
1086
1086
|
fragment(r, e, t) {
|
|
1087
|
-
const n = a(this,
|
|
1088
|
-
return n[r] || (n[r] =
|
|
1087
|
+
const n = a(this, _t);
|
|
1088
|
+
return n[r] || (n[r] = po(a(this, Be), gr(e, t ? t() : void 0))), n[r];
|
|
1089
1089
|
}
|
|
1090
1090
|
program(r, e, t, n) {
|
|
1091
|
-
const o = a(this,
|
|
1092
|
-
return o[r] || (o[r] =
|
|
1091
|
+
const o = a(this, kt);
|
|
1092
|
+
return o[r] || (o[r] = ho(a(this, Be), e(), t(), n)), o[r];
|
|
1093
1093
|
}
|
|
1094
1094
|
exec(r, e, t) {
|
|
1095
|
-
const n =
|
|
1095
|
+
const n = Pt(this, it)._++ & 4095;
|
|
1096
1096
|
return new Promise((o) => {
|
|
1097
1097
|
a(this, Re).set(n, o), a(this, Ie)[n % a(this, Ie).length].postMessage({ key: n, type: r, data: e }, t);
|
|
1098
1098
|
});
|
|
@@ -1104,46 +1104,46 @@ var Tt, wt, Lt, St, _t, Be, Ie, at, Re, _e, qr, Lo, it, jt, _r, wo = (_r = class
|
|
|
1104
1104
|
return Promise.all(n);
|
|
1105
1105
|
}
|
|
1106
1106
|
getTexture(r) {
|
|
1107
|
-
return S(this, _e,
|
|
1107
|
+
return S(this, _e, Jt).call(this, r).pop();
|
|
1108
1108
|
}
|
|
1109
1109
|
setTexture(r, e) {
|
|
1110
|
-
S(this, _e,
|
|
1110
|
+
S(this, _e, Jt).call(this, r).push(e);
|
|
1111
1111
|
}
|
|
1112
|
-
},
|
|
1112
|
+
}, wt = new WeakMap(), Lt = new WeakMap(), St = new WeakMap(), _t = new WeakMap(), kt = new WeakMap(), Be = new WeakMap(), Ie = new WeakMap(), it = new WeakMap(), Re = new WeakMap(), _e = new WeakSet(), en = function(r) {
|
|
1113
1113
|
const e = [];
|
|
1114
1114
|
for (let t = 0; t < r; t++) {
|
|
1115
|
-
const n = new Worker(URL.createObjectURL(new Blob([
|
|
1115
|
+
const n = new Worker(URL.createObjectURL(new Blob([To], { type: "application/javascript" })), { type: "module" });
|
|
1116
1116
|
e.push(n), n.onmessage = (o) => {
|
|
1117
1117
|
const i = o.data.key;
|
|
1118
1118
|
a(this, Re).get(i)(o.data.data), a(this, Re).delete(i);
|
|
1119
1119
|
};
|
|
1120
1120
|
}
|
|
1121
1121
|
return e;
|
|
1122
|
-
},
|
|
1123
|
-
const n =
|
|
1122
|
+
}, So = function(r, e, t) {
|
|
1123
|
+
const n = Pt(this, it)._++ & 4095;
|
|
1124
1124
|
return new Promise((o) => {
|
|
1125
1125
|
a(this, Re).set(n, o), a(this, Ie)[n % a(this, Ie).length].postMessage({ key: n, type: r, data: e }, t);
|
|
1126
1126
|
});
|
|
1127
|
-
},
|
|
1128
|
-
let e = a(this,
|
|
1129
|
-
return e || (e = [], a(this,
|
|
1130
|
-
},
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
var j, he,
|
|
1127
|
+
}, st = new WeakMap(), Jt = function(r) {
|
|
1128
|
+
let e = a(this, st).get(r);
|
|
1129
|
+
return e || (e = [], a(this, st).set(r, e)), e;
|
|
1130
|
+
}, kr);
|
|
1131
|
+
Pr("grid", io).then();
|
|
1132
|
+
Pr("proxy", uo).then();
|
|
1133
|
+
var j, he, lt, Oe, O, tn, bt, $t, qt, er, Mr, _o = (Mr = class extends Fn {
|
|
1134
1134
|
constructor(e) {
|
|
1135
1135
|
super(e);
|
|
1136
|
-
|
|
1136
|
+
E(this, O);
|
|
1137
1137
|
//layer->zIndex
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1138
|
+
E(this, j);
|
|
1139
|
+
E(this, he);
|
|
1140
|
+
E(this, lt);
|
|
1141
|
+
E(this, Oe, []);
|
|
1142
1142
|
/**
|
|
1143
1143
|
* 过度动画时间:毫秒
|
|
1144
1144
|
*/
|
|
1145
1145
|
g(this, "transition");
|
|
1146
|
-
|
|
1146
|
+
x(this, j, /* @__PURE__ */ new Map()), x(this, he, /* @__PURE__ */ new Map()), S(this, O, tn).call(this, (e == null ? void 0 : e.style).layers), x(this, lt, new Lo(this.painter.context.gl, e.workers)), this.transition = e.transition ?? 0;
|
|
1147
1147
|
}
|
|
1148
1148
|
addSource(e, t) {
|
|
1149
1149
|
return super.addSource(e, t);
|
|
@@ -1156,10 +1156,10 @@ var j, he, st, Ke, K, en, gt, Jt, $t, qt, kr, So = (kr = class extends Yn {
|
|
|
1156
1156
|
addLayer(e, t = 0) {
|
|
1157
1157
|
const n = e.id;
|
|
1158
1158
|
if ("beforeAdd" in e && e.beforeAdd(this), typeof t == "string")
|
|
1159
|
-
return S(this,
|
|
1159
|
+
return S(this, O, $t).call(this, n, t), super.addLayer(e, t), this.sortLayer(), this;
|
|
1160
1160
|
{
|
|
1161
|
-
const o = S(this,
|
|
1162
|
-
return S(this,
|
|
1161
|
+
const o = S(this, O, er).call(this, t);
|
|
1162
|
+
return S(this, O, bt).call(this, n, t), super.addLayer(e, o), this.sortLayer(), this;
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
/**
|
|
@@ -1169,11 +1169,11 @@ var j, he, st, Ke, K, en, gt, Jt, $t, qt, kr, So = (kr = class extends Yn {
|
|
|
1169
1169
|
*/
|
|
1170
1170
|
moveLayer(e, t = 0) {
|
|
1171
1171
|
if (!a(this, j).has(e)) throw new Error(`The layer(id:${t}) does not exist!`);
|
|
1172
|
-
if (S(this,
|
|
1173
|
-
return S(this,
|
|
1172
|
+
if (S(this, O, qt).call(this, e), typeof t == "string")
|
|
1173
|
+
return S(this, O, $t).call(this, e, t), super.moveLayer(e, t), this.sortLayer(), this;
|
|
1174
1174
|
{
|
|
1175
|
-
const n = S(this,
|
|
1176
|
-
return S(this,
|
|
1175
|
+
const n = S(this, O, er).call(this, t);
|
|
1176
|
+
return S(this, O, bt).call(this, e, t), super.moveLayer(e, n);
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
/**
|
|
@@ -1182,7 +1182,7 @@ var j, he, st, Ke, K, en, gt, Jt, $t, qt, kr, So = (kr = class extends Yn {
|
|
|
1182
1182
|
*/
|
|
1183
1183
|
removeLayer(e) {
|
|
1184
1184
|
if (!a(this, j).has(e)) throw new Error(`The layer(id:${e}) does not exist!`);
|
|
1185
|
-
return S(this,
|
|
1185
|
+
return S(this, O, qt).call(this, e), super.removeLayer(e);
|
|
1186
1186
|
}
|
|
1187
1187
|
/**
|
|
1188
1188
|
* show layer
|
|
@@ -1202,35 +1202,35 @@ var j, he, st, Ke, K, en, gt, Jt, $t, qt, kr, So = (kr = class extends Yn {
|
|
|
1202
1202
|
* @internal
|
|
1203
1203
|
*/
|
|
1204
1204
|
get renderFactory() {
|
|
1205
|
-
return a(this,
|
|
1205
|
+
return a(this, lt);
|
|
1206
1206
|
}
|
|
1207
1207
|
setLayerLevelRule(e) {
|
|
1208
|
-
|
|
1208
|
+
x(this, Oe, e), this.sortLayer();
|
|
1209
1209
|
}
|
|
1210
1210
|
sortLayer() {
|
|
1211
1211
|
let e = this.getLayersOrder().filter((t) => t.includes("__") && !t.includes("baselayer__"));
|
|
1212
|
-
a(this,
|
|
1212
|
+
a(this, Oe).map((t) => e.filter((n) => n.startsWith(t + "__"))).flat().forEach((t) => this.moveLayer(t));
|
|
1213
1213
|
}
|
|
1214
1214
|
getLayerLevelRule() {
|
|
1215
|
-
return a(this,
|
|
1215
|
+
return a(this, Oe).map((e) => e);
|
|
1216
1216
|
}
|
|
1217
1217
|
//endregion
|
|
1218
|
-
}, j = new WeakMap(), he = new WeakMap(),
|
|
1218
|
+
}, j = new WeakMap(), he = new WeakMap(), lt = new WeakMap(), Oe = new WeakMap(), O = new WeakSet(), //region private func
|
|
1219
1219
|
/**
|
|
1220
1220
|
* init mapbox layers
|
|
1221
1221
|
* @param layers
|
|
1222
1222
|
* @private
|
|
1223
1223
|
*/
|
|
1224
|
-
|
|
1224
|
+
tn = function(e) {
|
|
1225
1225
|
if (e !== void 0)
|
|
1226
|
-
for (const t of e) S(this,
|
|
1226
|
+
for (const t of e) S(this, O, bt).call(this, t.id, 0);
|
|
1227
1227
|
}, /**
|
|
1228
1228
|
* update Layer z-index
|
|
1229
1229
|
* @param id layer id
|
|
1230
1230
|
* @param zIndex z-index
|
|
1231
1231
|
* @private
|
|
1232
1232
|
*/
|
|
1233
|
-
|
|
1233
|
+
bt = function(e, t) {
|
|
1234
1234
|
if (a(this, j).has(e)) throw new Error(`The layer(id:${e}) already exists!`);
|
|
1235
1235
|
a(this, j).set(e, t), a(this, he).has(t) || a(this, he).set(t, []), a(this, he).get(t).push(e);
|
|
1236
1236
|
}, /**
|
|
@@ -1239,7 +1239,7 @@ gt = function(e, t) {
|
|
|
1239
1239
|
* @param idBefore before layer id
|
|
1240
1240
|
* @private
|
|
1241
1241
|
*/
|
|
1242
|
-
|
|
1242
|
+
$t = function(e, t) {
|
|
1243
1243
|
if (!a(this, j).has(t)) throw new Error(`The before layer(id:${t}) does not exist!`);
|
|
1244
1244
|
const n = a(this, j).get(t), o = a(this, he).get(n), i = o.findIndex((s) => s === t);
|
|
1245
1245
|
a(this, j).set(e, n), o.splice(i, 0, t);
|
|
@@ -1248,7 +1248,7 @@ Jt = function(e, t) {
|
|
|
1248
1248
|
* @param id
|
|
1249
1249
|
* @private
|
|
1250
1250
|
*/
|
|
1251
|
-
|
|
1251
|
+
qt = function(e) {
|
|
1252
1252
|
const t = a(this, j).get(e), n = a(this, he).get(t), o = n.findIndex((i) => i === e);
|
|
1253
1253
|
n.splice(o, 1), a(this, j).delete(e);
|
|
1254
1254
|
}, /**
|
|
@@ -1257,24 +1257,24 @@ $t = function(e) {
|
|
|
1257
1257
|
* @return before layer id
|
|
1258
1258
|
* @private
|
|
1259
1259
|
*/
|
|
1260
|
-
|
|
1260
|
+
er = function(e) {
|
|
1261
1261
|
let t;
|
|
1262
1262
|
for (let n of a(this, he).keys())
|
|
1263
1263
|
n > e && (t === void 0 || t > n) && (t = n);
|
|
1264
1264
|
return t !== void 0 ? a(this, he).get(t)[0] : void 0;
|
|
1265
|
-
},
|
|
1265
|
+
}, Mr), ko = 63710088e-1, rt = -1e18, He, Vr, Mo = (Vr = class {
|
|
1266
1266
|
constructor() {
|
|
1267
|
-
|
|
1267
|
+
E(this, He);
|
|
1268
1268
|
}
|
|
1269
1269
|
get colorCanvas() {
|
|
1270
|
-
return a(this,
|
|
1270
|
+
return a(this, He) || x(this, He, new OffscreenCanvas(512, 1)), a(this, He);
|
|
1271
1271
|
}
|
|
1272
|
-
},
|
|
1273
|
-
function
|
|
1272
|
+
}, He = new WeakMap(), Vr);
|
|
1273
|
+
function rn(r) {
|
|
1274
1274
|
return r.data.BYTES_PER_ELEMENT <= 2;
|
|
1275
1275
|
}
|
|
1276
|
-
var
|
|
1277
|
-
function
|
|
1276
|
+
var Vo = new Mo();
|
|
1277
|
+
function nn(r, e, t, n = !1) {
|
|
1278
1278
|
if (t.length % 2 === 0 && typeof t[0] != "number")
|
|
1279
1279
|
throw new Error("Color format error! When the color array length is even,the format is [number,string,...,number].");
|
|
1280
1280
|
if (t.length % 2 === 1 && typeof t[0] != "string")
|
|
@@ -1282,47 +1282,53 @@ function rn(r, e, t, n = !1) {
|
|
|
1282
1282
|
let o;
|
|
1283
1283
|
if (n) {
|
|
1284
1284
|
o = [];
|
|
1285
|
-
for (let
|
|
1286
|
-
const
|
|
1287
|
-
if (
|
|
1288
|
-
o.push(
|
|
1285
|
+
for (let m of t) {
|
|
1286
|
+
const v = typeof m == "number";
|
|
1287
|
+
if (v && m <= 0) throw new Error("Color format error! The color format(use log) should be greater than 0!");
|
|
1288
|
+
o.push(v ? Math.log2(m) : m);
|
|
1289
1289
|
}
|
|
1290
1290
|
} else o = t;
|
|
1291
|
-
const i =
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1291
|
+
const i = t.length % 2 === 1, s = [], l = [];
|
|
1292
|
+
i && l.push(o[0]);
|
|
1293
|
+
for (let m = i ? 1 : 0; m < o.length; m += 2)
|
|
1294
|
+
s.push(o[m]), l.push(o[m + 1]);
|
|
1295
|
+
const u = s.length, c = Vo.colorCanvas;
|
|
1296
|
+
c.width !== l.length && (c.width = l.length);
|
|
1297
|
+
const h = c.getContext("2d");
|
|
1298
|
+
for (let m = 0; m < l.length; m++)
|
|
1299
|
+
h.fillStyle = l[m], h.fillRect(m, 0, 1, 1);
|
|
1300
|
+
e.u_color && r.deleteTexture(e.u_color), e.u_color_values && r.deleteTexture(e.u_color_values);
|
|
1301
|
+
const d = r.createTexture();
|
|
1302
|
+
r.bindTexture(r.TEXTURE_2D, d), r.texStorage2D(r.TEXTURE_2D, 1, r.RGBA8, l.length, 1), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.NEAREST), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.NEAREST), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE);
|
|
1303
|
+
const p = c.transferToImageBitmap();
|
|
1304
|
+
r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, l.length, 1, r.RGBA, r.UNSIGNED_BYTE, p), p.close(), e.u_color = d;
|
|
1305
|
+
const f = r.createTexture();
|
|
1306
|
+
r.bindTexture(r.TEXTURE_2D, f), r.texStorage2D(r.TEXTURE_2D, 1, r.R32F, u, 1), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.NEAREST), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.NEAREST), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texSubImage2D(
|
|
1307
|
+
r.TEXTURE_2D,
|
|
1308
|
+
0,
|
|
1309
|
+
0,
|
|
1310
|
+
0,
|
|
1311
|
+
u,
|
|
1312
|
+
1,
|
|
1313
|
+
r.RED,
|
|
1314
|
+
r.FLOAT,
|
|
1315
|
+
new Float32Array(s.map((m) => m - Math.abs(m) * 1e-6))
|
|
1316
|
+
), e.u_color_values = f, r.bindTexture(r.TEXTURE_2D, null), e.u_color_count = u, e.u_color_step = i ? 1 : 0;
|
|
1311
1317
|
}
|
|
1312
|
-
function
|
|
1313
|
-
return !e &&
|
|
1318
|
+
function on(r, e) {
|
|
1319
|
+
return !e && rn(r) ? "uint" : "float";
|
|
1314
1320
|
}
|
|
1315
|
-
function
|
|
1321
|
+
function It(r, e, t, n = !1) {
|
|
1316
1322
|
let o, i = 1;
|
|
1317
1323
|
Array.isArray(e) ? (o = e[0], e.length > 1 && (i = 2)) : o = e;
|
|
1318
|
-
const s =
|
|
1324
|
+
const s = on(o, n), l = `${s}-${t}-${n}`;
|
|
1319
1325
|
let u = c(e, l);
|
|
1320
|
-
return u || (u = {},
|
|
1326
|
+
return u || (u = {}, Do(r, u, e, t, n), e.texture.get(r)[l] = i === 1 ? [u.u_data00] : [u.u_data00, u.u_data01], e.info[l] = u), { number: i, filter: t, type: s, useLog: n, uniforms: u };
|
|
1321
1327
|
function c(h, d) {
|
|
1322
1328
|
return h.texture || (h.texture = /* @__PURE__ */ new WeakMap()), (!h.texture.get(r) || !h.info) && (h.texture.set(r, {}), h.info = {}), h.info[d];
|
|
1323
1329
|
}
|
|
1324
1330
|
}
|
|
1325
|
-
function
|
|
1331
|
+
function br(r, e, t, n, o, i) {
|
|
1326
1332
|
const s = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1327
1333
|
if (o === 1 && i === 1)
|
|
1328
1334
|
return Je(r, r.R8, e.x, e.y, r.RED, r.UNSIGNED_BYTE, e.data, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
@@ -1335,14 +1341,14 @@ function gr(r, e, t, n, o, i) {
|
|
|
1335
1341
|
}
|
|
1336
1342
|
return Je(r, r.R8, l, u, r.RED, r.UNSIGNED_BYTE, c, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1337
1343
|
}
|
|
1338
|
-
function
|
|
1344
|
+
function Ir(r, e, t, n, o, i) {
|
|
1339
1345
|
const s = e.data, l = typeof window.Float16Array == "function", u = Math.floor(e.x / o), c = Math.floor(e.y / i), h = l ? new Float16Array(u * c) : new Float32Array(u * c), d = 1 << e.data.BYTES_PER_ELEMENT * 8 - 1, p = e.zeroNaN;
|
|
1340
1346
|
let f = 0;
|
|
1341
1347
|
for (let v = 0; v < e.y; v += i) {
|
|
1342
|
-
const
|
|
1348
|
+
const A = v * e.x;
|
|
1343
1349
|
for (let R = 0; R < e.x; R += o) {
|
|
1344
|
-
const C = s[
|
|
1345
|
-
h[f++] = p && C === 0 ?
|
|
1350
|
+
const C = s[A + R];
|
|
1351
|
+
h[f++] = p && C === 0 ? rt : C - d;
|
|
1346
1352
|
}
|
|
1347
1353
|
}
|
|
1348
1354
|
const m = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
@@ -1358,37 +1364,47 @@ function br(r, e, t, n, o, i) {
|
|
|
1358
1364
|
n ? r.REPEAT : r.CLAMP_TO_EDGE
|
|
1359
1365
|
);
|
|
1360
1366
|
}
|
|
1361
|
-
function
|
|
1367
|
+
function Cr(r, e, t, n, o, i) {
|
|
1362
1368
|
const s = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1363
1369
|
if (o === 1 && i === 1)
|
|
1364
|
-
return Je(r, r.R32F, e.x, e.y, r.RED, r.FLOAT, e.data, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1370
|
+
return Je(r, r.R32F, e.x, e.y, r.RED, r.FLOAT, Bo(e.data), s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1365
1371
|
const l = Math.floor(e.x / o), u = Math.floor(e.y / i), c = new Float32Array(l * u);
|
|
1366
1372
|
let h = 0;
|
|
1367
1373
|
for (let d = 0; d < e.y; d += i) {
|
|
1368
1374
|
const p = d * e.x;
|
|
1369
|
-
for (let f = 0; f < e.x; f += o)
|
|
1370
|
-
|
|
1375
|
+
for (let f = 0; f < e.x; f += o) {
|
|
1376
|
+
const m = e.data[p + f];
|
|
1377
|
+
c[h++] = Number.isNaN(m) ? rt : m;
|
|
1378
|
+
}
|
|
1371
1379
|
}
|
|
1372
1380
|
return Je(r, r.R32F, l, u, r.RED, r.FLOAT, c, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1373
1381
|
}
|
|
1374
|
-
function
|
|
1382
|
+
function Bo(r) {
|
|
1383
|
+
let e = null;
|
|
1384
|
+
for (let t = 0; t < r.length; t++)
|
|
1385
|
+
Number.isNaN(r[t]) && (e || (e = new Float32Array(r)), e[t] = rt);
|
|
1386
|
+
return e ?? r;
|
|
1387
|
+
}
|
|
1388
|
+
function Ar(r, e, t, n, o, i) {
|
|
1375
1389
|
const s = e.data, l = typeof window.Float16Array == "function", u = Math.floor(e.x / o), c = Math.floor(e.y / i), h = l ? new Float16Array(u * c) : new Float32Array(u * c);
|
|
1376
|
-
if (
|
|
1390
|
+
if (rn(e)) {
|
|
1377
1391
|
const { reference: f, scale: m, zeroNaN: v } = e;
|
|
1378
|
-
let
|
|
1392
|
+
let A = 0;
|
|
1379
1393
|
for (let R = 0; R < e.y; R += i) {
|
|
1380
1394
|
const C = R * e.x;
|
|
1381
1395
|
for (let b = 0; b < e.x; b += o) {
|
|
1382
1396
|
const B = s[C + b];
|
|
1383
|
-
h[
|
|
1397
|
+
h[A++] = v && B === 0 ? rt : Math.log2(B * m + f);
|
|
1384
1398
|
}
|
|
1385
1399
|
}
|
|
1386
1400
|
} else {
|
|
1387
1401
|
let f = 0;
|
|
1388
1402
|
for (let m = 0; m < e.y; m += i) {
|
|
1389
1403
|
const v = m * e.x;
|
|
1390
|
-
for (let
|
|
1391
|
-
|
|
1404
|
+
for (let A = 0; A < e.x; A += o) {
|
|
1405
|
+
const R = Math.log2(e.data[v + A]);
|
|
1406
|
+
h[f++] = Number.isNaN(R) ? rt : R;
|
|
1407
|
+
}
|
|
1392
1408
|
}
|
|
1393
1409
|
}
|
|
1394
1410
|
const p = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
@@ -1408,76 +1424,76 @@ function Je(r, e, t, n, o, i, s, l, u) {
|
|
|
1408
1424
|
const c = r.createTexture();
|
|
1409
1425
|
return r.bindTexture(r.TEXTURE_2D, c), r.pixelStorei(r.UNPACK_ALIGNMENT, 1), r.texStorage2D(r.TEXTURE_2D, 1, e, t, n), r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, t, n, o, i, s), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, l), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, l), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.bindTexture(r.TEXTURE_2D, null), c;
|
|
1410
1426
|
}
|
|
1411
|
-
function
|
|
1427
|
+
function Do(r, e, t, n, o) {
|
|
1412
1428
|
let i, s = null;
|
|
1413
1429
|
Array.isArray(t) ? (i = t[0], t.length === 2 && (s = t[1])) : i = t;
|
|
1414
|
-
const l =
|
|
1430
|
+
const l = on(i, o), u = r.getParameter(r.MAX_TEXTURE_SIZE), c = Math.ceil(i.x / u), h = Math.ceil(i.y / u), d = i.lon[0], f = (i.lon[1] - d) / (i.x - 1) * c, m = Math.floor(i.x / c);
|
|
1415
1431
|
e.u_data_lon = [d - f / 2, d + f * (m - 0.5)];
|
|
1416
1432
|
const v = i.lat[0], R = (i.lat[1] - v) / (i.y - 1) * h, C = Math.floor(i.y / h);
|
|
1417
1433
|
e.u_data_lat = [v - R / 2, v + R * (C - 0.5)];
|
|
1418
1434
|
const b = Math.round(e.u_data_lon[1] - e.u_data_lon[0]) === 360;
|
|
1419
1435
|
if (l === "uint") {
|
|
1420
1436
|
const L = i;
|
|
1421
|
-
if (L.zeroNaN || L.data.BYTES_PER_ELEMENT > 1 ? (e.u_data00 =
|
|
1437
|
+
if (L.zeroNaN || L.data.BYTES_PER_ELEMENT > 1 ? (e.u_data00 = Ir(r, L, n, b, c, h), e.u_data00_info = B(L.reference, L.scale, L.data.BYTES_PER_ELEMENT * 8)) : (e.u_data00 = br(r, L, n, b, c, h), e.u_data00_info = [L.reference, L.scale * 255]), s) {
|
|
1422
1438
|
const M = s;
|
|
1423
|
-
M.zeroNaN || M.data.BYTES_PER_ELEMENT > 1 ? (e.u_data01 =
|
|
1439
|
+
M.zeroNaN || M.data.BYTES_PER_ELEMENT > 1 ? (e.u_data01 = Ir(r, M, n, b, c, h), e.u_data01_info = B(M.reference, M.scale, M.data.BYTES_PER_ELEMENT * 8)) : (e.u_data01 = br(r, M, n, b, c, h), e.u_data01_info = [M.reference, M.scale * 255]);
|
|
1424
1440
|
}
|
|
1425
1441
|
} else if (l === "float")
|
|
1426
|
-
e.u_data00 = o ?
|
|
1442
|
+
e.u_data00 = o ? Ar(r, i, n, b, c, h) : Cr(r, i, n, b, c, h), s && (e.u_data01 = o ? Ar(r, s, n, b, c, h) : Cr(r, s, n, b, c, h));
|
|
1427
1443
|
else
|
|
1428
1444
|
throw new Error(`Unknown data texture type: ${l}`);
|
|
1429
1445
|
function B(L, M, T) {
|
|
1430
1446
|
return [(1 << T - 1) * M + L, M];
|
|
1431
1447
|
}
|
|
1432
1448
|
}
|
|
1433
|
-
function
|
|
1449
|
+
function an(r, e) {
|
|
1434
1450
|
r.u_bound = e ? [e.lon[0], Math.min(e.lat[0], e.lat[1]), e.lon[1], Math.max(e.lat[0], e.lat[1])] : void 0;
|
|
1435
1451
|
}
|
|
1436
|
-
function
|
|
1437
|
-
r.u_elevation = (e.elevation ?? 0) /
|
|
1452
|
+
function sn(r, e) {
|
|
1453
|
+
r.u_elevation = (e.elevation ?? 0) / ko;
|
|
1438
1454
|
}
|
|
1439
|
-
function
|
|
1455
|
+
function Zo(r, e) {
|
|
1440
1456
|
r.u_opacity = (e == null ? void 0 : e.opacity) ?? 1, r.u_data_bound = [(e == null ? void 0 : e.min) ?? -1e8, (e == null ? void 0 : e.max) ?? 1e8];
|
|
1441
1457
|
}
|
|
1442
|
-
var
|
|
1458
|
+
var Go = H("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KdW5pZm9ybSBtYXQ0IHVfbWF0cml4Ow0KdW5pZm9ybSBmbG9hdCB1X2VsZXZhdGlvbjsNCmluIHZlYzIgYV9wb3M7DQpvdXQgaGlnaHAgdmVjMiB2X3BvczsNCiNpbmNsdWRlIDxjb25zdGFudD4NCiNpZmRlZiBHTE9CRQ0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQp2b2lkIG1haW4oKSB7DQogICAgdl9wb3MgPSBhX3BvcyAvIEVYVEVOVDsNCiAgICBnbF9Qb3NpdGlvbiA9IHVfbWF0cml4ICogdmVjNChwcm9qZWN0aW9uR2xvYmUodmVjMyh2X3BvcywgRjEgKyB1X2VsZXZhdGlvbikpLCBGMSk7DQp9DQojZWxzZQ0Kdm9pZCBtYWluKCkgew0KICAgIHZfcG9zID0gYV9wb3M7DQogICAgZ2xfUG9zaXRpb24gPSB1X21hdHJpeCAqIHZlYzQoYV9wb3MsIHVfZWxldmF0aW9uLCBGMSk7DQp9DQojZW5kaWYNCg=="), No = H("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBoaWdocCBmbG9hdDsNCnByZWNpc2lvbiBoaWdocCBpbnQ7DQojaW5jbHVkZSA8ZGVmaW5lPg0KI2luY2x1ZGUgPGNvbnN0YW50Pg0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQojaW5jbHVkZSA8dXNlX2NvbG9yPg0KI2luY2x1ZGUgPHVzZV9kaXNwbGF5Pg0KI2luY2x1ZGUgPHVzZV9ib3VuZD4NCiNpbmNsdWRlIDx1c2VfbWFzaz4NCiNpbmNsdWRlIDxkYXRhX2dyaWQ+DQppbiBoaWdocCB2ZWMyIHZfcG9zOw0Kb3V0IGxvd3AgdmVjNCBvX2NvbG9yOw0Kdm9pZCBtYWluKCkgew0KICAgICNpZmRlZiBVU0VfTUFTSw0KICAgIGlmIChpbnZhbGlkTWFzaygpKWRpc2NhcmQ7DQogICAgI2VuZGlmDQogICAgI2lmZGVmIEdMT0JFDQogICAgdmVjMiBsb25MYXQgPSBzaW1wbGVMb25MYXQodl9wb3MpOw0KICAgICNlbHNlDQogICAgdmVjMiBsb25MYXQgPSBtZXJjYXRvclJldmVyc2UoZnJhY3Qodl9wb3MpKTsNCiAgICAjZW5kaWYNCiAgICBpZiAoaW52YWxpZEJvdW5kKGxvbkxhdCkgfHwgaW52YWxpZERhdGFCb3VuZChsb25MYXQpKWRpc2NhcmQ7DQogICAgZmxvYXQgdmFsID0gcmVhZERhdGEobG9uTGF0KTsNCiAgICBpZiAoaW52YWxpZERpc3BsYXkodmFsKSlkaXNjYXJkOw0KICAgIG9fY29sb3IgPSByZWFkQ29sb3IodmFsKSAqIHVfb3BhY2l0eTsNCn0NCg=="), Yo = {
|
|
1443
1459
|
color: [],
|
|
1444
1460
|
dataFilter: "linear",
|
|
1445
1461
|
min: void 0,
|
|
1446
1462
|
max: void 0,
|
|
1447
1463
|
elevation: 0,
|
|
1448
1464
|
opacity: 1
|
|
1449
|
-
}, ae, Ce, ie, se, Ue, W,
|
|
1465
|
+
}, ae, Ce, ie, se, Ue, W, te, J, De, q, ln, tr, rr, cn, nr, Br, Fo = (Br = class extends Jr {
|
|
1450
1466
|
constructor(e) {
|
|
1451
1467
|
super(e);
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1468
|
+
E(this, q);
|
|
1469
|
+
E(this, ae);
|
|
1470
|
+
E(this, Ce);
|
|
1471
|
+
E(this, ie);
|
|
1472
|
+
E(this, se);
|
|
1473
|
+
E(this, Ue);
|
|
1458
1474
|
// current,next
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1475
|
+
E(this, W, null);
|
|
1476
|
+
E(this, te, null);
|
|
1477
|
+
E(this, J);
|
|
1462
1478
|
// transition
|
|
1463
|
-
|
|
1464
|
-
|
|
1479
|
+
E(this, De, 0);
|
|
1480
|
+
x(this, J, {}), x(this, se, Object.assign({}, Yo, e)), x(this, Ue, e.useLog ?? !1);
|
|
1465
1481
|
}
|
|
1466
1482
|
/**
|
|
1467
1483
|
* @internal
|
|
1468
1484
|
*/
|
|
1469
1485
|
onAdd(e, t) {
|
|
1470
|
-
|
|
1486
|
+
x(this, ae, e), x(this, Ce, e.renderFactory);
|
|
1471
1487
|
const n = e.getSource(this.source);
|
|
1472
1488
|
if (!n)
|
|
1473
1489
|
throw new Error(`The source(id:${this.source}) not found!`);
|
|
1474
|
-
|
|
1490
|
+
x(this, ie, n), n.on("data", ({ data: o }) => S(this, q, nr).call(this, o)), S(this, q, tr).call(this, a(this, se), !0), S(this, q, nr).call(this, n.lastData());
|
|
1475
1491
|
}
|
|
1476
1492
|
/**
|
|
1477
1493
|
* @internal
|
|
1478
1494
|
*/
|
|
1479
1495
|
onRemove(e, t) {
|
|
1480
|
-
a(this, W) && (a(this, ie).unlink(a(this, W)),
|
|
1496
|
+
a(this, W) && (a(this, ie).unlink(a(this, W)), x(this, W, null)), a(this, te) && (a(this, ie).unlink(a(this, te)), x(this, te, null)), a(this, J).u_color && t.deleteTexture(a(this, J).u_color), a(this, J).u_color_values && t.deleteTexture(a(this, J).u_color_values);
|
|
1481
1497
|
}
|
|
1482
1498
|
/**
|
|
1483
1499
|
* @internal
|
|
@@ -1487,36 +1503,36 @@ var Do = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KdW5pZm9y
|
|
|
1487
1503
|
const n = a(this, se).dataFilter, o = a(this, Ue), i = a(this, De) - Date.now(), s = t.shaderData.variantName;
|
|
1488
1504
|
let l;
|
|
1489
1505
|
if (i > 0) {
|
|
1490
|
-
a(this,
|
|
1491
|
-
const c =
|
|
1492
|
-
l = S(this,
|
|
1506
|
+
a(this, J).u_transition = i / (a(this, se).transition ?? a(this, ae).transition);
|
|
1507
|
+
const c = It(e, a(this, W), n, o), h = It(e, a(this, te), n, o);
|
|
1508
|
+
l = S(this, q, rr).call(this, s, c, h), Object.assign(a(this, J), c.uniforms);
|
|
1493
1509
|
for (let d in h.uniforms)
|
|
1494
|
-
a(this,
|
|
1510
|
+
a(this, J)[d.replace("u_data0", "u_data1")] = h.uniforms[d];
|
|
1495
1511
|
a(this, ae).triggerRepaint();
|
|
1496
1512
|
} else {
|
|
1497
|
-
|
|
1498
|
-
const c =
|
|
1499
|
-
l = S(this,
|
|
1513
|
+
x(this, De, 0), x(this, te, null);
|
|
1514
|
+
const c = It(e, a(this, W), n, o);
|
|
1515
|
+
l = S(this, q, rr).call(this, s, c), Object.assign(a(this, J), c.uniforms);
|
|
1500
1516
|
}
|
|
1501
|
-
a(this,
|
|
1502
|
-
const u = a(this, Ce).vao(s, () => S(this,
|
|
1503
|
-
|
|
1517
|
+
a(this, J).u_matrix = S(this, q, ln).call(this, t), e.useProgram(l.program), e.enable(e.CULL_FACE), gt(l, a(this, J));
|
|
1518
|
+
const u = a(this, Ce).vao(s, () => S(this, q, cn).call(this, e, s, l));
|
|
1519
|
+
jt(u);
|
|
1504
1520
|
}
|
|
1505
1521
|
setOptions(e) {
|
|
1506
1522
|
var t;
|
|
1507
|
-
S(this,
|
|
1523
|
+
S(this, q, tr).call(this, e, e.color !== void 0 && $r((t = a(this, se)) == null ? void 0 : t.color, e.color)), a(this, ae).triggerRepaint();
|
|
1508
1524
|
}
|
|
1509
|
-
}, ae = new WeakMap(), Ce = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), Ue = new WeakMap(), W = new WeakMap(),
|
|
1525
|
+
}, ae = new WeakMap(), Ce = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), Ue = new WeakMap(), W = new WeakMap(), te = new WeakMap(), J = new WeakMap(), De = new WeakMap(), q = new WeakSet(), ln = function({ shaderData: e, defaultProjectionData: t }) {
|
|
1510
1526
|
const n = e.variantName === "globe", { mainMatrix: o } = n ? a(this, ae).transform.getProjectionData({ overscaledTileID: null, applyGlobeMatrix: !0 }) : t;
|
|
1511
1527
|
return o;
|
|
1512
|
-
},
|
|
1513
|
-
const n = a(this, se), o = a(this,
|
|
1514
|
-
t && e.color &&
|
|
1515
|
-
},
|
|
1528
|
+
}, tr = function(e, t) {
|
|
1529
|
+
const n = a(this, se), o = a(this, J);
|
|
1530
|
+
t && e.color && nn(a(this, ae).painter.context.gl, o, e.color, a(this, Ue)), x(this, se, Object.assign(n, e)), Zo(o, n), an(o, n.bound), sn(o, n);
|
|
1531
|
+
}, rr = function(e, t, n) {
|
|
1516
1532
|
const { number: o, type: i } = t, s = n !== void 0, l = `heatmap:${e}-${o}-${i + (s ? "-" + n.type : "")}-${a(this, se).mask ? "mask" : "unmask"}`, u = e === "globe";
|
|
1517
1533
|
return a(this, Ce).program(
|
|
1518
1534
|
l,
|
|
1519
|
-
() => a(this, Ce).vertex("heatmap:" + e,
|
|
1535
|
+
() => a(this, Ce).vertex("heatmap:" + e, Go, () => u ? "#define GLOBE" : ""),
|
|
1520
1536
|
() => a(this, Ce).fragment(
|
|
1521
1537
|
l,
|
|
1522
1538
|
No,
|
|
@@ -1531,61 +1547,61 @@ var Do = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KdW5pZm9y
|
|
|
1531
1547
|
}
|
|
1532
1548
|
)
|
|
1533
1549
|
);
|
|
1534
|
-
},
|
|
1550
|
+
}, cn = function(e, t, n) {
|
|
1535
1551
|
const o = a(this, Ce).buffer(
|
|
1536
1552
|
t,
|
|
1537
|
-
() => t === "globe" ?
|
|
1553
|
+
() => t === "globe" ? mo(e) : ur(e, {
|
|
1538
1554
|
a_pos: { size: 2, data: new Int8Array([-3, 0, -3, 1, 4, 0, 4, 1]), type: e.BYTE }
|
|
1539
1555
|
})
|
|
1540
1556
|
);
|
|
1541
|
-
return
|
|
1542
|
-
},
|
|
1557
|
+
return Qt(e, n, o, e.TRIANGLE_STRIP);
|
|
1558
|
+
}, nr = function(e) {
|
|
1543
1559
|
if (!e) {
|
|
1544
|
-
a(this,
|
|
1560
|
+
a(this, te) && (a(this, ie).unlink(a(this, te)), x(this, te, null)), a(this, W) && (a(this, ie).unlink(a(this, W)), x(this, W, null), a(this, ae).triggerRepaint());
|
|
1545
1561
|
return;
|
|
1546
1562
|
}
|
|
1547
1563
|
if (a(this, W)) {
|
|
1548
1564
|
const t = a(this, se).transition ?? a(this, ae).transition;
|
|
1549
|
-
t === 0 ? a(this, ie).unlink(a(this, W)) : (a(this,
|
|
1565
|
+
t === 0 ? a(this, ie).unlink(a(this, W)) : (a(this, te) && a(this, ie).unlink(a(this, te)), Kr(a(this, W), e) ? (x(this, te, a(this, W)), x(this, De, Date.now() + t)) : (a(this, ie).unlink(a(this, W)), x(this, De, 0)));
|
|
1550
1566
|
}
|
|
1551
|
-
a(this, ie).link(e),
|
|
1552
|
-
},
|
|
1553
|
-
function
|
|
1567
|
+
a(this, ie).link(e), x(this, W, e), a(this, ae).triggerRepaint();
|
|
1568
|
+
}, Br), Po = "text-tile";
|
|
1569
|
+
function Xo(r) {
|
|
1554
1570
|
return r.data.BYTES_PER_ELEMENT <= 2;
|
|
1555
1571
|
}
|
|
1556
|
-
function
|
|
1572
|
+
function un(r, e, t, n, o, i, s, l) {
|
|
1557
1573
|
const u = Math.round((l - i[0]) / n);
|
|
1558
1574
|
if (u < 0 || u >= e) return -1;
|
|
1559
1575
|
s - o[0] >= 360 && (s -= 360), o[1] - s >= 360 && (s += 360);
|
|
1560
1576
|
const c = Math.round((s - o[0]) / t);
|
|
1561
1577
|
return c < 0 || c >= r ? -1 : u * r + c;
|
|
1562
1578
|
}
|
|
1563
|
-
function
|
|
1579
|
+
function dn(r, e) {
|
|
1564
1580
|
if (e < 0) return NaN;
|
|
1565
1581
|
{
|
|
1566
1582
|
let t = r.data[e];
|
|
1567
|
-
return
|
|
1583
|
+
return Xo(r) && (t = r.zeroNaN && t === 0 ? NaN : r.reference + r.scale * t), t;
|
|
1568
1584
|
}
|
|
1569
1585
|
}
|
|
1570
1586
|
function Le(r, e) {
|
|
1571
1587
|
const { x: t, y: n, lon: o, lat: i } = r, s = new Float32Array(e.length), l = (o[1] - o[0]) / (t - 1), u = (i[1] - i[0]) / (n - 1);
|
|
1572
1588
|
for (let c = 0; c < e.length; c++) {
|
|
1573
|
-
const [h, d] = e[c], p =
|
|
1574
|
-
s[c] =
|
|
1589
|
+
const [h, d] = e[c], p = un(t, n, l, u, o, i, h, d);
|
|
1590
|
+
s[c] = dn(r, p);
|
|
1575
1591
|
}
|
|
1576
1592
|
return s;
|
|
1577
1593
|
}
|
|
1578
|
-
function
|
|
1594
|
+
function mt(r, e, t) {
|
|
1579
1595
|
const { x: n, y: o, lon: i, lat: s } = r, l = new Float32Array(e.length * t.length), u = (i[1] - i[0]) / (n - 1), c = (s[1] - s[0]) / (o - 1);
|
|
1580
1596
|
let h = 0;
|
|
1581
1597
|
for (const d of t)
|
|
1582
1598
|
for (const p of e) {
|
|
1583
|
-
const f =
|
|
1584
|
-
l[h++] =
|
|
1599
|
+
const f = un(n, o, u, c, i, s, p, d);
|
|
1600
|
+
l[h++] = dn(r, f);
|
|
1585
1601
|
}
|
|
1586
1602
|
return l;
|
|
1587
1603
|
}
|
|
1588
|
-
var
|
|
1604
|
+
var Wo = {
|
|
1589
1605
|
// color: 'white',
|
|
1590
1606
|
color: (r) => "#fff",
|
|
1591
1607
|
min: void 0,
|
|
@@ -1595,18 +1611,18 @@ var Po = {
|
|
|
1595
1611
|
convert: (r) => r.toFixed(1),
|
|
1596
1612
|
font: "24px Arial",
|
|
1597
1613
|
align: "center"
|
|
1598
|
-
}, z,
|
|
1614
|
+
}, z, Mt, hn, Dr, zo = (Dr = class extends cr {
|
|
1599
1615
|
constructor(e) {
|
|
1600
1616
|
super(e);
|
|
1601
|
-
|
|
1602
|
-
|
|
1617
|
+
E(this, Mt);
|
|
1618
|
+
E(this, z);
|
|
1603
1619
|
/**
|
|
1604
1620
|
* @internal
|
|
1605
1621
|
*/
|
|
1606
1622
|
g(this, "loadTile", async (e, t) => {
|
|
1607
1623
|
var o, i;
|
|
1608
|
-
const n = S(this,
|
|
1609
|
-
return n ? this.renderFactory.exec(
|
|
1624
|
+
const n = S(this, Mt, hn).call(this, e, t);
|
|
1625
|
+
return n ? this.renderFactory.exec(Po, {
|
|
1610
1626
|
canvas: { type: "2d", size: this.tileSize * 2 },
|
|
1611
1627
|
data: {
|
|
1612
1628
|
font: a(this, z).font,
|
|
@@ -1619,12 +1635,12 @@ var Po = {
|
|
|
1619
1635
|
}, [n]) : null;
|
|
1620
1636
|
});
|
|
1621
1637
|
g(this, "setOptions", (e) => {
|
|
1622
|
-
|
|
1638
|
+
x(this, z, Object.assign(a(this, z), e)), super.setOptions(e);
|
|
1623
1639
|
});
|
|
1624
|
-
|
|
1640
|
+
x(this, z, Object.assign({}, Wo, e));
|
|
1625
1641
|
}
|
|
1626
|
-
}, z = new WeakMap(),
|
|
1627
|
-
const { bound: n } = a(this, z), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, i =
|
|
1642
|
+
}, z = new WeakMap(), Mt = new WeakSet(), hn = function(e, t) {
|
|
1643
|
+
const { bound: n } = a(this, z), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, i = Hr(e, o, a(this, z).cell, n);
|
|
1628
1644
|
if (i.length === 0) return null;
|
|
1629
1645
|
const s = h(this.data0, i);
|
|
1630
1646
|
if (t > 0) {
|
|
@@ -1636,7 +1652,7 @@ var Po = {
|
|
|
1636
1652
|
for (let d = 0; d < s.length; d++) {
|
|
1637
1653
|
const p = s[d];
|
|
1638
1654
|
if (isNaN(p) || p < u || p > c) continue;
|
|
1639
|
-
const [f, m] =
|
|
1655
|
+
const [f, m] = Ur(e, i[d]);
|
|
1640
1656
|
l.push(f, m, p);
|
|
1641
1657
|
}
|
|
1642
1658
|
return l.length > 0 ? new Float32Array(l).buffer : null;
|
|
@@ -1648,14 +1664,14 @@ var Po = {
|
|
|
1648
1664
|
f[v] = Math.hypot(f[v], m[v]);
|
|
1649
1665
|
return f;
|
|
1650
1666
|
}
|
|
1651
|
-
},
|
|
1652
|
-
function
|
|
1667
|
+
}, Dr), Ko = "vector-init-image", Oo = "vector-tile-image", Ho = "vector-tile-arrow";
|
|
1668
|
+
function fn(r, ...e) {
|
|
1653
1669
|
for (const t of e)
|
|
1654
1670
|
for (const [n, o] of Object.entries(t))
|
|
1655
|
-
o !== void 0 && (r[n] = Array.isArray(o) || typeof o != "object" || o.byteLength !== void 0 ? o :
|
|
1671
|
+
o !== void 0 && (r[n] = Array.isArray(o) || typeof o != "object" || o.byteLength !== void 0 ? o : fn(r[n] ?? {}, o));
|
|
1656
1672
|
return r;
|
|
1657
1673
|
}
|
|
1658
|
-
var
|
|
1674
|
+
var Uo = {
|
|
1659
1675
|
type: "uv",
|
|
1660
1676
|
image: void 0,
|
|
1661
1677
|
level: [],
|
|
@@ -1664,7 +1680,7 @@ var Ko = {
|
|
|
1664
1680
|
opacity: 1,
|
|
1665
1681
|
cell: 6,
|
|
1666
1682
|
flip: !1
|
|
1667
|
-
},
|
|
1683
|
+
}, Qo = {
|
|
1668
1684
|
type: "uv",
|
|
1669
1685
|
color: "white",
|
|
1670
1686
|
min: void 0,
|
|
@@ -1675,21 +1691,21 @@ var Ko = {
|
|
|
1675
1691
|
font: "36px serif",
|
|
1676
1692
|
text: "↓"
|
|
1677
1693
|
}
|
|
1678
|
-
},
|
|
1694
|
+
}, jo = /* @__PURE__ */ new Set(), Y, ct, Vt, pn, Zr, Jo = (Zr = class extends cr {
|
|
1679
1695
|
constructor(e) {
|
|
1680
1696
|
super(e);
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1697
|
+
E(this, Vt);
|
|
1698
|
+
E(this, Y);
|
|
1699
|
+
E(this, ct, null);
|
|
1684
1700
|
/**
|
|
1685
1701
|
* @internal
|
|
1686
1702
|
*/
|
|
1687
1703
|
g(this, "loadTile", async (e, t) => {
|
|
1688
|
-
const n = a(this, Y).type, o = S(this,
|
|
1704
|
+
const n = a(this, Y).type, o = S(this, Vt, pn).call(this, e, n, t);
|
|
1689
1705
|
if (!o) return null;
|
|
1690
1706
|
const i = { type: "2d", size: this.tileSize * 2 };
|
|
1691
|
-
return a(this, Y).image ? a(this,
|
|
1692
|
-
|
|
1707
|
+
return a(this, Y).image ? a(this, ct).then(() => this.renderFactory.exec(
|
|
1708
|
+
Oo,
|
|
1693
1709
|
{
|
|
1694
1710
|
cache: "vector",
|
|
1695
1711
|
canvas: i,
|
|
@@ -1721,9 +1737,9 @@ var Ko = {
|
|
|
1721
1737
|
);
|
|
1722
1738
|
});
|
|
1723
1739
|
g(this, "setOptions", (e) => {
|
|
1724
|
-
|
|
1740
|
+
x(this, Y, Object.assign(a(this, Y), e)), super.setOptions(e);
|
|
1725
1741
|
});
|
|
1726
|
-
|
|
1742
|
+
x(this, Y, fn({}, e.image ? Uo : Qo, e));
|
|
1727
1743
|
}
|
|
1728
1744
|
/**
|
|
1729
1745
|
* @internal
|
|
@@ -1731,155 +1747,155 @@ var Ko = {
|
|
|
1731
1747
|
onAdd(e) {
|
|
1732
1748
|
if (super.onAdd(e), a(this, Y).image) {
|
|
1733
1749
|
const t = a(this, Y).image.src;
|
|
1734
|
-
|
|
1750
|
+
jo.add(t);
|
|
1735
1751
|
let n;
|
|
1736
|
-
|
|
1752
|
+
x(this, ct, new Promise((o) => n = o)), fetch(t).then((o) => o.blob()).then((o) => this.renderFactory.execAll(Ko, {
|
|
1737
1753
|
cache: "vector",
|
|
1738
1754
|
data: { name: t, blob: o }
|
|
1739
1755
|
})).then(() => n());
|
|
1740
1756
|
}
|
|
1741
1757
|
}
|
|
1742
|
-
}, Y = new WeakMap(),
|
|
1743
|
-
const { bound: o } = a(this, Y), i = Array.isArray(this.data0) ? this.data0[0] : this.data0, s =
|
|
1758
|
+
}, Y = new WeakMap(), ct = new WeakMap(), Vt = new WeakSet(), pn = function(e, t, n) {
|
|
1759
|
+
const { bound: o } = a(this, Y), i = Array.isArray(this.data0) ? this.data0[0] : this.data0, s = Hr(e, i, a(this, Y).cell, o);
|
|
1744
1760
|
if (s.length === 0) return null;
|
|
1745
1761
|
const l = p(this.data0, s), u = t === "uv";
|
|
1746
1762
|
if (n > 0) {
|
|
1747
1763
|
const f = n, m = 1 - f, v = p(this.data1, s);
|
|
1748
1764
|
if (u)
|
|
1749
|
-
for (let
|
|
1750
|
-
l[
|
|
1765
|
+
for (let A = 0; A < l.length; A++)
|
|
1766
|
+
l[A] = m * l[A] + f * v[A];
|
|
1751
1767
|
else
|
|
1752
|
-
for (let
|
|
1753
|
-
let R = v[
|
|
1754
|
-
R > 180 && (R -= 360), R < -180 && (R += 360), l[
|
|
1768
|
+
for (let A = 0; A < l.length; A++) {
|
|
1769
|
+
let R = v[A] - l[A];
|
|
1770
|
+
R > 180 && (R -= 360), R < -180 && (R += 360), l[A] = l[A] + m * R;
|
|
1755
1771
|
}
|
|
1756
1772
|
}
|
|
1757
1773
|
const c = [], h = a(this, Y).min, d = a(this, Y).max;
|
|
1758
1774
|
for (let f = 0; f < s.length; f++) {
|
|
1759
|
-
const m = l[2 * f], v = l[2 * f + 1],
|
|
1760
|
-
if (isNaN(
|
|
1761
|
-
const [R, C] =
|
|
1775
|
+
const m = l[2 * f], v = l[2 * f + 1], A = u ? Math.hypot(m, v) : m;
|
|
1776
|
+
if (isNaN(A) || A < h || A > d) continue;
|
|
1777
|
+
const [R, C] = Ur(e, s[f]);
|
|
1762
1778
|
c.push(R, C, m, v);
|
|
1763
1779
|
}
|
|
1764
1780
|
return c.length > 0 ? new Float32Array(c).buffer : null;
|
|
1765
1781
|
function p(f, m) {
|
|
1766
|
-
let v,
|
|
1767
|
-
Array.isArray(f) ? f.length === 1 ? v = Le(f[0], m) : (v = Le(f[0], m),
|
|
1782
|
+
let v, A;
|
|
1783
|
+
Array.isArray(f) ? f.length === 1 ? v = Le(f[0], m) : (v = Le(f[0], m), A = Le(f[1], m)) : v = Le(f, m);
|
|
1768
1784
|
const R = new Float32Array(v.length * 2);
|
|
1769
1785
|
for (let C = 0; C < v.length; C++)
|
|
1770
|
-
R[2 * C] = v[C],
|
|
1786
|
+
R[2 * C] = v[C], A && (R[2 * C + 1] = A[C]);
|
|
1771
1787
|
return R;
|
|
1772
1788
|
}
|
|
1773
|
-
},
|
|
1789
|
+
}, Zr), $o = H("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KI2luY2x1ZGUgPGNvbnN0YW50Pg0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQojaW5jbHVkZSA8dXNlX2Rpc3BsYXk+DQojaW5jbHVkZSA8dXNlX2JvdW5kPg0KI2luY2x1ZGUgPHVzZV9tYXNrPg0KI2luY2x1ZGUgPGRhdGFfZ3JpZD4NCnVuaWZvcm0gbWF0NCB1X21hdHJpeDsNCnVuaWZvcm0gbWF0NCB1X21hdHJpeF9pbnZlcnNlOw0KdW5pZm9ybSBmbG9hdCB1X2VsZXZhdGlvbjsNCnVuaWZvcm0gZmxvYXQgdV9zcGVlZDsNCnVuaWZvcm0gZmxvYXQgdV9zY2FsZTsNCg0KaW4gdmVjNCBhX2RhdGE7DQpvdXQgdmVjNCB2X2RhdGE7DQoNCiNpZmRlZiBHTE9CRQ0KdmVjMyB0aWxlKHZlYzMgcCkgew0KICAgIHZlYzQgcDAgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMCwgRjEpOw0KICAgIHZlYzQgcDEgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMSwgRjEpOw0KICAgIHAwID0gcDAgLyBwMC53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KHZfdmFsLnkpKTsNCn0NCg=="), Er = H("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQppbiB2ZWMyIGFfcG9zOw0Kb3V0IHZlYzIgdl9wb3M7DQp2b2lkIG1haW4oKSB7DQogICAgZ2xfUG9zaXRpb24gPSB2ZWM0KGFfcG9zLCAwLjAsIDEuMCk7DQogICAgdl9wb3MgPSBhX3BvcyAqIC41ICsgLjU7DQp9DQo="), ta = H("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBtZWRpdW1wIGZsb2F0Ow0KdW5pZm9ybSBsb3dwIHNhbXBsZXIyRCB1X2ZyYW1lOw0KaW4gdmVjMiB2X3BvczsNCm91dCB2ZWM0IG9fY29sb3I7DQp2b2lkIG1haW4oKSB7DQogICAgb19jb2xvciA9IHRleHR1cmUodV9mcmFtZSwgdl9wb3MpOw0KICAgIGlmIChvX2NvbG9yLmEgPCAuNSkgZGlzY2FyZDsNCn0NCg=="), fe = {
|
|
1774
1790
|
feedback: "particle-feedback",
|
|
1775
1791
|
blend: "particle-blend",
|
|
1776
1792
|
screen: "particle-screen",
|
|
1777
1793
|
draw: "particle-draw"
|
|
1778
|
-
},
|
|
1794
|
+
}, ra = {
|
|
1779
1795
|
type: "uv",
|
|
1780
1796
|
color: [],
|
|
1781
1797
|
disappear: 1,
|
|
1782
1798
|
size: 1,
|
|
1783
1799
|
speed: 1,
|
|
1784
1800
|
elevation: 0
|
|
1785
|
-
}, ve,
|
|
1801
|
+
}, ve, X, Qe, re, ye, $, je, Te, oe, K, V, mn, vn, yn, gn, bn, In, Cn, Ct, An, or, ar, ir, xn, En, sr, Gr, na = (Gr = class extends Jr {
|
|
1786
1802
|
constructor(e) {
|
|
1787
1803
|
super(e);
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1804
|
+
E(this, V);
|
|
1805
|
+
E(this, ve);
|
|
1806
|
+
E(this, X);
|
|
1807
|
+
E(this, Qe);
|
|
1808
|
+
E(this, re);
|
|
1809
|
+
E(this, ye, null);
|
|
1810
|
+
E(this, $);
|
|
1811
|
+
E(this, je, !1);
|
|
1812
|
+
E(this, Te);
|
|
1813
|
+
E(this, oe);
|
|
1814
|
+
E(this, K);
|
|
1799
1815
|
g(this, "visible", !0);
|
|
1800
|
-
|
|
1816
|
+
x(this, $, {}), x(this, re, Object.assign({}, ra, e)), x(this, Te, e.count ?? 8192), x(this, K, { width: 0, height: 0, buffer: null });
|
|
1801
1817
|
}
|
|
1802
1818
|
/**
|
|
1803
1819
|
* @internal
|
|
1804
1820
|
*/
|
|
1805
1821
|
onAdd(e, t) {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
}), e.on("moveend", () =>
|
|
1822
|
+
x(this, ve, e), e.on("movestart", () => {
|
|
1823
|
+
x(this, je, !0), S(this, V, sr).call(this, t);
|
|
1824
|
+
}), e.on("moveend", () => x(this, je, !1)), e.on("projectiontransition", () => S(this, V, sr).call(this, t)), x(this, X, e.renderFactory);
|
|
1809
1825
|
const n = e.getSource(this.source);
|
|
1810
1826
|
if (!n) throw new Error(`The source(id:${this.source}) not found!`);
|
|
1811
|
-
|
|
1827
|
+
x(this, Qe, n), n.on("data", ({ data: o }) => S(this, V, ir).call(this, o)), S(this, V, ar).call(this, a(this, re), !0), S(this, V, ir).call(this, n.lastData());
|
|
1812
1828
|
}
|
|
1813
1829
|
/**
|
|
1814
1830
|
* @internal
|
|
1815
1831
|
*/
|
|
1816
1832
|
render(e, t) {
|
|
1817
1833
|
if (!a(this, ye) || a(this, je) || !this.visible) return;
|
|
1818
|
-
S(this, V,
|
|
1819
|
-
const n = a(this,
|
|
1834
|
+
S(this, V, mn).call(this, e);
|
|
1835
|
+
const n = a(this, $), o = t.shaderData.variantName, i = It(e, a(this, ye), "linear");
|
|
1820
1836
|
Object.assign(n, i.uniforms), S(this, V, En).call(this, t);
|
|
1821
|
-
const s = S(this, V,
|
|
1822
|
-
n.u_scale = 1 / 2 ** Math.max(1, a(this, ve).getZoom() - 1), e.useProgram(s.program), e.bindVertexArray(c.feedbackVao),
|
|
1823
|
-
const d = S(this, V,
|
|
1824
|
-
e.useProgram(d.program),
|
|
1837
|
+
const s = S(this, V, vn).call(this, o, i.type), l = S(this, V, yn).call(this), u = S(this, V, bn).call(this), c = S(this, V, An).call(this, e, s.program, u.program), h = a(this, Te);
|
|
1838
|
+
n.u_scale = 1 / 2 ** Math.max(1, a(this, ve).getZoom() - 1), e.useProgram(s.program), e.bindVertexArray(c.feedbackVao), gt(s, n), e.enable(e.RASTERIZER_DISCARD), e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, c.feedback), e.beginTransformFeedback(e.POINTS), e.drawArrays(e.POINTS, 0, h), e.endTransformFeedback(), e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, null), e.disable(e.RASTERIZER_DISCARD), e.bindFramebuffer(e.FRAMEBUFFER, a(this, K).buffer), e.useProgram(l.program), e.enable(e.BLEND), e.blendColor(0, 0, 0, n.u_disappear), e.blendFunc(e.ZERO, e.CONSTANT_ALPHA), jt(S(this, V, gn).call(this, e, l)), e.disable(e.BLEND), e.useProgram(u.program), e.bindVertexArray(c.drawVao), gt(u, n), e.drawArraysInstanced(e.TRIANGLE_STRIP, 0, 4, h), e.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
1839
|
+
const d = S(this, V, In).call(this);
|
|
1840
|
+
e.useProgram(d.program), gt(d, n), jt(S(this, V, Cn).call(this, e, d)), a(this, ve).triggerRepaint();
|
|
1825
1841
|
}
|
|
1826
1842
|
setOptions(e) {
|
|
1827
1843
|
var t;
|
|
1828
|
-
S(this, V,
|
|
1844
|
+
S(this, V, ar).call(this, e, e.color !== void 0 && $r((t = a(this, re)) == null ? void 0 : t.color, e.color)), a(this, ve).triggerRepaint();
|
|
1829
1845
|
}
|
|
1830
|
-
}, ve = new WeakMap(),
|
|
1846
|
+
}, ve = new WeakMap(), X = new WeakMap(), Qe = new WeakMap(), re = new WeakMap(), ye = new WeakMap(), $ = new WeakMap(), je = new WeakMap(), Te = new WeakMap(), oe = new WeakMap(), K = new WeakMap(), V = new WeakSet(), mn = function(e) {
|
|
1831
1847
|
const t = e.drawingBufferWidth, n = e.drawingBufferHeight;
|
|
1832
|
-
if (a(this,
|
|
1848
|
+
if (a(this, K).width === t && a(this, K).height === n)
|
|
1833
1849
|
return;
|
|
1834
|
-
a(this,
|
|
1835
|
-
const o = a(this,
|
|
1850
|
+
a(this, K).width = t, a(this, K).height = n, a(this, K).buffer || (a(this, K).buffer = e.createFramebuffer());
|
|
1851
|
+
const o = a(this, K).buffer;
|
|
1836
1852
|
e.bindFramebuffer(e.FRAMEBUFFER, o);
|
|
1837
1853
|
const i = e.createTexture();
|
|
1838
|
-
e.bindTexture(e.TEXTURE_2D, i), e.pixelStorei(e.UNPACK_ALIGNMENT, 1), e.texStorage2D(e.TEXTURE_2D, 1, e.RGBA8, t, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, i, 0), e.bindTexture(e.TEXTURE_2D, null), e.bindFramebuffer(e.FRAMEBUFFER, null), a(this,
|
|
1839
|
-
const s = a(this,
|
|
1840
|
-
a(this,
|
|
1841
|
-
},
|
|
1842
|
-
const n = `${fe.feedback}:${e}-${t}-${a(this,
|
|
1843
|
-
return a(this,
|
|
1854
|
+
e.bindTexture(e.TEXTURE_2D, i), e.pixelStorei(e.UNPACK_ALIGNMENT, 1), e.texStorage2D(e.TEXTURE_2D, 1, e.RGBA8, t, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, i, 0), e.bindTexture(e.TEXTURE_2D, null), e.bindFramebuffer(e.FRAMEBUFFER, null), a(this, $).u_frame = i;
|
|
1855
|
+
const s = a(this, re).size * devicePixelRatio;
|
|
1856
|
+
a(this, $).u_size = [s / t, s / n];
|
|
1857
|
+
}, vn = function(e, t) {
|
|
1858
|
+
const n = `${fe.feedback}:${e}-${t}-${a(this, re).type}-${a(this, re).mask ? "mask" : "unmask"}`, o = e === "globe";
|
|
1859
|
+
return a(this, X).program(
|
|
1844
1860
|
n,
|
|
1845
|
-
() => a(this,
|
|
1861
|
+
() => a(this, X).vertex(n, $o, () => {
|
|
1846
1862
|
const i = ["DATA_GRID_UV"];
|
|
1847
1863
|
return o && i.push("GLOBE"), t === "uint" ? i.push("DATA0_UINT") : t === "float" && i.push("DATA0_FLOAT"), i.map((s) => "#define " + s).join(`
|
|
1848
1864
|
`);
|
|
1849
1865
|
}),
|
|
1850
|
-
() => a(this,
|
|
1866
|
+
() => a(this, X).fragment(fe.blend, xr),
|
|
1851
1867
|
["v_data"]
|
|
1852
1868
|
);
|
|
1853
|
-
},
|
|
1854
|
-
return a(this,
|
|
1855
|
-
},
|
|
1856
|
-
return a(this,
|
|
1857
|
-
const n = S(this, V,
|
|
1858
|
-
return
|
|
1869
|
+
}, yn = function() {
|
|
1870
|
+
return a(this, X).program(fe.blend, () => a(this, X).vertex(fe.screen, Er), () => a(this, X).fragment(fe.blend, xr));
|
|
1871
|
+
}, gn = function(e, t) {
|
|
1872
|
+
return a(this, X).vao(fe.blend, () => {
|
|
1873
|
+
const n = S(this, V, Ct).call(this, e);
|
|
1874
|
+
return Qt(e, t, n, e.TRIANGLE_STRIP);
|
|
1859
1875
|
});
|
|
1860
|
-
}, gn = function() {
|
|
1861
|
-
const e = fe.draw;
|
|
1862
|
-
return a(this, P).program(e, () => a(this, P).vertex(e, Jo), () => a(this, P).fragment(e, $o));
|
|
1863
1876
|
}, bn = function() {
|
|
1877
|
+
const e = fe.draw;
|
|
1878
|
+
return a(this, X).program(e, () => a(this, X).vertex(e, qo), () => a(this, X).fragment(e, ea));
|
|
1879
|
+
}, In = function() {
|
|
1864
1880
|
const e = fe.screen;
|
|
1865
|
-
return a(this,
|
|
1866
|
-
},
|
|
1867
|
-
return a(this,
|
|
1868
|
-
const n = S(this, V,
|
|
1869
|
-
return
|
|
1881
|
+
return a(this, X).program(e, () => a(this, X).vertex(e, Er), () => a(this, X).fragment(e, ta));
|
|
1882
|
+
}, Cn = function(e, t) {
|
|
1883
|
+
return a(this, X).vao(fe.screen, () => {
|
|
1884
|
+
const n = S(this, V, Ct).call(this, e);
|
|
1885
|
+
return Qt(e, t, n, e.TRIANGLE_STRIP);
|
|
1870
1886
|
});
|
|
1871
|
-
},
|
|
1872
|
-
return a(this,
|
|
1887
|
+
}, Ct = function(e) {
|
|
1888
|
+
return a(this, X).buffer(
|
|
1873
1889
|
fe.screen,
|
|
1874
|
-
() =>
|
|
1890
|
+
() => ur(e, { a_pos: { size: 2, data: new Int8Array([-1, 1, -1, -1, 1, 1, 1, -1]), type: e.BYTE } })
|
|
1875
1891
|
);
|
|
1876
|
-
},
|
|
1892
|
+
}, An = function(e, t, n) {
|
|
1877
1893
|
if (a(this, oe)) {
|
|
1878
1894
|
const d = a(this, oe)[0];
|
|
1879
1895
|
return a(this, oe)[0] = a(this, oe)[1], a(this, oe)[1] = d, d;
|
|
1880
1896
|
}
|
|
1881
|
-
const o = S(this, V,
|
|
1882
|
-
return
|
|
1897
|
+
const o = S(this, V, Ct).call(this, e).attribute.a_pos.buffer, i = l(a(this, Te) * 16, e.DYNAMIC_DRAW), s = l(a(this, Te) * 16, e.DYNAMIC_DRAW);
|
|
1898
|
+
return x(this, oe, [{
|
|
1883
1899
|
buffer: i,
|
|
1884
1900
|
feedbackVao: c(t, i),
|
|
1885
1901
|
feedback: u(s),
|
|
@@ -1889,7 +1905,7 @@ var Ko = {
|
|
|
1889
1905
|
feedbackVao: c(t, s),
|
|
1890
1906
|
feedback: u(null),
|
|
1891
1907
|
drawVao: h(n, o, [i, s])
|
|
1892
|
-
}]), S(this, V,
|
|
1908
|
+
}]), S(this, V, or).call(this, e), a(this, oe)[0];
|
|
1893
1909
|
function l(d, p) {
|
|
1894
1910
|
const f = e.createBuffer();
|
|
1895
1911
|
return e.bindBuffer(e.ARRAY_BUFFER, f), e.bufferData(e.ARRAY_BUFFER, d, p), f;
|
|
@@ -1907,57 +1923,57 @@ var Ko = {
|
|
|
1907
1923
|
function h(d, p, f) {
|
|
1908
1924
|
const m = e.createVertexArray();
|
|
1909
1925
|
e.bindVertexArray(m);
|
|
1910
|
-
for (let
|
|
1911
|
-
e.bindBuffer(e.ARRAY_BUFFER, f[
|
|
1912
|
-
const R = e.getAttribLocation(d, "a_data" +
|
|
1926
|
+
for (let A = 0; A < f.length; A++) {
|
|
1927
|
+
e.bindBuffer(e.ARRAY_BUFFER, f[A]);
|
|
1928
|
+
const R = e.getAttribLocation(d, "a_data" + A);
|
|
1913
1929
|
e.enableVertexAttribArray(R), e.vertexAttribPointer(R, 4, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(R, 1);
|
|
1914
1930
|
}
|
|
1915
1931
|
e.bindBuffer(e.ARRAY_BUFFER, p);
|
|
1916
1932
|
const v = e.getAttribLocation(d, "a_pos");
|
|
1917
1933
|
return e.enableVertexAttribArray(v), e.vertexAttribPointer(v, 2, e.BYTE, !1, 0, 0), m;
|
|
1918
1934
|
}
|
|
1919
|
-
},
|
|
1935
|
+
}, or = function(e) {
|
|
1920
1936
|
if (!a(this, oe)) return;
|
|
1921
1937
|
e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, a(this, oe)[1].feedback), e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER, 0, null);
|
|
1922
1938
|
const t = a(this, oe)[0].buffer, n = new Float32Array(a(this, Te) * 4);
|
|
1923
1939
|
for (let o = 0; o < n.length; o += 4)
|
|
1924
1940
|
n[o] = Math.random() * 2 - 1, n[o + 1] = Math.random() * 2 - 1, n[o + 2] = Math.random() * 0.5 + 0.5;
|
|
1925
1941
|
e.bindBuffer(e.ARRAY_BUFFER, t), e.bufferSubData(e.ARRAY_BUFFER, 0, n), e.bindBuffer(e.ARRAY_BUFFER, null), e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER, 0, t), e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, null);
|
|
1926
|
-
},
|
|
1927
|
-
const n = a(this,
|
|
1928
|
-
if (t && e.color &&
|
|
1929
|
-
const i = a(this,
|
|
1930
|
-
a(this,
|
|
1942
|
+
}, ar = function(e, t) {
|
|
1943
|
+
const n = a(this, re), o = a(this, $);
|
|
1944
|
+
if (t && e.color && nn(a(this, ve).painter.context.gl, o, e.color), x(this, re, Object.assign(n, e)), an(o, n.bound), sn(o, n), o.u_disappear = 1 - 0.03 * n.disappear, o.u_speed = a(this, re).speed, a(this, K).buffer) {
|
|
1945
|
+
const i = a(this, re).size * devicePixelRatio;
|
|
1946
|
+
a(this, $).u_size = [i / a(this, K).width, i / a(this, K).height];
|
|
1931
1947
|
}
|
|
1932
|
-
},
|
|
1948
|
+
}, ir = function(e) {
|
|
1933
1949
|
if (e && (!Array.isArray(e) || e.length < 2))
|
|
1934
1950
|
throw new Error("particle data must be uv | dv data!");
|
|
1935
|
-
a(this, ye) && a(this, Qe).unlink(a(this, ye)),
|
|
1951
|
+
a(this, ye) && a(this, Qe).unlink(a(this, ye)), x(this, ye, S(this, V, xn).call(this, e)), a(this, ye) && a(this, Qe).link(a(this, ye)), a(this, ve).triggerRepaint();
|
|
1936
1952
|
}, xn = function(e) {
|
|
1937
|
-
if (a(this,
|
|
1953
|
+
if (a(this, re).type === "uv" || !e || !Array.isArray(e) || e.length != 2) return e;
|
|
1938
1954
|
const t = e[0].data, n = "reference" in e[0] ? e[0].reference : 0, o = "scale" in e[0] ? e[0].scale : 1, i = "reference" in e[1] ? e[1].reference : 0, s = "scale" in e[1] ? e[1].scale : 1, { x: l, y: u, lon: c, lat: h, data: d } = e[1], p = new Float32Array(d.length), f = new Float32Array(d.length);
|
|
1939
1955
|
for (let m = 0; m < d.length; m++) {
|
|
1940
|
-
const v = (t[m] * o + n) * Math.PI / 180,
|
|
1941
|
-
p[m] =
|
|
1956
|
+
const v = (t[m] * o + n) * Math.PI / 180, A = -(d[m] * s + i);
|
|
1957
|
+
p[m] = A * Math.sin(v), f[m] = A * Math.cos(v);
|
|
1942
1958
|
}
|
|
1943
1959
|
return [{ x: l, y: u, lon: c, lat: h, data: p }, { x: l, y: u, lon: c, lat: h, data: f }];
|
|
1944
1960
|
}, En = function({ shaderData: e, defaultProjectionData: t }) {
|
|
1945
1961
|
const n = e.variantName === "globe";
|
|
1946
|
-
a(this,
|
|
1962
|
+
a(this, $).u_matrix = n ? a(this, ve).transform.getProjectionData({
|
|
1947
1963
|
overscaledTileID: null,
|
|
1948
1964
|
applyGlobeMatrix: !0
|
|
1949
|
-
}).mainMatrix : t.mainMatrix, a(this,
|
|
1950
|
-
},
|
|
1951
|
-
a(this,
|
|
1952
|
-
},
|
|
1953
|
-
function
|
|
1954
|
-
const t = e[0], n = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], h = e[8], d = e[9], p = e[10], f = e[11], m = e[12], v = e[13],
|
|
1955
|
-
let D = C * F - b *
|
|
1956
|
-
D && (D = 1 / D, r[0] = (l * F - u *
|
|
1965
|
+
}).mainMatrix : t.mainMatrix, a(this, $).u_matrix_inverse || (a(this, $).u_matrix_inverse = new Float32Array(16), oa(a(this, $).u_matrix_inverse, a(this, $).u_matrix));
|
|
1966
|
+
}, sr = function(e) {
|
|
1967
|
+
a(this, $).u_matrix_inverse = void 0, a(this, K).buffer && (S(this, V, or).call(this, e), e.bindFramebuffer(e.FRAMEBUFFER, a(this, K).buffer), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.bindFramebuffer(e.FRAMEBUFFER, null));
|
|
1968
|
+
}, Gr);
|
|
1969
|
+
function oa(r, e) {
|
|
1970
|
+
const t = e[0], n = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], h = e[8], d = e[9], p = e[10], f = e[11], m = e[12], v = e[13], A = e[14], R = e[15], C = t * l - n * s, b = t * u - o * s, B = t * c - i * s, L = n * u - o * l, M = n * c - i * l, T = o * c - i * u, I = h * v - d * m, w = h * A - p * m, _ = h * R - f * m, k = d * A - p * v, N = d * R - f * v, F = p * R - f * A;
|
|
1971
|
+
let D = C * F - b * N + B * k + L * _ - M * w + T * I;
|
|
1972
|
+
D && (D = 1 / D, r[0] = (l * F - u * N + c * k) * D, r[1] = (o * N - n * F - i * k) * D, r[2] = (v * T - A * M + R * L) * D, r[3] = (p * M - d * T - f * L) * D, r[4] = (u * _ - s * F - c * w) * D, r[5] = (t * F - o * _ + i * w) * D, r[6] = (A * B - m * T - R * b) * D, r[7] = (h * T - p * B + f * b) * D, r[8] = (s * N - l * _ + c * I) * D, r[9] = (n * _ - t * N - i * I) * D, r[10] = (m * M - v * B + R * C) * D, r[11] = (d * B - h * M - f * C) * D, r[12] = (l * w - s * k - u * I) * D, r[13] = (t * k - n * w + o * I) * D, r[14] = (v * b - m * L - A * C) * D, r[15] = (h * L - d * b + p * C) * D);
|
|
1957
1973
|
}
|
|
1958
|
-
var
|
|
1959
|
-
|
|
1960
|
-
function
|
|
1974
|
+
var aa = "isoline-tile", ia = 2;
|
|
1975
|
+
sa(ia * 2 + 1, 1);
|
|
1976
|
+
function sa(r, e) {
|
|
1961
1977
|
const t = r + 1, n = new Float32Array(t * e);
|
|
1962
1978
|
for (let o = 0; o < e; o++) {
|
|
1963
1979
|
const i = new Float32Array(r), s = new Float32Array(r);
|
|
@@ -1975,7 +1991,7 @@ function aa(r, e) {
|
|
|
1975
1991
|
}
|
|
1976
1992
|
return n;
|
|
1977
1993
|
}
|
|
1978
|
-
var
|
|
1994
|
+
var vt = {
|
|
1979
1995
|
interval: 0,
|
|
1980
1996
|
offset: 0,
|
|
1981
1997
|
tension: 1,
|
|
@@ -1993,27 +2009,27 @@ var mt = {
|
|
|
1993
2009
|
},
|
|
1994
2010
|
style: void 0,
|
|
1995
2011
|
opacity: 1
|
|
1996
|
-
}, ge,
|
|
2012
|
+
}, ge, Bt, Rn, Nr, la = (Nr = class extends cr {
|
|
1997
2013
|
constructor(e) {
|
|
1998
2014
|
super(e);
|
|
1999
|
-
|
|
2000
|
-
|
|
2015
|
+
E(this, Bt);
|
|
2016
|
+
E(this, ge);
|
|
2001
2017
|
/**
|
|
2002
2018
|
* @internal
|
|
2003
2019
|
*/
|
|
2004
2020
|
g(this, "loadTile", async (e, t) => {
|
|
2005
|
-
var d, p, f, m, v,
|
|
2006
|
-
const n = S(this,
|
|
2021
|
+
var d, p, f, m, v, A, R, C, b;
|
|
2022
|
+
const n = S(this, Bt, Rn).call(this, e, t);
|
|
2007
2023
|
if (!n) return null;
|
|
2008
2024
|
const o = a(this, ge), i = t > 0 || o.label === null ? void 0 : {
|
|
2009
2025
|
...o.label,
|
|
2010
2026
|
convert: o.label.convert.toString()
|
|
2011
2027
|
}, { width: s, color: l, dash: u } = o, c = o.style ?? {}, h = {
|
|
2012
2028
|
below: { width: ((d = c.below) == null ? void 0 : d.width) ?? s, color: ((p = c.below) == null ? void 0 : p.color) ?? l, dash: ((f = c.below) == null ? void 0 : f.dash) ?? u },
|
|
2013
|
-
at: { width: ((m = c.at) == null ? void 0 : m.width) ?? s, color: ((v = c.at) == null ? void 0 : v.color) ?? l, dash: ((
|
|
2029
|
+
at: { width: ((m = c.at) == null ? void 0 : m.width) ?? s, color: ((v = c.at) == null ? void 0 : v.color) ?? l, dash: ((A = c.at) == null ? void 0 : A.dash) ?? u },
|
|
2014
2030
|
above: { width: ((R = c.above) == null ? void 0 : R.width) ?? s, color: ((C = c.above) == null ? void 0 : C.color) ?? l, dash: ((b = c.above) == null ? void 0 : b.dash) ?? u }
|
|
2015
2031
|
};
|
|
2016
|
-
return this.renderFactory.exec(
|
|
2032
|
+
return this.renderFactory.exec(aa, {
|
|
2017
2033
|
canvas: { type: "2d", size: this.tileSize * 2 },
|
|
2018
2034
|
data: {
|
|
2019
2035
|
interval: o.interval,
|
|
@@ -2027,13 +2043,13 @@ var mt = {
|
|
|
2027
2043
|
}
|
|
2028
2044
|
}, [n]);
|
|
2029
2045
|
});
|
|
2030
|
-
|
|
2046
|
+
x(this, ge, Object.assign({}, vt, e)), a(this, ge).label = e.label === null ? null : Object.assign({}, vt.label, e.label);
|
|
2031
2047
|
}
|
|
2032
2048
|
setOptions(e) {
|
|
2033
|
-
|
|
2049
|
+
x(this, ge, Object.assign({}, vt, e)), a(this, ge).label = e.label === null ? null : Object.assign({}, vt.label, e.label), super.setOptions(e);
|
|
2034
2050
|
}
|
|
2035
|
-
}, ge = new WeakMap(),
|
|
2036
|
-
const { bound: n } = a(this, ge), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, [i, s] =
|
|
2051
|
+
}, ge = new WeakMap(), Bt = new WeakSet(), Rn = function(e, t) {
|
|
2052
|
+
const { bound: n } = a(this, ge), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, [i, s] = Or(e, o, a(this, ge).cell, n, 5);
|
|
2037
2053
|
if (i.length === 0 || s.length === 0) return null;
|
|
2038
2054
|
const l = d(this.data0, i, s);
|
|
2039
2055
|
if (t > 0) {
|
|
@@ -2044,21 +2060,21 @@ var mt = {
|
|
|
2044
2060
|
const u = 2 + i.length + s.length, c = new Float32Array(u + l.length);
|
|
2045
2061
|
let h = 0;
|
|
2046
2062
|
c[h++] = i.length, c[h++] = s.length;
|
|
2047
|
-
for (const p of i) c[h++] =
|
|
2048
|
-
for (const p of s) c[h++] =
|
|
2063
|
+
for (const p of i) c[h++] = Qr(e, p);
|
|
2064
|
+
for (const p of s) c[h++] = jr(e, p);
|
|
2049
2065
|
return c.set(l, u), c.buffer;
|
|
2050
2066
|
function d(p, f, m) {
|
|
2051
|
-
if (!Array.isArray(p)) return
|
|
2052
|
-
if (p.length === 1) return
|
|
2053
|
-
const v =
|
|
2067
|
+
if (!Array.isArray(p)) return mt(p, f, m);
|
|
2068
|
+
if (p.length === 1) return mt(p[0], f, m);
|
|
2069
|
+
const v = mt(p[0], f, m), A = mt(p[1], f, m);
|
|
2054
2070
|
for (let R = 0; R < v.length; R++)
|
|
2055
|
-
v[R] = Math.hypot(v[R],
|
|
2071
|
+
v[R] = Math.hypot(v[R], A[R]);
|
|
2056
2072
|
return v;
|
|
2057
2073
|
}
|
|
2058
|
-
},
|
|
2059
|
-
function
|
|
2074
|
+
}, Nr);
|
|
2075
|
+
function Rr(r, e) {
|
|
2060
2076
|
var o;
|
|
2061
|
-
const t = new
|
|
2077
|
+
const t = new _o({
|
|
2062
2078
|
interactive: !0,
|
|
2063
2079
|
attributionControl: !1,
|
|
2064
2080
|
maplibreLogo: !1,
|
|
@@ -2080,7 +2096,7 @@ function Ar(r, e) {
|
|
|
2080
2096
|
validateStyle: !1,
|
|
2081
2097
|
...r,
|
|
2082
2098
|
// @ts-ignore
|
|
2083
|
-
style:
|
|
2099
|
+
style: ao
|
|
2084
2100
|
}), n = r.tiandituToken ?? ((o = window == null ? void 0 : window.present) == null ? void 0 : o.tiandituToken) ?? "";
|
|
2085
2101
|
return t.on("load", () => {
|
|
2086
2102
|
t.resize(), n && (t.addSource("baselayersource__tian-di-tu", {
|
|
@@ -2128,7 +2144,7 @@ function Ar(r, e) {
|
|
|
2128
2144
|
}), n && t.setLayoutProperty("baselayer__bing-map-layer", "visibility", "none"), t.setMinZoom(2);
|
|
2129
2145
|
}), t;
|
|
2130
2146
|
}
|
|
2131
|
-
class
|
|
2147
|
+
class ca {
|
|
2132
2148
|
/**
|
|
2133
2149
|
* 创建渲染器实例
|
|
2134
2150
|
* @param name - 渲染器名称(可选),用作 ID 前缀
|
|
@@ -2155,11 +2171,11 @@ class sa {
|
|
|
2155
2171
|
* ```
|
|
2156
2172
|
*/
|
|
2157
2173
|
createId() {
|
|
2158
|
-
return this.name ? `${this.name}__${
|
|
2174
|
+
return this.name ? `${this.name}__${At()}` : At();
|
|
2159
2175
|
}
|
|
2160
2176
|
}
|
|
2161
|
-
const
|
|
2162
|
-
class
|
|
2177
|
+
const ua = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADNkKWqAAAKyUlEQVR4Xu3Wy5LcOBIFUf7/T6sVaiGLuOIDuUS4n01ryCDNPIoJm+OQJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEm68eu3vCYJog4A4iEwuontEh71AKB2S5doPwbqAUDtRvOPfY/2g6D1DtTuP5DRJ/T+K7QfBK23nJtJ3f9Axx/X/dSPYnRT2mm9Z980fzO7ndZxC879Pz8H1k7I3XmNYqUd8V20jltw/iPTdkHtHqjd5a79/E3czbSCiHyA+UNfoHYP2T++hbzeUTaS2ie44EDuJ7eX0f/z0+fsg9w+wYb/Re4ntxfyj5/cPqEvgNxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9sLuZ/cPqEvgtxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9sLuZ/cPqEvgtxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9sLuZ/cPqEvgtxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9sLuZ/cPqEvgtxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9s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p66ureXu7Zz+93M7p66urdPriJJC8hGcvu4Ru0nt49rlP6PcyxxAaOV3D7+Te0nt49/0/o/zvFvC3i7v6Nv2t9mdnNu79a2YrV9ZWY35/a3trf7W1uJW13Ujt6aure/dXXvz2tn5PbSuf/jLu4cfzfTwV0bub2Q+23v3/+Rkaj4g91/1Ujut53RPhnB1AWQ+8+t5H7bWe0T+gJW+t/u7+rc/tb3dn9H37S/zeyG3D5pHbfgqX/88Z9mdrbS1nkHb02292yf3AUi4o/r/tF+da+Tu75z/91MB3dttvdun2QobQHnTnL7+N/U/nM7oT8bSe2Tc/iQM53R28d/qf3k9vFfYv8HOv5g9492en9eT6tzOxlNb10rM1trHbeA3E9uL2/948f/Nrejt6bO7ZP2gS/I/VftmA//uO4vhB3ctRHaJ5jQG+T+czvuwz/+/duTdpCNpPYJLjiQ+88fPXEP2V9ypqvRSmyfYMP/IveT2wv5hz/aqf0f9AWQ+8nthdx/1T4OxKt7baFiL5D7ye2F3H9uH4cech/I6BNyP7m9kPt/jrz/5X0MdPzB7ie3F3I/uX1CXwS5n9xeyP3k9gl9EeR+cnsh95PbJUmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSfvz6K69LUnvjALyT85LURh54q/I9krSdPNhW5DskaUt5uD3JZyVpa3nIXclnJKmFPOzOclaSWvHQk4TlwScJ6/z//oackaSW8vB7k89L0rbygFuV75Gk7eTBtiLfIUlbysPtST4rSVvLQy7lvCS1kQfekHOS1I4HnyQsDz5JWB5+krA8ACVheQBKwvIAlITlASgJywNQEpYHoCQsD0BJWB6AkrA8ACVheQBKwvIAlITlASgJywNQEpYHoCQsD0BJWB6AkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRpxX+Za5BAn/xiHwAAAABJRU5ErkJggg==";
|
|
2178
|
+
class da {
|
|
2163
2179
|
constructor(e, t, n) {
|
|
2164
2180
|
g(this, "bluestar");
|
|
2165
2181
|
g(this, "viewer");
|
|
@@ -2237,20 +2253,21 @@ class ca {
|
|
|
2237
2253
|
}
|
|
2238
2254
|
/** 创建热力图图层 */
|
|
2239
2255
|
createColorMapLayer(e) {
|
|
2240
|
-
const { colorRamp: t, colorRampDefaultColor: n, linearValue: o,
|
|
2241
|
-
n &&
|
|
2256
|
+
const { colorRamp: t, colorRampDefaultColor: n, linearValue: o, linearColorRamp: i, alpha: s } = this.state, l = t.map((u) => [u.value, u.color]).flat();
|
|
2257
|
+
n && l.unshift(n), this.colorMapLayer = new Fo({
|
|
2242
2258
|
id: this.colorMapId,
|
|
2243
2259
|
source: e.ftype === "UV" ? this.valueDirectionSourceId : this.sourceId,
|
|
2244
2260
|
dataFilter: o ? "linear" : "nearest",
|
|
2245
|
-
|
|
2246
|
-
|
|
2261
|
+
colorRampFilter: i ? "linear" : "nearest",
|
|
2262
|
+
color: l,
|
|
2263
|
+
opacity: s,
|
|
2247
2264
|
elevation: 0
|
|
2248
2265
|
});
|
|
2249
2266
|
}
|
|
2250
2267
|
/** 创建文本图层(网格数值) */
|
|
2251
2268
|
createTextLayer(e) {
|
|
2252
2269
|
const { gridValueStyle: t, gridValueFormat: n, cell: o } = this.state;
|
|
2253
|
-
this.gridValueLayer = new
|
|
2270
|
+
this.gridValueLayer = new zo({
|
|
2254
2271
|
id: this.gridValueId,
|
|
2255
2272
|
source: e.ftype === "UV" ? this.valueDirectionSourceId : this.sourceId,
|
|
2256
2273
|
cell: o,
|
|
@@ -2281,12 +2298,12 @@ class ca {
|
|
|
2281
2298
|
convert: o.format ?? i ?? ((l) => l.toFixed(1))
|
|
2282
2299
|
} : null
|
|
2283
2300
|
};
|
|
2284
|
-
n.cell && (s.cell = n.cell), this.contourLayer = new
|
|
2301
|
+
n.cell && (s.cell = n.cell), this.contourLayer = new la(s);
|
|
2285
2302
|
}
|
|
2286
2303
|
/** 创建向量和粒子图层 */
|
|
2287
2304
|
createVectorAndParticleLayers(e) {
|
|
2288
2305
|
const { level: t, vectorColor: n, cell: o, vectorImage: i, particleConfig: s, colorRamp: l } = this.state, u = e.ftype.toLowerCase();
|
|
2289
|
-
this.vectorLayer = new
|
|
2306
|
+
this.vectorLayer = new Jo({
|
|
2290
2307
|
id: this.vectorLayerId,
|
|
2291
2308
|
source: this.valueDirectionSourceId,
|
|
2292
2309
|
level: [...t],
|
|
@@ -2294,7 +2311,7 @@ class ca {
|
|
|
2294
2311
|
color: n,
|
|
2295
2312
|
cell: o,
|
|
2296
2313
|
image: {
|
|
2297
|
-
src: (i == null ? void 0 : i.url) ??
|
|
2314
|
+
src: (i == null ? void 0 : i.url) ?? ua,
|
|
2298
2315
|
count: [
|
|
2299
2316
|
(i == null ? void 0 : i.column) ?? 5,
|
|
2300
2317
|
(i == null ? void 0 : i.row) ?? 5
|
|
@@ -2303,7 +2320,7 @@ class ca {
|
|
|
2303
2320
|
}
|
|
2304
2321
|
});
|
|
2305
2322
|
const h = (s.colorRamp ?? l).map((d) => [d.value, d.color]).flat();
|
|
2306
|
-
this.particleLayer = new
|
|
2323
|
+
this.particleLayer = new na({
|
|
2307
2324
|
id: this.particleLayerId,
|
|
2308
2325
|
source: this.valueDirectionSourceId,
|
|
2309
2326
|
color: h,
|
|
@@ -2328,7 +2345,7 @@ class ca {
|
|
|
2328
2345
|
this.colorMapId && this.viewer.removeLayer(this.colorMapId), this.gridValueId && this.viewer.removeLayer(this.gridValueId), this.contourLayerId && this.viewer.removeLayer(this.contourLayerId), this.vectorLayer && this.viewer.removeLayer(this.vectorLayerId), this.particleLayer && this.viewer.removeLayer(this.particleLayerId), this.valueDirectionSource && this.viewer.removeSource(this.valueDirectionSourceId), this.viewer.removeSource(this.sourceId);
|
|
2329
2346
|
}
|
|
2330
2347
|
}
|
|
2331
|
-
function
|
|
2348
|
+
function ha() {
|
|
2332
2349
|
return {
|
|
2333
2350
|
name: void 0,
|
|
2334
2351
|
fillFulling: !0,
|
|
@@ -2336,6 +2353,7 @@ function ua() {
|
|
|
2336
2353
|
gridValue: !1,
|
|
2337
2354
|
level: [0, 0.2, 1.5, 3.3, 5.4, 7.9, 10.7, 13.8, 17.1, 20.7, 24.4, 28.4, 32.6, 36.9, 41.4, 46.1, 50.9, 56, 61.2],
|
|
2338
2355
|
linearValue: !1,
|
|
2356
|
+
linearColorRamp: !1,
|
|
2339
2357
|
contour: [],
|
|
2340
2358
|
contourStyle: {
|
|
2341
2359
|
width: 2,
|
|
@@ -2376,7 +2394,7 @@ function ua() {
|
|
|
2376
2394
|
zeroToNaN: !1
|
|
2377
2395
|
};
|
|
2378
2396
|
}
|
|
2379
|
-
class
|
|
2397
|
+
class dr {
|
|
2380
2398
|
constructor(e, t, n) {
|
|
2381
2399
|
g(this, "bluestar");
|
|
2382
2400
|
g(this, "viewer");
|
|
@@ -2397,12 +2415,12 @@ class ur {
|
|
|
2397
2415
|
g(this, "valueDirectionSource");
|
|
2398
2416
|
g(this, "_watchersSetup", !1);
|
|
2399
2417
|
g(this, "wegRenderer");
|
|
2400
|
-
this.bluestar = e, this.viewer = e.viewer, this.wegRenderer = n, this.state =
|
|
2418
|
+
this.bluestar = e, this.viewer = e.viewer, this.wegRenderer = n, this.state = Ne(ha()), this.applyConfig(t);
|
|
2401
2419
|
}
|
|
2402
2420
|
/** 将用户配置合并到响应式 state 中 */
|
|
2403
2421
|
applyConfig(e) {
|
|
2404
2422
|
const t = this.state;
|
|
2405
|
-
e.name !== void 0 && (t.name = e.name), e.colorRamp && (t.colorRamp = e.colorRamp), e.colorRampDefaultColor !== void 0 && (t.colorRampDefaultColor = e.colorRampDefaultColor), e.fillFulling !== void 0 && (t.fillFulling = e.fillFulling), e.linearValue !== void 0 && (t.linearValue = e.linearValue), e.gridValue !== void 0 && (t.gridValue = e.gridValue), e.gridValueFormat && (t.gridValueFormat = e.gridValueFormat), e.direction !== void 0 && (t.direction = e.direction), e.alpha !== void 0 && (t.alpha = e.alpha), e.zeroToNaN !== void 0 && (t.zeroToNaN = e.zeroToNaN), e.particle !== void 0 && (t.particle = e.particle), e.level && (t.level = [...e.level]), e.cell !== void 0 && (t.cell = e.cell), e.vectorColor !== void 0 && (t.vectorColor = e.vectorColor), e.vectorImage && (t.vectorImage = { ...e.vectorImage }), e.contour && (t.contour = [...e.contour]), e.contourStyle && Object.assign(t.contourStyle, e.contourStyle), e.contourLabel && Object.assign(t.contourLabel, e.contourLabel), e.gridValueStyle && Object.assign(t.gridValueStyle, e.gridValueStyle), e.particleConfig && Object.assign(t.particleConfig, e.particleConfig), e.particleSize !== void 0 && (t.particleConfig.size = e.particleSize), e.particleSpeed !== void 0 && (t.particleConfig.speed = e.particleSpeed), e.particleDisappear !== void 0 && (t.particleConfig.disappear = e.particleDisappear), e.particleColorRamp && (t.particleConfig.colorRamp = e.particleColorRamp);
|
|
2423
|
+
e.name !== void 0 && (t.name = e.name), e.colorRamp && (t.colorRamp = e.colorRamp), e.colorRampDefaultColor !== void 0 && (t.colorRampDefaultColor = e.colorRampDefaultColor), e.fillFulling !== void 0 && (t.fillFulling = e.fillFulling), e.linearValue !== void 0 && (t.linearValue = e.linearValue), e.linearColorRamp !== void 0 && (t.linearColorRamp = e.linearColorRamp), e.gridValue !== void 0 && (t.gridValue = e.gridValue), e.gridValueFormat && (t.gridValueFormat = e.gridValueFormat), e.direction !== void 0 && (t.direction = e.direction), e.alpha !== void 0 && (t.alpha = e.alpha), e.zeroToNaN !== void 0 && (t.zeroToNaN = e.zeroToNaN), e.particle !== void 0 && (t.particle = e.particle), e.level && (t.level = [...e.level]), e.cell !== void 0 && (t.cell = e.cell), e.vectorColor !== void 0 && (t.vectorColor = e.vectorColor), e.vectorImage && (t.vectorImage = { ...e.vectorImage }), e.contour && (t.contour = [...e.contour]), e.contourStyle && Object.assign(t.contourStyle, e.contourStyle), e.contourLabel && Object.assign(t.contourLabel, e.contourLabel), e.gridValueStyle && Object.assign(t.gridValueStyle, e.gridValueStyle), e.particleConfig && Object.assign(t.particleConfig, e.particleConfig), e.particleSize !== void 0 && (t.particleConfig.size = e.particleSize), e.particleSpeed !== void 0 && (t.particleConfig.speed = e.particleSpeed), e.particleDisappear !== void 0 && (t.particleConfig.disappear = e.particleDisappear), e.particleColorRamp && (t.particleConfig.colorRamp = e.particleColorRamp);
|
|
2406
2424
|
}
|
|
2407
2425
|
/**
|
|
2408
2426
|
* 绑定图层引用并启动 watcher 监听
|
|
@@ -2413,21 +2431,21 @@ class ur {
|
|
|
2413
2431
|
}
|
|
2414
2432
|
/** 建立 watch 监听:state 变化 → 自动更新图层 */
|
|
2415
2433
|
setupWatchers() {
|
|
2416
|
-
this._watchersSetup || (this._watchersSetup = !0,
|
|
2434
|
+
this._watchersSetup || (this._watchersSetup = !0, P(() => this.state.fillFulling, (e) => {
|
|
2417
2435
|
this.colorMapId && this.viewer.setLayoutProperty(this.colorMapId, "visibility", e ? "visible" : "none");
|
|
2418
|
-
}),
|
|
2436
|
+
}), P(() => this.state.particle, (e) => {
|
|
2419
2437
|
this.particleLayer && (this.particleLayer.visible = e);
|
|
2420
|
-
}),
|
|
2438
|
+
}), P(() => this.state.gridValue, (e) => {
|
|
2421
2439
|
this.gridValueId && this.viewer.setLayoutProperty(this.gridValueId, "visibility", e ? "visible" : "none");
|
|
2422
|
-
}),
|
|
2440
|
+
}), P(() => this.state.direction, (e) => {
|
|
2423
2441
|
this.vectorLayerId && this.viewer.setLayoutProperty(this.vectorLayerId, "visibility", e ? "visible" : "none");
|
|
2424
|
-
}),
|
|
2442
|
+
}), P(() => this.state.level, (e) => {
|
|
2425
2443
|
this.vectorLayer && this.vectorLayer.setOptions({ level: [...this.state.level], color: this.state.vectorColor });
|
|
2426
|
-
}),
|
|
2444
|
+
}), P(() => this.state.vectorColor, (e) => {
|
|
2427
2445
|
this.vectorLayer && this.vectorLayer.setOptions({ color: e, level: [...this.state.level], cell: this.state.cell });
|
|
2428
|
-
}),
|
|
2446
|
+
}), P(() => this.state.cell, (e) => {
|
|
2429
2447
|
this.vectorLayer && this.vectorLayer.setOptions({ cell: e, level: [...this.state.level], color: this.state.vectorColor }), this.gridValueLayer && this.gridValueLayer.setOptions({ cell: e ?? 4 });
|
|
2430
|
-
}),
|
|
2448
|
+
}), P(() => this.state.colorRamp, () => this.updateHeatmapLayer()), P(() => this.state.colorRampDefaultColor, () => this.updateHeatmapLayer()), P(() => this.state.alpha, () => this.updateHeatmapLayer()), P(() => this.state.linearValue, () => this.updateHeatmapLayer()), P(() => this.state.linearColorRamp, () => this.updateHeatmapLayer()), P(() => this.state.contour, () => this.updateIsolineLayer(), { deep: !0 }), P(() => this.state.contourStyle, () => this.updateIsolineLayer(), { deep: !0 }), P(() => this.state.contourLabel, () => this.updateIsolineLayer(), { deep: !0 }), P(() => this.state.gridValueStyle, () => this.updateTextLayer(), { deep: !0 }), P(() => this.state.gridValueFormat, () => this.updateTextLayer()));
|
|
2431
2449
|
}
|
|
2432
2450
|
// ======================== 图层更新方法 ========================
|
|
2433
2451
|
updateHeatmapLayer() {
|
|
@@ -2465,7 +2483,7 @@ class ur {
|
|
|
2465
2483
|
}
|
|
2466
2484
|
updateTextLayer() {
|
|
2467
2485
|
if (!this.gridValueLayer) return;
|
|
2468
|
-
const { gridValueStyle: e, gridValueFormat: t } = this.state, n =
|
|
2486
|
+
const { gridValueStyle: e, gridValueFormat: t } = this.state, n = dr.checkGridValueColor(
|
|
2469
2487
|
e.color ?? ((o) => "#000")
|
|
2470
2488
|
);
|
|
2471
2489
|
this.gridValueLayer.setOptions({
|
|
@@ -2477,7 +2495,7 @@ class ur {
|
|
|
2477
2495
|
// ======================== 静态工具方法 ========================
|
|
2478
2496
|
static checkGridValueColor(e) {
|
|
2479
2497
|
if (typeof e == "string") {
|
|
2480
|
-
if (
|
|
2498
|
+
if (pt.rgbaMatcher.test(e) || pt.rrggbbaaMatcher.test(e) || pt.rgbParenthesesMatcher.test(e) || pt.hslParenthesesMatcher.test(e)) return () => e;
|
|
2481
2499
|
try {
|
|
2482
2500
|
const n = new Function(`return (${e})`)();
|
|
2483
2501
|
return n(1), n;
|
|
@@ -2504,7 +2522,7 @@ class ur {
|
|
|
2504
2522
|
this.wegRenderer.layerManager.createSource(e);
|
|
2505
2523
|
}
|
|
2506
2524
|
}
|
|
2507
|
-
class
|
|
2525
|
+
class fa extends ca {
|
|
2508
2526
|
/**
|
|
2509
2527
|
* 构造函数,初始化 Weg 渲染器并添加对应的地图图层
|
|
2510
2528
|
* @param bluestar - BlueStar 实例
|
|
@@ -2520,7 +2538,7 @@ class da extends sa {
|
|
|
2520
2538
|
g(this, "propertyController");
|
|
2521
2539
|
if (this.bluestar = t, !o)
|
|
2522
2540
|
throw new Error("weg config 不能为空");
|
|
2523
|
-
this.propertyController = new
|
|
2541
|
+
this.propertyController = new dr(t, o, this), this.layerManager = new da(t, this.propertyController.state, this), this.layerManager.createLayers(n), this.propertyController.bindLayers({
|
|
2524
2542
|
sourceId: this.layerManager.sourceId,
|
|
2525
2543
|
colorMapId: this.layerManager.colorMapId,
|
|
2526
2544
|
gridValueId: this.layerManager.gridValueId,
|
|
@@ -2930,14 +2948,14 @@ class da extends sa {
|
|
|
2930
2948
|
this.layerManager.destroy();
|
|
2931
2949
|
}
|
|
2932
2950
|
}
|
|
2933
|
-
function
|
|
2951
|
+
function pa(r) {
|
|
2934
2952
|
return new Promise((e, t) => {
|
|
2935
2953
|
r.toBlob((n) => {
|
|
2936
2954
|
n ? e(URL.createObjectURL(n)) : t(new Error("Failed to convert canvas to blob."));
|
|
2937
2955
|
}, "image/png");
|
|
2938
2956
|
});
|
|
2939
2957
|
}
|
|
2940
|
-
async function
|
|
2958
|
+
async function Tr(r, e = 1) {
|
|
2941
2959
|
const { width: t, height: n, block: o, ftype: i, pixelFormat: s } = r;
|
|
2942
2960
|
if (s !== "RGB")
|
|
2943
2961
|
throw new Error(`Weg 文件格式错误:期望 pixelFormat 为 "RGB",实际为 "${s}"`);
|
|
@@ -2953,13 +2971,13 @@ async function Rr(r, e = 1) {
|
|
|
2953
2971
|
throw new Error("无法获取 Canvas 2D 上下文");
|
|
2954
2972
|
const h = c.createImageData(t, n), d = h.data;
|
|
2955
2973
|
for (let f = 0; f < t * n; f++) {
|
|
2956
|
-
const m = f * 3, v = f * 4,
|
|
2957
|
-
d[v] = isNaN(
|
|
2974
|
+
const m = f * 3, v = f * 4, A = l[m], R = l[m + 1], C = l[m + 2];
|
|
2975
|
+
d[v] = isNaN(A) ? 0 : Math.round(A), d[v + 1] = isNaN(R) ? 0 : Math.round(R), d[v + 2] = isNaN(C) ? 0 : Math.round(C);
|
|
2958
2976
|
let b = 255;
|
|
2959
2977
|
e !== 1 && (b = Math.round(255 * e)), b = Math.min(255, Math.max(0, b)), d[v + 3] = b;
|
|
2960
2978
|
}
|
|
2961
2979
|
return c.putImageData(h, 0, 0), {
|
|
2962
|
-
uri: await
|
|
2980
|
+
uri: await pa(u),
|
|
2963
2981
|
west: r.west,
|
|
2964
2982
|
north: r.north,
|
|
2965
2983
|
east: r.east,
|
|
@@ -2967,7 +2985,7 @@ async function Rr(r, e = 1) {
|
|
|
2967
2985
|
alpha: e
|
|
2968
2986
|
};
|
|
2969
2987
|
}
|
|
2970
|
-
class
|
|
2988
|
+
class ma {
|
|
2971
2989
|
/**
|
|
2972
2990
|
* 创建图片渲染器实例
|
|
2973
2991
|
* @param bluestar - BlueStar 实例
|
|
@@ -3014,7 +3032,7 @@ class fa {
|
|
|
3014
3032
|
alpha: 1,
|
|
3015
3033
|
linerValue: !0
|
|
3016
3034
|
}), this.map = o;
|
|
3017
|
-
const i =
|
|
3035
|
+
const i = At(), s = At();
|
|
3018
3036
|
this.sourceId = i, this.imageLayerId = s, this.bound = {
|
|
3019
3037
|
west: t.west,
|
|
3020
3038
|
south: t.south,
|
|
@@ -3031,7 +3049,7 @@ class fa {
|
|
|
3031
3049
|
const t = this.map;
|
|
3032
3050
|
let n, o;
|
|
3033
3051
|
if ("dtype" in e)
|
|
3034
|
-
this._wegFile = e, o = await
|
|
3052
|
+
this._wegFile = e, o = await Tr(e), n = o.uri, this.uri = n;
|
|
3035
3053
|
else {
|
|
3036
3054
|
if (o = e, !o.url) throw new Error("url is required");
|
|
3037
3055
|
n = o.url;
|
|
@@ -3126,7 +3144,7 @@ class fa {
|
|
|
3126
3144
|
async setWegData(e) {
|
|
3127
3145
|
if (!("dtype" in e))
|
|
3128
3146
|
throw new Error("数据不是 weg");
|
|
3129
|
-
const t = await
|
|
3147
|
+
const t = await Tr(e);
|
|
3130
3148
|
this._wegFile = e, this.setImage(t.uri, t), this.uri = t.uri;
|
|
3131
3149
|
}
|
|
3132
3150
|
/**
|
|
@@ -3177,8 +3195,8 @@ class fa {
|
|
|
3177
3195
|
this.map.removeLayer(this.imageLayerId), this.map.removeSource(this.sourceId), this.uri && URL.revokeObjectURL(this.uri);
|
|
3178
3196
|
}
|
|
3179
3197
|
}
|
|
3180
|
-
const
|
|
3181
|
-
class
|
|
3198
|
+
const Mi = new Wn();
|
|
3199
|
+
class va {
|
|
3182
3200
|
/**
|
|
3183
3201
|
* 创建 BlueStar 实例
|
|
3184
3202
|
*
|
|
@@ -3204,9 +3222,9 @@ class pa {
|
|
|
3204
3222
|
/** 浮窗组件实例列表 */
|
|
3205
3223
|
g(this, "bubbleList", []);
|
|
3206
3224
|
this.domId = e.domId;
|
|
3207
|
-
const n =
|
|
3208
|
-
e.incomponent === void 0 || e.incomponent === !0 ? (
|
|
3209
|
-
e.domId && e.domId.value && (this.domId = e.domId.value), this.map =
|
|
3225
|
+
const n = zr();
|
|
3226
|
+
e.incomponent === void 0 || e.incomponent === !0 ? (Sn("blueStar", this), lr(() => {
|
|
3227
|
+
e.domId && e.domId.value && (this.domId = e.domId.value), this.map = Rr({
|
|
3210
3228
|
...e.config,
|
|
3211
3229
|
container: this.domId
|
|
3212
3230
|
}), this.viewer = this.map, this.map.on("load", () => {
|
|
@@ -3220,9 +3238,9 @@ class pa {
|
|
|
3220
3238
|
o.loadResult.blueStar = this, o.callback(this, o.loadResult.useApiInterceptor);
|
|
3221
3239
|
}), this.listener["BlueStar:ready"] = [], this.initBubbleClick();
|
|
3222
3240
|
});
|
|
3223
|
-
}),
|
|
3241
|
+
}), _n(() => {
|
|
3224
3242
|
this.destroy();
|
|
3225
|
-
})) : (this.map =
|
|
3243
|
+
})) : (this.map = Rr({
|
|
3226
3244
|
...e.config,
|
|
3227
3245
|
container: this.domId
|
|
3228
3246
|
}), this.viewer = this.map, this.map.on("load", () => {
|
|
@@ -3322,7 +3340,7 @@ class pa {
|
|
|
3322
3340
|
*/
|
|
3323
3341
|
renderWeg(e, t) {
|
|
3324
3342
|
if (!this.map) throw new Error("请先初始化地图");
|
|
3325
|
-
return new
|
|
3343
|
+
return new fa(this, e, t);
|
|
3326
3344
|
}
|
|
3327
3345
|
/**
|
|
3328
3346
|
* 渲染图片叠加层
|
|
@@ -3359,7 +3377,7 @@ class pa {
|
|
|
3359
3377
|
*/
|
|
3360
3378
|
renderImage(e, t) {
|
|
3361
3379
|
if (!this.map) throw new Error("请先初始化地图");
|
|
3362
|
-
return new
|
|
3380
|
+
return new ma(this, e, t);
|
|
3363
3381
|
}
|
|
3364
3382
|
/**
|
|
3365
3383
|
* 添加事件监听器
|
|
@@ -3454,13 +3472,13 @@ class pa {
|
|
|
3454
3472
|
return this.map.getLayerLevelRule();
|
|
3455
3473
|
}
|
|
3456
3474
|
}
|
|
3457
|
-
function
|
|
3475
|
+
function Gt(r = () => {
|
|
3458
3476
|
}) {
|
|
3459
|
-
const e =
|
|
3477
|
+
const e = kn("blueStar", null), t = zr(), n = {
|
|
3460
3478
|
blueStar: e,
|
|
3461
3479
|
useApiInterceptor: t
|
|
3462
3480
|
};
|
|
3463
|
-
return
|
|
3481
|
+
return lr(() => {
|
|
3464
3482
|
const o = e;
|
|
3465
3483
|
if (o)
|
|
3466
3484
|
o.viewer ? (n.blueStar = o, r(o, t)) : o.addEventListener("BlueStar:ready", r, n);
|
|
@@ -3468,7 +3486,7 @@ function Nt(r = () => {
|
|
|
3468
3486
|
throw new Error("请检查上级组件是否创建了 BlueStar 实例");
|
|
3469
3487
|
}), n;
|
|
3470
3488
|
}
|
|
3471
|
-
const
|
|
3489
|
+
const ya = ["data-bluestar-bubble-id"], ga = /* @__PURE__ */ $e({
|
|
3472
3490
|
__name: "bubble",
|
|
3473
3491
|
props: {
|
|
3474
3492
|
lon: {},
|
|
@@ -3482,7 +3500,7 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3482
3500
|
},
|
|
3483
3501
|
emits: ["click"],
|
|
3484
3502
|
setup(r, { expose: e, emit: t }) {
|
|
3485
|
-
const n =
|
|
3503
|
+
const n = Mn(), o = r, i = t, s = Ne({
|
|
3486
3504
|
x: 0,
|
|
3487
3505
|
y: 0,
|
|
3488
3506
|
active: !0
|
|
@@ -3502,27 +3520,27 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3502
3520
|
o.window || i("click", o.data, o.id);
|
|
3503
3521
|
}
|
|
3504
3522
|
});
|
|
3505
|
-
const h =
|
|
3523
|
+
const h = Gt((d) => {
|
|
3506
3524
|
u = d.viewer, c(), u.on("move", c), o.window || h.blueStar.bubbleList.push(n);
|
|
3507
3525
|
});
|
|
3508
|
-
return
|
|
3526
|
+
return Dt(() => {
|
|
3509
3527
|
const d = h.blueStar.bubbleList.findIndex((p) => n === p);
|
|
3510
3528
|
d >= 0 && h.blueStar.bubbleList.splice(d, 1), u.off("move", c);
|
|
3511
|
-
}), (d, p) => (
|
|
3529
|
+
}), (d, p) => (Z(), G("div", {
|
|
3512
3530
|
class: pe(["bluestar-bubble-container", { "no-event": o.window ? "" : "no-event" }]),
|
|
3513
3531
|
"data-bluestar-bubble-id": o.id,
|
|
3514
3532
|
style: tt(`position: absolute;left: calc(${s.x}px + ${o.offsetX}rem); top: calc(${s.y}px + ${o.offsetY}rem)`),
|
|
3515
3533
|
onClick: p[0] || (p[0] = (f) => i("click", o.data, o.id))
|
|
3516
3534
|
}, [
|
|
3517
|
-
|
|
3518
|
-
], 14,
|
|
3535
|
+
Zt(d.$slots, "default", {}, void 0, !0)
|
|
3536
|
+
], 14, ya));
|
|
3519
3537
|
}
|
|
3520
|
-
}),
|
|
3538
|
+
}), dt = (r, e) => {
|
|
3521
3539
|
const t = r.__vccOpts || r;
|
|
3522
3540
|
for (const [n, o] of e)
|
|
3523
3541
|
t[n] = o;
|
|
3524
3542
|
return t;
|
|
3525
|
-
},
|
|
3543
|
+
}, ba = /* @__PURE__ */ dt(ga, [["__scopeId", "data-v-fb281ccf"]]), Ia = /* @__PURE__ */ $e({
|
|
3526
3544
|
__name: "bubble-manager",
|
|
3527
3545
|
props: {
|
|
3528
3546
|
data: { default: () => [] },
|
|
@@ -3532,15 +3550,15 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3532
3550
|
clusterPixelRange: { default: 100 }
|
|
3533
3551
|
},
|
|
3534
3552
|
setup(r) {
|
|
3535
|
-
const e = r, t =
|
|
3553
|
+
const e = r, t = Ne({
|
|
3536
3554
|
list: [],
|
|
3537
3555
|
groupCountList: []
|
|
3538
|
-
}), n =
|
|
3556
|
+
}), n = Gt(() => {
|
|
3539
3557
|
i(), n.blueStar.viewer.on("move", i);
|
|
3540
3558
|
});
|
|
3541
|
-
|
|
3559
|
+
Dt(() => {
|
|
3542
3560
|
n.blueStar.viewer.off("move", i);
|
|
3543
|
-
}),
|
|
3561
|
+
}), P(() => [e.data, e.idKey, e.latKey, e.lonKey], i);
|
|
3544
3562
|
let o;
|
|
3545
3563
|
function i() {
|
|
3546
3564
|
o && clearTimeout(o), o = setTimeout(() => {
|
|
@@ -3548,26 +3566,26 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3548
3566
|
for (let m = 0; m < e.data.length; m++) {
|
|
3549
3567
|
const v = e.data[m];
|
|
3550
3568
|
if (v[e.lonKey] >= l && v[e.lonKey] <= u && v[e.latKey] >= c && v[e.latKey] <= h) {
|
|
3551
|
-
const
|
|
3552
|
-
if (!
|
|
3553
|
-
const R = p.findIndex((C) => Math.sqrt((C.x -
|
|
3554
|
-
R < 0 ? (d.push(v), p.push(
|
|
3569
|
+
const A = n.blueStar.viewer.project([v[e.lonKey], v[e.latKey]]);
|
|
3570
|
+
if (!A) break;
|
|
3571
|
+
const R = p.findIndex((C) => Math.sqrt((C.x - A.x) ** 2 + (C.y - A.y) ** 2) < Ot(e.clusterPixelRange));
|
|
3572
|
+
R < 0 ? (d.push(v), p.push(A), f.push([v])) : f[R].push(v);
|
|
3555
3573
|
}
|
|
3556
3574
|
}
|
|
3557
3575
|
t.list = d, t.groupCountList = f;
|
|
3558
3576
|
}, 100);
|
|
3559
3577
|
}
|
|
3560
|
-
return (s, l) => (
|
|
3578
|
+
return (s, l) => (Z(!0), G(xe, null, Ge(t.list, (u, c) => Zt(s.$slots, "default", {
|
|
3561
3579
|
value: u,
|
|
3562
3580
|
count: t.groupCountList[c].length,
|
|
3563
3581
|
group: t.groupCountList[c],
|
|
3564
3582
|
key: u[e.idKey]
|
|
3565
3583
|
})), 128));
|
|
3566
3584
|
}
|
|
3567
|
-
}),
|
|
3585
|
+
}), Ca = {
|
|
3568
3586
|
key: 0,
|
|
3569
3587
|
style: { position: "absolute", top: "0", left: "0", width: "100%", height: "100%", "pointer-events": "none", overflow: "hidden" }
|
|
3570
|
-
},
|
|
3588
|
+
}, Aa = ["onClick"], xa = 5e3, Ea = /* @__PURE__ */ $e({
|
|
3571
3589
|
__name: "bubble-overlay",
|
|
3572
3590
|
props: {
|
|
3573
3591
|
data: {},
|
|
@@ -3582,32 +3600,32 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3582
3600
|
},
|
|
3583
3601
|
emits: ["click"],
|
|
3584
3602
|
setup(r, { emit: e }) {
|
|
3585
|
-
const t = r, n = e, o =
|
|
3603
|
+
const t = r, n = e, o = mr(() => Array.isArray(t.data) ? t.data : t.data ? [t.data] : []), i = mr(() => o.value.length > 0), s = Vn([]), l = {};
|
|
3586
3604
|
let u = 16;
|
|
3587
3605
|
function c() {
|
|
3588
3606
|
return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
3589
3607
|
}
|
|
3590
3608
|
let h, d = null;
|
|
3591
|
-
|
|
3592
|
-
h = I.viewer, u = c(),
|
|
3593
|
-
}),
|
|
3609
|
+
Gt((I) => {
|
|
3610
|
+
h = I.viewer, u = c(), A(), h.on("move", p), h.on("zoomend", f), h.on("click", T);
|
|
3611
|
+
}), Dt(() => {
|
|
3594
3612
|
h && (h.off("move", p), h.off("zoomend", f), h.off("click", T)), d == null || d.terminate();
|
|
3595
|
-
}),
|
|
3613
|
+
}), P(
|
|
3596
3614
|
() => [o.value.length, t.lonKey, t.latKey, t.clusterPixelRange],
|
|
3597
|
-
() =>
|
|
3615
|
+
() => A(),
|
|
3598
3616
|
{ flush: "post" }
|
|
3599
3617
|
);
|
|
3600
3618
|
function p() {
|
|
3601
3619
|
R();
|
|
3602
3620
|
}
|
|
3603
3621
|
function f() {
|
|
3604
|
-
u = c(),
|
|
3622
|
+
u = c(), A();
|
|
3605
3623
|
}
|
|
3606
3624
|
function m(I) {
|
|
3607
3625
|
return new Promise((w) => setTimeout(w, I));
|
|
3608
3626
|
}
|
|
3609
3627
|
let v = 0;
|
|
3610
|
-
async function
|
|
3628
|
+
async function A() {
|
|
3611
3629
|
const I = ++v;
|
|
3612
3630
|
if (await m(80), I !== v) return;
|
|
3613
3631
|
const w = o.value;
|
|
@@ -3615,27 +3633,27 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3615
3633
|
s.value = [];
|
|
3616
3634
|
return;
|
|
3617
3635
|
}
|
|
3618
|
-
const _ = h.getBounds(), k = _.getWest(),
|
|
3619
|
-
for (let
|
|
3636
|
+
const _ = h.getBounds(), k = _.getWest(), N = _.getEast(), F = _.getSouth(), D = _.getNorth(), Q = [], Ye = 5e3;
|
|
3637
|
+
for (let ee = 0; ee < w.length; ee += Ye) {
|
|
3620
3638
|
if (I !== v) return;
|
|
3621
|
-
const
|
|
3622
|
-
for (let
|
|
3623
|
-
const
|
|
3624
|
-
if (
|
|
3625
|
-
const
|
|
3626
|
-
Q.push({ item: { ...
|
|
3639
|
+
const hr = Math.min(ee + Ye, w.length);
|
|
3640
|
+
for (let Nt = ee; Nt < hr; Nt++) {
|
|
3641
|
+
const Yt = w[Nt], ht = Yt[t.lonKey], ft = Yt[t.latKey];
|
|
3642
|
+
if (ht == null || ft == null || ht < k || ht > N || ft < F || ft > D) continue;
|
|
3643
|
+
const fr = h.project([ht, ft]);
|
|
3644
|
+
Q.push({ item: { ...Yt }, x: fr.x, y: fr.y });
|
|
3627
3645
|
}
|
|
3628
|
-
if (
|
|
3646
|
+
if (hr < w.length && (await m(0), I !== v))
|
|
3629
3647
|
return;
|
|
3630
3648
|
}
|
|
3631
|
-
const Fe = w.length >=
|
|
3632
|
-
I === v && (s.value = Fe.map((
|
|
3633
|
-
id:
|
|
3634
|
-
x:
|
|
3635
|
-
y:
|
|
3636
|
-
count:
|
|
3637
|
-
group:
|
|
3638
|
-
original:
|
|
3649
|
+
const Fe = w.length >= xa ? await B(Q) : C(Q);
|
|
3650
|
+
I === v && (s.value = Fe.map((ee) => ({
|
|
3651
|
+
id: ee.item[t.idKey] ?? `${ee.x}-${ee.y}`,
|
|
3652
|
+
x: ee.x,
|
|
3653
|
+
y: ee.y,
|
|
3654
|
+
count: ee.group.length,
|
|
3655
|
+
group: ee.group,
|
|
3656
|
+
original: ee.item
|
|
3639
3657
|
})));
|
|
3640
3658
|
}
|
|
3641
3659
|
function R() {
|
|
@@ -3643,26 +3661,26 @@ const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
|
3643
3661
|
if (!I.length || !h) return;
|
|
3644
3662
|
const w = t.offsetX * u, _ = t.offsetY * u;
|
|
3645
3663
|
for (const k of I) {
|
|
3646
|
-
const
|
|
3664
|
+
const N = h.project([
|
|
3647
3665
|
k.original[t.lonKey],
|
|
3648
3666
|
k.original[t.latKey]
|
|
3649
3667
|
]), F = l[k.id];
|
|
3650
|
-
F && (F.style.transform = `translate3d(${
|
|
3668
|
+
F && (F.style.transform = `translate3d(${N.x + w}px,${N.y + _}px,0)`);
|
|
3651
3669
|
}
|
|
3652
3670
|
}
|
|
3653
3671
|
function C(I) {
|
|
3654
|
-
const w =
|
|
3672
|
+
const w = Ot(t.clusterPixelRange) || t.clusterPixelRange, _ = /* @__PURE__ */ new Map();
|
|
3655
3673
|
for (const k of I) {
|
|
3656
|
-
const
|
|
3674
|
+
const N = Math.floor(k.x / w), F = Math.floor(k.y / w);
|
|
3657
3675
|
let D = !1;
|
|
3658
3676
|
for (let Q = -1; Q <= 1 && !D; Q++)
|
|
3659
3677
|
for (let Ye = -1; Ye <= 1 && !D; Ye++) {
|
|
3660
|
-
const Fe = _.get(`${
|
|
3678
|
+
const Fe = _.get(`${N + Q},${F + Ye}`);
|
|
3661
3679
|
Fe && Math.sqrt(
|
|
3662
3680
|
(k.x - Fe.x) ** 2 + (k.y - Fe.y) ** 2
|
|
3663
3681
|
) < w && (Fe.group.push(k.item), D = !0);
|
|
3664
3682
|
}
|
|
3665
|
-
D || _.set(`${
|
|
3683
|
+
D || _.set(`${N},${F}`, {
|
|
3666
3684
|
item: k.item,
|
|
3667
3685
|
x: k.x,
|
|
3668
3686
|
y: k.y,
|
|
@@ -3716,12 +3734,12 @@ self.onmessage = function(e) {
|
|
|
3716
3734
|
}
|
|
3717
3735
|
function B(I) {
|
|
3718
3736
|
return new Promise((w) => {
|
|
3719
|
-
const _ = b(), k = (
|
|
3720
|
-
_.removeEventListener("message", k), w(
|
|
3737
|
+
const _ = b(), k = (N) => {
|
|
3738
|
+
_.removeEventListener("message", k), w(N.data.result);
|
|
3721
3739
|
};
|
|
3722
3740
|
_.addEventListener("message", k), _.postMessage({
|
|
3723
3741
|
visible: I,
|
|
3724
|
-
cellSize:
|
|
3742
|
+
cellSize: Ot(t.clusterPixelRange) || t.clusterPixelRange
|
|
3725
3743
|
});
|
|
3726
3744
|
});
|
|
3727
3745
|
}
|
|
@@ -3734,8 +3752,8 @@ self.onmessage = function(e) {
|
|
|
3734
3752
|
function T(I) {
|
|
3735
3753
|
if (t.window || !t.clickable) return;
|
|
3736
3754
|
const { clientX: w, clientY: _ } = I.originalEvent, k = s.value;
|
|
3737
|
-
for (let
|
|
3738
|
-
const F = k[
|
|
3755
|
+
for (let N = k.length - 1; N >= 0; N--) {
|
|
3756
|
+
const F = k[N], D = l[F.id];
|
|
3739
3757
|
if (!D) continue;
|
|
3740
3758
|
const Q = D.getBoundingClientRect();
|
|
3741
3759
|
if (w >= Q.left && w <= Q.right && _ >= Q.top && _ <= Q.bottom) {
|
|
@@ -3744,8 +3762,8 @@ self.onmessage = function(e) {
|
|
|
3744
3762
|
}
|
|
3745
3763
|
}
|
|
3746
3764
|
}
|
|
3747
|
-
return (I, w) => i.value ? (
|
|
3748
|
-
(
|
|
3765
|
+
return (I, w) => i.value ? (Z(), G("div", Ca, [
|
|
3766
|
+
(Z(!0), G(xe, null, Ge(s.value, (_) => (Z(), G("div", {
|
|
3749
3767
|
key: _.id,
|
|
3750
3768
|
ref_for: !0,
|
|
3751
3769
|
ref: (k) => L(_.id, k),
|
|
@@ -3753,24 +3771,24 @@ self.onmessage = function(e) {
|
|
|
3753
3771
|
position: "absolute",
|
|
3754
3772
|
left: 0,
|
|
3755
3773
|
top: 0,
|
|
3756
|
-
transform: `translate3d(${_.x + I.offsetX *
|
|
3774
|
+
transform: `translate3d(${_.x + I.offsetX * Wt(u)}px,${_.y + I.offsetY * Wt(u)}px,0)`,
|
|
3757
3775
|
// window=false 时始终穿透,拖拽不阻塞,点击由 map.click 命中检测处理
|
|
3758
3776
|
pointerEvents: I.window && I.clickable ? "auto" : "none",
|
|
3759
3777
|
willChange: "transform"
|
|
3760
3778
|
}),
|
|
3761
|
-
onClick:
|
|
3779
|
+
onClick: Bn((k) => M(_), ["stop"])
|
|
3762
3780
|
}, [
|
|
3763
|
-
|
|
3781
|
+
Zt(I.$slots, "default", {
|
|
3764
3782
|
item: _.original,
|
|
3765
3783
|
count: _.count,
|
|
3766
3784
|
group: _.group,
|
|
3767
3785
|
x: _.x,
|
|
3768
3786
|
y: _.y
|
|
3769
3787
|
})
|
|
3770
|
-
], 12,
|
|
3788
|
+
], 12, Aa))), 128))
|
|
3771
3789
|
])) : be("", !0);
|
|
3772
3790
|
}
|
|
3773
|
-
}),
|
|
3791
|
+
}), Ra = { class: "map-contaienr" }, Ta = {
|
|
3774
3792
|
__name: "map",
|
|
3775
3793
|
props: {
|
|
3776
3794
|
config: {
|
|
@@ -3779,23 +3797,23 @@ self.onmessage = function(e) {
|
|
|
3779
3797
|
},
|
|
3780
3798
|
emits: ["load"],
|
|
3781
3799
|
setup(r, { emit: e }) {
|
|
3782
|
-
const t = e, n = r, o = le(null), i = new
|
|
3800
|
+
const t = e, n = r, o = le(null), i = new va({
|
|
3783
3801
|
// @ts-ignore
|
|
3784
|
-
domId:
|
|
3785
|
-
config:
|
|
3802
|
+
domId: vr(o),
|
|
3803
|
+
config: vr(n.config)
|
|
3786
3804
|
}, () => {
|
|
3787
3805
|
t("load", i);
|
|
3788
3806
|
});
|
|
3789
|
-
return (s, l) => (
|
|
3807
|
+
return (s, l) => (Z(), G("div", Ra, [
|
|
3790
3808
|
y("div", {
|
|
3791
3809
|
ref_key: "mapContainer",
|
|
3792
3810
|
ref: o,
|
|
3793
3811
|
class: "map-contaienr"
|
|
3794
3812
|
}, null, 512),
|
|
3795
|
-
|
|
3813
|
+
Zt(s.$slots, "default", {}, void 0, !0)
|
|
3796
3814
|
]));
|
|
3797
3815
|
}
|
|
3798
|
-
},
|
|
3816
|
+
}, Tn = /* @__PURE__ */ dt(Ta, [["__scopeId", "data-v-151cd952"]]), wa = [
|
|
3799
3817
|
{
|
|
3800
3818
|
name: "降水",
|
|
3801
3819
|
colors: [
|
|
@@ -3918,19 +3936,19 @@ self.onmessage = function(e) {
|
|
|
3918
3936
|
{ color: "#000000", value: 100 }
|
|
3919
3937
|
]
|
|
3920
3938
|
}
|
|
3921
|
-
],
|
|
3939
|
+
], La = { class: "color-bar-dialog" }, Sa = { class: "dialog-body" }, _a = { class: "preset-management" }, ka = { class: "preset-list" }, Ma = ["onClick"], Va = { class: "preset-colors-preview" }, Ba = {
|
|
3922
3940
|
key: 0,
|
|
3923
3941
|
class: "more-count"
|
|
3924
|
-
},
|
|
3942
|
+
}, Da = { class: "preset-info" }, Za = { class: "preset-name-wrapper" }, Ga = { class: "preset-name" }, Na = {
|
|
3925
3943
|
key: 0,
|
|
3926
3944
|
class: "preset-badge"
|
|
3927
|
-
},
|
|
3945
|
+
}, Ya = { class: "preset-count" }, Fa = ["onClick"], Pa = {
|
|
3928
3946
|
key: 0,
|
|
3929
3947
|
class: "empty-preset-tip"
|
|
3930
|
-
},
|
|
3948
|
+
}, Xa = { class: "section-title-wrapper" }, Wa = { class: "color-actions" }, za = { class: "current-count" }, Ka = { class: "color-list" }, Oa = { class: "color-index" }, Ha = { class: "color-input-wrapper" }, Ua = ["onUpdate:modelValue"], Qa = { class: "color-input-wrapper" }, ja = ["onUpdate:modelValue"], Ja = ["onClick"], $a = {
|
|
3931
3949
|
key: 0,
|
|
3932
3950
|
class: "save-dialog-overlay"
|
|
3933
|
-
},
|
|
3951
|
+
}, qa = { class: "save-dialog" }, wr = "bluestar-color-presets", ei = /* @__PURE__ */ $e({
|
|
3934
3952
|
__name: "color-bar-edit",
|
|
3935
3953
|
props: {
|
|
3936
3954
|
modelValue: { default: () => [] }
|
|
@@ -3938,12 +3956,12 @@ self.onmessage = function(e) {
|
|
|
3938
3956
|
emits: ["confirm", "cancel"],
|
|
3939
3957
|
setup(r, { emit: e }) {
|
|
3940
3958
|
const t = r, n = e, o = le([...t.modelValue]), i = le([]), s = le(-1), l = le(!1), u = le(""), c = le(!1), h = le(""), d = le("success");
|
|
3941
|
-
|
|
3942
|
-
i.value =
|
|
3959
|
+
lr(() => {
|
|
3960
|
+
i.value = wa.map((I) => ({
|
|
3943
3961
|
...I,
|
|
3944
3962
|
isPreset: !0
|
|
3945
3963
|
}));
|
|
3946
|
-
const T = localStorage.getItem(
|
|
3964
|
+
const T = localStorage.getItem(wr);
|
|
3947
3965
|
if (T)
|
|
3948
3966
|
try {
|
|
3949
3967
|
JSON.parse(T).forEach((w) => {
|
|
@@ -3958,7 +3976,7 @@ self.onmessage = function(e) {
|
|
|
3958
3976
|
});
|
|
3959
3977
|
function p() {
|
|
3960
3978
|
const T = i.value.filter((I) => !I.isPreset);
|
|
3961
|
-
localStorage.setItem(
|
|
3979
|
+
localStorage.setItem(wr, JSON.stringify(T));
|
|
3962
3980
|
}
|
|
3963
3981
|
function f(T, I = "success") {
|
|
3964
3982
|
h.value = T, d.value = I, c.value = !0, setTimeout(() => {
|
|
@@ -3971,7 +3989,7 @@ self.onmessage = function(e) {
|
|
|
3971
3989
|
function v() {
|
|
3972
3990
|
l.value = !1, u.value = "";
|
|
3973
3991
|
}
|
|
3974
|
-
function
|
|
3992
|
+
function A() {
|
|
3975
3993
|
if (!u.value.trim()) {
|
|
3976
3994
|
f("请输入色卡名称", "error");
|
|
3977
3995
|
return;
|
|
@@ -4025,12 +4043,12 @@ self.onmessage = function(e) {
|
|
|
4025
4043
|
}, M = () => {
|
|
4026
4044
|
n("cancel");
|
|
4027
4045
|
};
|
|
4028
|
-
return (T, I) => (
|
|
4046
|
+
return (T, I) => (Z(), G("div", La, [
|
|
4029
4047
|
I[10] || (I[10] = y("div", { class: "dialog-header" }, [
|
|
4030
4048
|
y("h3", null, "颜色编辑")
|
|
4031
4049
|
], -1)),
|
|
4032
|
-
y("div",
|
|
4033
|
-
y("div",
|
|
4050
|
+
y("div", Sa, [
|
|
4051
|
+
y("div", _a, [
|
|
4034
4052
|
y("div", { class: "preset-header" }, [
|
|
4035
4053
|
I[2] || (I[2] = y("span", { class: "section-title" }, "我的色卡", -1)),
|
|
4036
4054
|
y("button", {
|
|
@@ -4049,28 +4067,28 @@ self.onmessage = function(e) {
|
|
|
4049
4067
|
qe(" 保存色卡 ", -1)
|
|
4050
4068
|
]))
|
|
4051
4069
|
]),
|
|
4052
|
-
y("div",
|
|
4053
|
-
(
|
|
4070
|
+
y("div", ka, [
|
|
4071
|
+
(Z(!0), G(xe, null, Ge(i.value, (w, _) => (Z(), G("div", {
|
|
4054
4072
|
key: _,
|
|
4055
4073
|
class: pe(["preset-item", { active: s.value === _ }]),
|
|
4056
4074
|
onClick: (k) => R(_)
|
|
4057
4075
|
}, [
|
|
4058
|
-
y("div",
|
|
4059
|
-
(
|
|
4060
|
-
key:
|
|
4076
|
+
y("div", Va, [
|
|
4077
|
+
(Z(!0), G(xe, null, Ge(w.colors.slice(0, 5), (k, N) => (Z(), G("div", {
|
|
4078
|
+
key: N,
|
|
4061
4079
|
class: "preview-color-block",
|
|
4062
4080
|
style: tt({ backgroundColor: k.color })
|
|
4063
4081
|
}, null, 4))), 128)),
|
|
4064
|
-
w.colors.length > 5 ? (
|
|
4082
|
+
w.colors.length > 5 ? (Z(), G("div", Ba, "+" + ce(w.colors.length - 5), 1)) : be("", !0)
|
|
4065
4083
|
]),
|
|
4066
|
-
y("div",
|
|
4067
|
-
y("div",
|
|
4068
|
-
y("span",
|
|
4069
|
-
w.isPreset ? (
|
|
4084
|
+
y("div", Da, [
|
|
4085
|
+
y("div", Za, [
|
|
4086
|
+
y("span", Ga, ce(w.name), 1),
|
|
4087
|
+
w.isPreset ? (Z(), G("span", Na, "预置")) : be("", !0)
|
|
4070
4088
|
]),
|
|
4071
|
-
y("span",
|
|
4089
|
+
y("span", Ya, ce(w.colors.length) + "个颜色", 1)
|
|
4072
4090
|
]),
|
|
4073
|
-
w.isPreset ? be("", !0) : (
|
|
4091
|
+
w.isPreset ? be("", !0) : (Z(), G("button", {
|
|
4074
4092
|
key: 0,
|
|
4075
4093
|
class: "btn-delete-preset",
|
|
4076
4094
|
onClick: (k) => C(_, k),
|
|
@@ -4084,14 +4102,14 @@ self.onmessage = function(e) {
|
|
|
4084
4102
|
}, [
|
|
4085
4103
|
y("path", { d: "M11.867 2.533l-.933-.933-3.734 3.733L3.467 1.6 2.533 2.533l3.734 3.734L2.533 10l.934.933 3.734-3.733 3.733 3.733.934-.933-3.734-3.733 3.734-3.734z" })
|
|
4086
4104
|
], -1)
|
|
4087
|
-
]), 8,
|
|
4088
|
-
], 10,
|
|
4089
|
-
i.value.length === 0 ? (
|
|
4105
|
+
]), 8, Fa))
|
|
4106
|
+
], 10, Ma))), 128)),
|
|
4107
|
+
i.value.length === 0 ? (Z(), G("div", Pa, ' 暂无保存的色卡,点击"保存色卡"创建 ')) : be("", !0)
|
|
4090
4108
|
])
|
|
4091
4109
|
]),
|
|
4092
|
-
y("div",
|
|
4110
|
+
y("div", Xa, [
|
|
4093
4111
|
I[5] || (I[5] = y("span", { class: "section-title" }, "使用色卡", -1)),
|
|
4094
|
-
y("div",
|
|
4112
|
+
y("div", Wa, [
|
|
4095
4113
|
y("button", {
|
|
4096
4114
|
class: "btn-add-color",
|
|
4097
4115
|
onClick: b,
|
|
@@ -4107,15 +4125,15 @@ self.onmessage = function(e) {
|
|
|
4107
4125
|
], -1),
|
|
4108
4126
|
qe(" 添加颜色 ", -1)
|
|
4109
4127
|
])),
|
|
4110
|
-
y("span",
|
|
4128
|
+
y("span", za, "共 " + ce(o.value.length) + " 个颜色", 1)
|
|
4111
4129
|
])
|
|
4112
4130
|
]),
|
|
4113
|
-
y("div",
|
|
4114
|
-
(
|
|
4131
|
+
y("div", Ka, [
|
|
4132
|
+
(Z(!0), G(xe, null, Ge(o.value, (w, _) => (Z(), G("div", {
|
|
4115
4133
|
class: "color-item",
|
|
4116
4134
|
key: _
|
|
4117
4135
|
}, [
|
|
4118
|
-
y("div",
|
|
4136
|
+
y("div", Oa, ce(_ + 1), 1),
|
|
4119
4137
|
y("div", {
|
|
4120
4138
|
class: "color-preview",
|
|
4121
4139
|
style: tt({ backgroundColor: w.color })
|
|
@@ -4127,7 +4145,7 @@ self.onmessage = function(e) {
|
|
|
4127
4145
|
type: "number",
|
|
4128
4146
|
"onUpdate:modelValue": (k) => w.value = k,
|
|
4129
4147
|
step: "0.1"
|
|
4130
|
-
}, null, 8,
|
|
4148
|
+
}, null, 8, Ua), [
|
|
4131
4149
|
[
|
|
4132
4150
|
et,
|
|
4133
4151
|
w.value,
|
|
@@ -4136,13 +4154,13 @@ self.onmessage = function(e) {
|
|
|
4136
4154
|
]
|
|
4137
4155
|
])
|
|
4138
4156
|
]),
|
|
4139
|
-
y("div",
|
|
4157
|
+
y("div", Qa, [
|
|
4140
4158
|
I[7] || (I[7] = y("label", null, "颜色:", -1)),
|
|
4141
4159
|
ke(y("input", {
|
|
4142
4160
|
class: "color-picker",
|
|
4143
4161
|
type: "color",
|
|
4144
4162
|
"onUpdate:modelValue": (k) => w.color = k
|
|
4145
|
-
}, null, 8,
|
|
4163
|
+
}, null, 8, ja), [
|
|
4146
4164
|
[et, w.color]
|
|
4147
4165
|
])
|
|
4148
4166
|
]),
|
|
@@ -4159,7 +4177,7 @@ self.onmessage = function(e) {
|
|
|
4159
4177
|
}, [
|
|
4160
4178
|
y("path", { d: "M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0z" })
|
|
4161
4179
|
], -1)
|
|
4162
|
-
]), 8,
|
|
4180
|
+
]), 8, Ja)
|
|
4163
4181
|
]))), 128))
|
|
4164
4182
|
])
|
|
4165
4183
|
]),
|
|
@@ -4173,8 +4191,8 @@ self.onmessage = function(e) {
|
|
|
4173
4191
|
onClick: L
|
|
4174
4192
|
}, "确认")
|
|
4175
4193
|
]),
|
|
4176
|
-
l.value ? (
|
|
4177
|
-
y("div",
|
|
4194
|
+
l.value ? (Z(), G("div", $a, [
|
|
4195
|
+
y("div", qa, [
|
|
4178
4196
|
I[9] || (I[9] = y("h4", null, "保存色卡", -1)),
|
|
4179
4197
|
ke(y("input", {
|
|
4180
4198
|
type: "text",
|
|
@@ -4182,8 +4200,8 @@ self.onmessage = function(e) {
|
|
|
4182
4200
|
placeholder: "请输入色卡名称",
|
|
4183
4201
|
class: "preset-name-input",
|
|
4184
4202
|
onKeyup: [
|
|
4185
|
-
|
|
4186
|
-
|
|
4203
|
+
zt(A, ["enter"]),
|
|
4204
|
+
zt(v, ["esc"])
|
|
4187
4205
|
],
|
|
4188
4206
|
autofocus: ""
|
|
4189
4207
|
}, null, 544), [
|
|
@@ -4196,14 +4214,14 @@ self.onmessage = function(e) {
|
|
|
4196
4214
|
}, "取消"),
|
|
4197
4215
|
y("button", {
|
|
4198
4216
|
class: "btn btn-small btn-confirm",
|
|
4199
|
-
onClick:
|
|
4217
|
+
onClick: A
|
|
4200
4218
|
}, "保存")
|
|
4201
4219
|
])
|
|
4202
4220
|
])
|
|
4203
4221
|
])) : be("", !0),
|
|
4204
|
-
|
|
4205
|
-
default:
|
|
4206
|
-
c.value ? (
|
|
4222
|
+
Kt(Dn, { name: "toast" }, {
|
|
4223
|
+
default: Yr(() => [
|
|
4224
|
+
c.value ? (Z(), G("div", {
|
|
4207
4225
|
key: 0,
|
|
4208
4226
|
class: pe(["toast", "toast-" + d.value])
|
|
4209
4227
|
}, ce(h.value), 3)) : be("", !0)
|
|
@@ -4212,7 +4230,7 @@ self.onmessage = function(e) {
|
|
|
4212
4230
|
})
|
|
4213
4231
|
]));
|
|
4214
4232
|
}
|
|
4215
|
-
}),
|
|
4233
|
+
}), ti = /* @__PURE__ */ dt(ei, [["__scopeId", "data-v-b42a8bd9"]]), ri = { class: "color-value" }, ni = /* @__PURE__ */ $e({
|
|
4216
4234
|
__name: "color-bar",
|
|
4217
4235
|
props: {
|
|
4218
4236
|
modelValue: { default: () => [] },
|
|
@@ -4220,7 +4238,7 @@ self.onmessage = function(e) {
|
|
|
4220
4238
|
},
|
|
4221
4239
|
emits: ["update:modelValue"],
|
|
4222
4240
|
setup(r) {
|
|
4223
|
-
const e =
|
|
4241
|
+
const e = Zn(r, "modelValue"), t = Ne({
|
|
4224
4242
|
editColor: [],
|
|
4225
4243
|
isEdit: !1
|
|
4226
4244
|
});
|
|
@@ -4230,21 +4248,21 @@ self.onmessage = function(e) {
|
|
|
4230
4248
|
function o(i) {
|
|
4231
4249
|
e.value = i, t.isEdit = !1, t.editColor = [];
|
|
4232
4250
|
}
|
|
4233
|
-
return (i, s) => (
|
|
4251
|
+
return (i, s) => (Z(), G(xe, null, [
|
|
4234
4252
|
y("div", {
|
|
4235
4253
|
class: "colorRamp",
|
|
4236
4254
|
onClick: n
|
|
4237
4255
|
}, [
|
|
4238
|
-
(
|
|
4256
|
+
(Z(!0), G(xe, null, Ge(e.value, (l) => (Z(), G("div", null, [
|
|
4239
4257
|
y("div", {
|
|
4240
4258
|
class: "color",
|
|
4241
4259
|
style: tt({ backgroundColor: l.color })
|
|
4242
4260
|
}, [
|
|
4243
|
-
y("div",
|
|
4261
|
+
y("div", ri, ce(l.value), 1)
|
|
4244
4262
|
], 4)
|
|
4245
4263
|
]))), 256))
|
|
4246
4264
|
]),
|
|
4247
|
-
t.isEdit ? (
|
|
4265
|
+
t.isEdit ? (Z(), Fr(ti, {
|
|
4248
4266
|
key: 0,
|
|
4249
4267
|
"model-value": t.editColor,
|
|
4250
4268
|
onCancel: n,
|
|
@@ -4252,11 +4270,11 @@ self.onmessage = function(e) {
|
|
|
4252
4270
|
}, null, 8, ["model-value"])) : be("", !0)
|
|
4253
4271
|
], 64));
|
|
4254
4272
|
}
|
|
4255
|
-
}),
|
|
4273
|
+
}), oi = /* @__PURE__ */ dt(ni, [["__scopeId", "data-v-0e80ba0d"]]), ai = /* @__PURE__ */ $e({
|
|
4256
4274
|
__name: "render",
|
|
4257
4275
|
setup(r, { expose: e }) {
|
|
4258
|
-
const t =
|
|
4259
|
-
}), n =
|
|
4276
|
+
const t = Gt(() => {
|
|
4277
|
+
}), n = Ne({
|
|
4260
4278
|
colors: [
|
|
4261
4279
|
{ value: 0, color: "#0000" },
|
|
4262
4280
|
{ value: 2, color: "#b9f297" },
|
|
@@ -4295,7 +4313,7 @@ self.onmessage = function(e) {
|
|
|
4295
4313
|
function s() {
|
|
4296
4314
|
o && (o.colorRamp = n.colors);
|
|
4297
4315
|
}
|
|
4298
|
-
return
|
|
4316
|
+
return Dt(() => o == null ? void 0 : o.destroy()), e({ renderWeg: i }), (l, u) => (Z(), Fr(oi, {
|
|
4299
4317
|
modelValue: n.colors,
|
|
4300
4318
|
"onUpdate:modelValue": [
|
|
4301
4319
|
u[0] || (u[0] = (c) => n.colors = c),
|
|
@@ -4303,16 +4321,16 @@ self.onmessage = function(e) {
|
|
|
4303
4321
|
]
|
|
4304
4322
|
}, null, 8, ["modelValue"]));
|
|
4305
4323
|
}
|
|
4306
|
-
}),
|
|
4324
|
+
}), ii = ["title"], si = {
|
|
4307
4325
|
key: 0,
|
|
4308
4326
|
class: "attribute-panel"
|
|
4309
|
-
},
|
|
4327
|
+
}, li = { class: "panel-header" }, ci = { class: "file-info" }, ui = { class: "attribute-table" }, di = { class: "field-name" }, hi = {
|
|
4310
4328
|
key: 0,
|
|
4311
4329
|
class: "edit-cell"
|
|
4312
|
-
},
|
|
4330
|
+
}, fi = ["type", "onUpdate:modelValue", "onBlur", "onKeypress"], pi = ["onClick"], mi = { class: "type-cell" }, vi = { class: "status-cell" }, yi = { class: "action-cell" }, gi = ["onClick"], bi = ["onClick"], Ii = { class: "add-field-section" }, Ci = { class: "add-field-form" }, Ai = { class: "export-section" }, xi = { class: "export-form" }, Ei = {
|
|
4313
4331
|
__name: "tool",
|
|
4314
4332
|
setup(r) {
|
|
4315
|
-
const e =
|
|
4333
|
+
const e = Ne({
|
|
4316
4334
|
baseInfo: null,
|
|
4317
4335
|
attributes: {
|
|
4318
4336
|
dtype: null,
|
|
@@ -4328,7 +4346,7 @@ self.onmessage = function(e) {
|
|
|
4328
4346
|
addType: "number",
|
|
4329
4347
|
fileName: ""
|
|
4330
4348
|
});
|
|
4331
|
-
let t =
|
|
4349
|
+
let t = Ne({
|
|
4332
4350
|
wegFile: null,
|
|
4333
4351
|
data: null,
|
|
4334
4352
|
directionData: null
|
|
@@ -4343,7 +4361,7 @@ self.onmessage = function(e) {
|
|
|
4343
4361
|
C && confirm("已存在缓存文件,是否加载?") && p(C);
|
|
4344
4362
|
}
|
|
4345
4363
|
async function u(C) {
|
|
4346
|
-
let b = await C.target.files[0].arrayBuffer(), B = await
|
|
4364
|
+
let b = await C.target.files[0].arrayBuffer(), B = await yr(b);
|
|
4347
4365
|
p(B);
|
|
4348
4366
|
}
|
|
4349
4367
|
async function c(C) {
|
|
@@ -4357,7 +4375,7 @@ self.onmessage = function(e) {
|
|
|
4357
4375
|
return;
|
|
4358
4376
|
}
|
|
4359
4377
|
try {
|
|
4360
|
-
let M = await B.arrayBuffer(), T = await
|
|
4378
|
+
let M = await B.arrayBuffer(), T = await yr(M);
|
|
4361
4379
|
p(T);
|
|
4362
4380
|
} catch (M) {
|
|
4363
4381
|
console.error("文件解析失败:", M), alert("文件解析失败,请确认文件格式正确");
|
|
@@ -4410,7 +4428,7 @@ self.onmessage = function(e) {
|
|
|
4410
4428
|
return "";
|
|
4411
4429
|
}
|
|
4412
4430
|
}
|
|
4413
|
-
function
|
|
4431
|
+
function A(C, b) {
|
|
4414
4432
|
C.value = t.wegFile[b] ?? "", C.type = typeof C.value == "string" ? "text" : "number", C.status = "初始值";
|
|
4415
4433
|
}
|
|
4416
4434
|
async function R() {
|
|
@@ -4422,15 +4440,15 @@ self.onmessage = function(e) {
|
|
|
4422
4440
|
const L = JSON.stringify(B), T = new TextEncoder().encode(L).buffer, I = new Int32Array([T.byteLength]), w = C.buffer;
|
|
4423
4441
|
let _;
|
|
4424
4442
|
b ? _ = new Blob([I, T, w, b], { type: "application/octet-stream" }) : _ = new Blob([I, T, w], { type: "application/octet-stream" });
|
|
4425
|
-
const k = await
|
|
4426
|
-
F.href =
|
|
4443
|
+
const k = await zn(_), N = URL.createObjectURL(k), F = document.createElement("a");
|
|
4444
|
+
F.href = N, F.download = (e.fileName ? e.fileName : "rebuild") + ".weg.gz", F.click(), URL.revokeObjectURL(N), alert("导出成功");
|
|
4427
4445
|
}
|
|
4428
4446
|
return (C, b) => {
|
|
4429
4447
|
var B;
|
|
4430
|
-
return
|
|
4431
|
-
|
|
4432
|
-
default:
|
|
4433
|
-
|
|
4448
|
+
return Z(), G(xe, null, [
|
|
4449
|
+
Kt(Tn, { onLoad: l }, {
|
|
4450
|
+
default: Yr(() => [
|
|
4451
|
+
Kt(ai, {
|
|
4434
4452
|
ref_key: "render",
|
|
4435
4453
|
ref: n
|
|
4436
4454
|
}, null, 512)
|
|
@@ -4445,7 +4463,7 @@ self.onmessage = function(e) {
|
|
|
4445
4463
|
onClick: s,
|
|
4446
4464
|
title: o.value ? "展开" : "折叠"
|
|
4447
4465
|
}, [
|
|
4448
|
-
(
|
|
4466
|
+
(Z(), G("svg", {
|
|
4449
4467
|
width: "20",
|
|
4450
4468
|
height: "20",
|
|
4451
4469
|
viewBox: "0 0 24 24",
|
|
@@ -4456,7 +4474,7 @@ self.onmessage = function(e) {
|
|
|
4456
4474
|
}, b[3] || (b[3] = [
|
|
4457
4475
|
y("polyline", { points: "15 18 9 12 15 6" }, null, -1)
|
|
4458
4476
|
]), 2))
|
|
4459
|
-
], 8,
|
|
4477
|
+
], 8, ii),
|
|
4460
4478
|
b[15] || (b[15] = y("div", { class: "tool-header" }, [
|
|
4461
4479
|
y("h2", null, "WEG 文件工具")
|
|
4462
4480
|
], -1)),
|
|
@@ -4473,14 +4491,14 @@ self.onmessage = function(e) {
|
|
|
4473
4491
|
class: "file-input",
|
|
4474
4492
|
accept: ".weg,.weg.gz"
|
|
4475
4493
|
}, null, 32),
|
|
4476
|
-
b[4] || (b[4] =
|
|
4494
|
+
b[4] || (b[4] = Gn('<label for="file-input" class="upload-label" data-v-19a6b16d><div class="upload-content" data-v-19a6b16d><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-19a6b16d><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" data-v-19a6b16d></path><polyline points="17 8 12 3 7 8" data-v-19a6b16d></polyline><line x1="12" y1="3" x2="12" y2="15" data-v-19a6b16d></line></svg><span data-v-19a6b16d>点击选择文件或拖动文件到此处</span><span class="upload-tip" data-v-19a6b16d>支持 .weg 和 .weg.gz 格式</span></div></label>', 1))
|
|
4477
4495
|
], 34),
|
|
4478
|
-
e.loaded ? (
|
|
4479
|
-
y("div",
|
|
4496
|
+
e.loaded ? (Z(), G("div", si, [
|
|
4497
|
+
y("div", li, [
|
|
4480
4498
|
b[5] || (b[5] = y("h3", null, "文件属性", -1)),
|
|
4481
|
-
y("span",
|
|
4499
|
+
y("span", ci, ce(((B = Wt(t).wegFile) == null ? void 0 : B.filename) || "未命名"), 1)
|
|
4482
4500
|
]),
|
|
4483
|
-
y("table",
|
|
4501
|
+
y("table", ui, [
|
|
4484
4502
|
b[9] || (b[9] = y("thead", null, [
|
|
4485
4503
|
y("tr", null, [
|
|
4486
4504
|
y("th", { width: "20%" }, "字段"),
|
|
@@ -4491,46 +4509,46 @@ self.onmessage = function(e) {
|
|
|
4491
4509
|
])
|
|
4492
4510
|
], -1)),
|
|
4493
4511
|
y("tbody", null, [
|
|
4494
|
-
(
|
|
4512
|
+
(Z(!0), G(xe, null, Ge(e.attributes, (L, M) => (Z(), G("tr", {
|
|
4495
4513
|
class: pe(v(L.status))
|
|
4496
4514
|
}, [
|
|
4497
|
-
y("td",
|
|
4515
|
+
y("td", di, ce(M), 1),
|
|
4498
4516
|
y("td", null, [
|
|
4499
|
-
L.modify ? (
|
|
4517
|
+
L.modify ? (Z(), G("div", hi, [
|
|
4500
4518
|
ke(y("input", {
|
|
4501
4519
|
type: L.type === "text" ? "text" : "number",
|
|
4502
4520
|
"onUpdate:modelValue": (T) => L.value = T,
|
|
4503
4521
|
onBlur: (T) => f(L, M),
|
|
4504
|
-
onKeypress:
|
|
4522
|
+
onKeypress: zt((T) => f(L, M), ["enter"]),
|
|
4505
4523
|
class: pe(["edit-input", L.type === "text" ? "text-input" : "number-input"])
|
|
4506
|
-
}, null, 42,
|
|
4524
|
+
}, null, 42, fi), [
|
|
4507
4525
|
[
|
|
4508
|
-
|
|
4526
|
+
Nn,
|
|
4509
4527
|
L.value,
|
|
4510
4528
|
void 0,
|
|
4511
4529
|
{ trim: !0 }
|
|
4512
4530
|
]
|
|
4513
4531
|
])
|
|
4514
|
-
])) : (
|
|
4532
|
+
])) : (Z(), G("div", {
|
|
4515
4533
|
key: 1,
|
|
4516
4534
|
class: "value-cell",
|
|
4517
4535
|
onClick: (T) => L.modify = !0
|
|
4518
4536
|
}, [
|
|
4519
4537
|
qe(ce(L.value) + " ", 1),
|
|
4520
4538
|
b[6] || (b[6] = y("span", { class: "edit-icon" }, "✏️", -1))
|
|
4521
|
-
], 8,
|
|
4539
|
+
], 8, pi))
|
|
4522
4540
|
]),
|
|
4523
|
-
y("td",
|
|
4541
|
+
y("td", mi, [
|
|
4524
4542
|
y("span", {
|
|
4525
4543
|
class: pe(["type-badge", L.type === "text" ? "type-string" : "type-number"])
|
|
4526
4544
|
}, ce(L.type === "text" ? "string" : "number"), 3)
|
|
4527
4545
|
]),
|
|
4528
|
-
y("td",
|
|
4546
|
+
y("td", vi, [
|
|
4529
4547
|
y("span", {
|
|
4530
4548
|
class: pe(["status-badge", "status-" + L.status.replace("已", "")])
|
|
4531
4549
|
}, ce(L.status), 3)
|
|
4532
4550
|
]),
|
|
4533
|
-
y("td",
|
|
4551
|
+
y("td", yi, [
|
|
4534
4552
|
y("button", {
|
|
4535
4553
|
onClick: (T) => L.status = "已删除",
|
|
4536
4554
|
class: "btn btn-delete",
|
|
@@ -4544,9 +4562,9 @@ self.onmessage = function(e) {
|
|
|
4544
4562
|
}, [
|
|
4545
4563
|
y("path", { d: "M11.867 2.533l-.933-.933-3.734 3.733L3.467 1.6 2.533 2.533l3.734 3.734L2.533 10l.934.933 3.733-3.733 3.733 3.733.934-.933-3.734-3.733 3.734-3.734z" })
|
|
4546
4564
|
], -1)
|
|
4547
|
-
]), 8,
|
|
4565
|
+
]), 8, gi),
|
|
4548
4566
|
y("button", {
|
|
4549
|
-
onClick: (T) =>
|
|
4567
|
+
onClick: (T) => A(L, M),
|
|
4550
4568
|
class: "btn btn-reset",
|
|
4551
4569
|
title: "重置"
|
|
4552
4570
|
}, b[8] || (b[8] = [
|
|
@@ -4563,14 +4581,14 @@ self.onmessage = function(e) {
|
|
|
4563
4581
|
y("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
4564
4582
|
y("path", { d: "M3 3v5h5" })
|
|
4565
4583
|
], -1)
|
|
4566
|
-
]), 8,
|
|
4584
|
+
]), 8, bi)
|
|
4567
4585
|
])
|
|
4568
4586
|
], 2))), 256))
|
|
4569
4587
|
])
|
|
4570
4588
|
]),
|
|
4571
|
-
y("div",
|
|
4589
|
+
y("div", Ii, [
|
|
4572
4590
|
b[12] || (b[12] = y("h4", null, "添加新字段", -1)),
|
|
4573
|
-
y("div",
|
|
4591
|
+
y("div", Ci, [
|
|
4574
4592
|
ke(y("select", {
|
|
4575
4593
|
"onUpdate:modelValue": b[0] || (b[0] = (L) => e.addType = L),
|
|
4576
4594
|
class: "type-select"
|
|
@@ -4578,7 +4596,7 @@ self.onmessage = function(e) {
|
|
|
4578
4596
|
y("option", { value: "number" }, "数值型 (number)", -1),
|
|
4579
4597
|
y("option", { value: "text" }, "文本型 (string)", -1)
|
|
4580
4598
|
]), 512), [
|
|
4581
|
-
[
|
|
4599
|
+
[Yn, e.addType]
|
|
4582
4600
|
]),
|
|
4583
4601
|
ke(y("input", {
|
|
4584
4602
|
type: "text",
|
|
@@ -4624,9 +4642,9 @@ self.onmessage = function(e) {
|
|
|
4624
4642
|
]))
|
|
4625
4643
|
])
|
|
4626
4644
|
]),
|
|
4627
|
-
y("div",
|
|
4645
|
+
y("div", Ai, [
|
|
4628
4646
|
b[14] || (b[14] = y("h4", null, "导出文件", -1)),
|
|
4629
|
-
y("div",
|
|
4647
|
+
y("div", xi, [
|
|
4630
4648
|
ke(y("input", {
|
|
4631
4649
|
type: "text",
|
|
4632
4650
|
"onUpdate:modelValue": b[2] || (b[2] = (L) => e.fileName = L),
|
|
@@ -4672,7 +4690,7 @@ self.onmessage = function(e) {
|
|
|
4672
4690
|
], 64);
|
|
4673
4691
|
};
|
|
4674
4692
|
}
|
|
4675
|
-
},
|
|
4693
|
+
}, Ri = /* @__PURE__ */ dt(Ei, [["__scopeId", "data-v-19a6b16d"]]), Vi = Ri, Bi = ba, Di = Ia, Zi = Ea, Gi = Tn, Ti = `#version 300 es\r
|
|
4676
4694
|
\r
|
|
4677
4695
|
precision mediump float;\r
|
|
4678
4696
|
\r
|
|
@@ -4684,18 +4702,18 @@ void main() {\r
|
|
|
4684
4702
|
v_uv = a_uv;\r
|
|
4685
4703
|
gl_Position = vec4(a_position, 0.0f, 1.0f);\r
|
|
4686
4704
|
}`;
|
|
4687
|
-
var we,
|
|
4705
|
+
var we, Ae, U, Ze, ut;
|
|
4688
4706
|
const Pe = class Pe {
|
|
4689
4707
|
constructor(e, t) {
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4708
|
+
E(this, we);
|
|
4709
|
+
E(this, Ae);
|
|
4710
|
+
E(this, U);
|
|
4711
|
+
E(this, Ze);
|
|
4712
|
+
E(this, ut);
|
|
4713
|
+
x(this, U, Object.assign({}, t)), this.addProtocol(), x(this, ut, `${a(this, U).name}://{z}/{x}/{y}`), x(this, Ae, new Kn({ gl: e.map.painter.context.gl })), x(this, Ze, a(this, Ae).gl.createTexture()), this.initWebGLTool(), x(this, we, e.map), a(this, we).addSource(`${t.name}__source`, {
|
|
4696
4714
|
type: "raster",
|
|
4697
4715
|
tiles: [
|
|
4698
|
-
a(this,
|
|
4716
|
+
a(this, ut)
|
|
4699
4717
|
],
|
|
4700
4718
|
tileSize: 256,
|
|
4701
4719
|
minzoom: 0,
|
|
@@ -4712,7 +4730,7 @@ const Pe = class Pe {
|
|
|
4712
4730
|
addProtocol() {
|
|
4713
4731
|
if (!a(this, U).name) throw new Error("TileLayerRender: name is required");
|
|
4714
4732
|
if (Pe.protocalRegister.has(a(this, U).name)) throw new Error(`TileLayerRender: ${a(this, U).name} is already registered`);
|
|
4715
|
-
|
|
4733
|
+
Pn(a(this, U).name, async (e, t) => {
|
|
4716
4734
|
t.signal.addEventListener("abort", () => {
|
|
4717
4735
|
});
|
|
4718
4736
|
const n = e.url.match(/(\d+)\/(\d+)\/(\d+)$/);
|
|
@@ -4726,8 +4744,8 @@ const Pe = class Pe {
|
|
|
4726
4744
|
};
|
|
4727
4745
|
}), Pe.protocalRegister.add(a(this, U).name);
|
|
4728
4746
|
}
|
|
4729
|
-
initWebGLTool(e = a(this,
|
|
4730
|
-
e.createFrameBuffer("tileFrameBuffer", 256, 256), e.createProgram("tile",
|
|
4747
|
+
initWebGLTool(e = a(this, Ae)) {
|
|
4748
|
+
e.createFrameBuffer("tileFrameBuffer", 256, 256), e.createProgram("tile", Ti, a(this, U).fragmentShader), e.createProgramVertexArray("tile"), e.bindProgramVertexArray("tile");
|
|
4731
4749
|
const t = e.setProgramAttribute({
|
|
4732
4750
|
programName: "tile",
|
|
4733
4751
|
name: "a_position",
|
|
@@ -4766,7 +4784,7 @@ const Pe = class Pe {
|
|
|
4766
4784
|
}), e.bindProgramVertexArray("tile", null);
|
|
4767
4785
|
}
|
|
4768
4786
|
destroy() {
|
|
4769
|
-
|
|
4787
|
+
Xn(a(this, U).name), a(this, Ae).destroy(), a(this, Ae).gl.deleteTexture(a(this, Ze)), Pe.protocalRegister.delete(a(this, U).name), a(this, we).removeLayer(`${a(this, U).name}__layer`), a(this, we).removeSource(`${a(this, U).name}__source`);
|
|
4770
4788
|
}
|
|
4771
4789
|
/** 从 tianditu CDN 加载原始瓦片图片 */
|
|
4772
4790
|
loadTile(e, t, n) {
|
|
@@ -4779,38 +4797,38 @@ const Pe = class Pe {
|
|
|
4779
4797
|
}
|
|
4780
4798
|
/** 使用 WebGL 着色器处理瓦片图片 */
|
|
4781
4799
|
async applyTileFilter(e) {
|
|
4782
|
-
const t = a(this,
|
|
4783
|
-
t.createTexture({ data: e, flipY: !1 }, a(this,
|
|
4800
|
+
const t = a(this, Ae);
|
|
4801
|
+
t.createTexture({ data: e, flipY: !1 }, a(this, Ze)), t.setProgramUniform({
|
|
4784
4802
|
programName: "tile",
|
|
4785
4803
|
name: "u_texture",
|
|
4786
4804
|
type: "texture2D",
|
|
4787
|
-
value: a(this,
|
|
4805
|
+
value: a(this, Ze)
|
|
4788
4806
|
}), t.setFrameBuffer("tileFrameBuffer", 256, 256), t.useProgram("tile"), t.useProgramUniform("tile"), t.bindProgramVertexArray("tile"), t.gl.clearColor(0, 0, 0, 1), t.gl.clear(t.gl.COLOR_BUFFER_BIT | t.gl.DEPTH_BUFFER_BIT), t.gl.drawArrays(t.gl.TRIANGLE_STRIP, 0, 4);
|
|
4789
4807
|
const n = new Uint8ClampedArray(256 * 256 * 4);
|
|
4790
4808
|
return t.gl.readPixels(0, 0, 256, 256, t.gl.RGBA, t.gl.UNSIGNED_BYTE, n), t.setFrameBuffer(null), createImageBitmap(new ImageData(n, 256, 256));
|
|
4791
4809
|
}
|
|
4792
4810
|
};
|
|
4793
|
-
we = new WeakMap(),
|
|
4794
|
-
let
|
|
4811
|
+
we = new WeakMap(), Ae = new WeakMap(), U = new WeakMap(), Ze = new WeakMap(), ut = new WeakMap(), g(Pe, "protocalRegister", /* @__PURE__ */ new Set());
|
|
4812
|
+
let Lr = Pe;
|
|
4795
4813
|
export {
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4814
|
+
va as BlueStar,
|
|
4815
|
+
Bi as Bubble,
|
|
4816
|
+
Di as BubbleManager,
|
|
4817
|
+
Zi as BubbleOverlay,
|
|
4818
|
+
io as GridSource,
|
|
4819
|
+
Fo as HeatmapLayer,
|
|
4820
|
+
ma as ImageRender,
|
|
4821
|
+
la as IsolineLayer,
|
|
4822
|
+
Gi as Map,
|
|
4823
|
+
na as ParticleLayer,
|
|
4824
|
+
Tr as RGBWegFileToWegImage,
|
|
4825
|
+
zo as TextLayer,
|
|
4826
|
+
cr as TileLayer,
|
|
4827
|
+
Lr as TileLayerRender,
|
|
4828
|
+
Vi as Tool,
|
|
4829
|
+
Jo as VectorLayer,
|
|
4830
|
+
fa as WegRenderer,
|
|
4831
|
+
_o as XMap,
|
|
4832
|
+
Mi as mapController,
|
|
4833
|
+
Gt as onMapLoaded
|
|
4816
4834
|
};
|