bluestar-maplibre 1.1.6 → 1.1.8
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 +1434 -1222
- package/dist/maplibre/src/components/wegRender/lib/propertyController.d.ts +2 -0
- package/dist/maplibre/src/components/wegRender/lib/types.d.ts +4 -0
- package/dist/maplibre/src/index.d.ts +50 -29
- package/dist/maplibre/src/vue/bubble-overlay.vue.d.ts +62 -0
- package/dist/maplibre/src/vue/component.d.ts +126 -51
- package/dist/maplibre/src/xmap/xmap.d.ts +2 -0
- package/package.json +2 -2
- package/readme.md +7 -0
package/dist/index.js
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Tn = Object.defineProperty;
|
|
2
|
+
var fr = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var a = (r, e, t) => (
|
|
8
|
-
var
|
|
5
|
+
var wn = (r, e, t) => e in r ? Tn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var g = (r, e, t) => wn(r, typeof e != "symbol" ? e + "" : e, t), Yt = (r, e, t) => e.has(r) || fr("Cannot " + t);
|
|
7
|
+
var a = (r, e, t) => (Yt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), A = (r, e, t) => e.has(r) ? fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), E = (r, e, t, n) => (Yt(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), S = (r, e, t) => (Yt(r, e, "access private method"), t);
|
|
8
|
+
var Ft = (r, e, t, n) => ({
|
|
9
9
|
set _(o) {
|
|
10
|
-
|
|
10
|
+
E(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 Ge, watch as P, provide as Ln, onMounted as sr, onUnmounted as Sn, inject as _n, defineComponent as $e, getCurrentInstance as kn, onBeforeUnmount as Bt, openBlock as N, createElementBlock as Z, normalizeClass as pe, normalizeStyle as tt, renderSlot as Dt, Fragment as Ee, renderList as Ze, computed as pr, shallowRef as Mn, unref as Xt, withModifiers as Vn, createCommentVNode as be, ref as le, toRaw as mr, createElementVNode as y, createTextVNode as qe, toDisplayString as ce, withDirectives as ke, vModelText as et, withKeys as Wt, createVNode as zt, Transition as Bn, withCtx as Gr, useModel as Dn, createBlock as Yr, createStaticVNode as Nn, vModelDynamic as Zn, vModelSelect as Gn } from "vue";
|
|
17
|
+
import { addSourceType as Fr, Evented as Pr, Event as Xr, Map as Yn, addProtocol as Fn, removeProtocol as Pn } from "maplibre-gl";
|
|
18
|
+
import { v4 as Ct } from "uuid";
|
|
19
|
+
import { Color as ft, EventListenControl as Xn, createUseApiInterceptor as Wr, fontSize as Ht, decodeWegFile as vr, encodeGzip as Wn, WebGLTool as zn } from "bluestar-util";
|
|
20
|
+
const Hn = 8, Kn = "Mapbox Standard", On = [
|
|
21
21
|
-10,
|
|
22
22
|
30
|
|
23
|
-
],
|
|
23
|
+
], Un = 1.5, Qn = 0, jn = 0, Jn = {}, $n = {
|
|
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
|
+
}, qn = [], eo = "standard", to = "mapbox", ro = "public", no = !1, oo = {
|
|
26
|
+
version: Hn,
|
|
27
|
+
name: Kn,
|
|
28
|
+
center: On,
|
|
29
|
+
zoom: Un,
|
|
30
|
+
bearing: Qn,
|
|
31
|
+
pitch: jn,
|
|
32
|
+
sources: Jn,
|
|
33
|
+
projection: $n,
|
|
34
|
+
layers: qn,
|
|
35
|
+
id: eo,
|
|
36
|
+
owner: to,
|
|
37
|
+
visibility: ro,
|
|
38
38
|
protected: !0,
|
|
39
|
-
draft:
|
|
39
|
+
draft: no
|
|
40
40
|
};
|
|
41
|
-
var
|
|
41
|
+
var O = /* @__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; ) {
|
|
45
|
-
var l = r[t.charCodeAt(i++)],
|
|
46
|
-
o[s++] = l << 2 |
|
|
45
|
+
var l = r[t.charCodeAt(i++)], c = r[t.charCodeAt(i++)], u = r[t.charCodeAt(i++)], h = r[t.charCodeAt(i++)];
|
|
46
|
+
o[s++] = l << 2 | c >> 4, o[s++] = c << 4 | u >> 2, o[s++] = u << 6 | h;
|
|
47
47
|
}
|
|
48
48
|
return o;
|
|
49
49
|
};
|
|
50
50
|
})();
|
|
51
|
-
function
|
|
51
|
+
function zr(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 rt, re, ue, Xe, vt, Lr, ao = (Lr = class extends Pr {
|
|
56
56
|
constructor(e, t, n, o) {
|
|
57
57
|
super();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.id = e, this.type = t.type,
|
|
58
|
+
A(this, Xe);
|
|
59
|
+
g(this, "id");
|
|
60
|
+
g(this, "maxzoom", 0);
|
|
61
|
+
g(this, "minzoom", 22);
|
|
62
|
+
g(this, "tileSize", 512);
|
|
63
|
+
g(this, "type");
|
|
64
|
+
A(this, rt);
|
|
65
|
+
A(this, re, null);
|
|
66
|
+
A(this, ue);
|
|
67
|
+
this.id = e, this.type = t.type, E(this, ue, /* @__PURE__ */ new WeakMap());
|
|
68
68
|
}
|
|
69
69
|
setData(e) {
|
|
70
|
-
return a(this,
|
|
70
|
+
return a(this, re) === e ? this : (a(this, re) && !a(this, ue).has(a(this, re)) && S(this, Xe, vt).call(this, a(this, re)), E(this, re, e), this.fire(new Xr("data", { dataType: "source", data: e })), this);
|
|
71
71
|
}
|
|
72
72
|
lastData() {
|
|
73
|
-
return a(this,
|
|
73
|
+
return a(this, re);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* @internal
|
|
77
77
|
*/
|
|
78
78
|
link(e) {
|
|
79
|
-
a(this,
|
|
79
|
+
a(this, ue).set(e, a(this, ue).has(e) ? a(this, ue).get(e) + 1 : 1);
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* @internal
|
|
83
83
|
*/
|
|
84
84
|
unlink(e) {
|
|
85
|
-
const t = a(this,
|
|
86
|
-
t > 0 ? a(this,
|
|
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, re) && S(this, Xe, vt).call(this, e));
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* @internal
|
|
90
90
|
*/
|
|
91
91
|
onAdd(e) {
|
|
92
|
-
|
|
92
|
+
E(this, rt, e.painter.context.gl);
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* @internal
|
|
96
96
|
*/
|
|
97
97
|
onRemove(e) {
|
|
98
|
-
a(this,
|
|
98
|
+
a(this, re) && S(this, Xe, vt).call(this, a(this, re)), E(this, re, null);
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* @internal
|
|
@@ -119,129 +119,129 @@ var je, $, ie, Ne, ct, vr, On = (vr = class extends Sr {
|
|
|
119
119
|
*/
|
|
120
120
|
serialize() {
|
|
121
121
|
}
|
|
122
|
-
},
|
|
122
|
+
}, rt = new WeakMap(), re = new WeakMap(), ue = new WeakMap(), Xe = new WeakSet(), vt = function(e) {
|
|
123
123
|
var o, i;
|
|
124
|
-
const t = a(this,
|
|
124
|
+
const t = a(this, rt), 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
|
+
}, Lr);
|
|
127
|
+
function io({ x: r, y: e, z: t }, n) {
|
|
128
128
|
if (!n) return !0;
|
|
129
|
-
const [o, i] =
|
|
129
|
+
const [o, i] = xt([r, e, t]), [s, l] = xt([r + 1, e + 1, t]), c = Math.min(...n.lat), u = Math.max(...n.lat);
|
|
130
130
|
let [h, d] = n.lon;
|
|
131
|
-
return d > 180 && s <= 0 && (h -= 360, d -= 360), !(
|
|
131
|
+
return d > 180 && s <= 0 && (h -= 360, d -= 360), !(c > i || u < l || h > s || d < o);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
const l = 2 ** t,
|
|
135
|
-
let [
|
|
136
|
-
if (
|
|
137
|
-
let [
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
let
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
const
|
|
146
|
-
for (let
|
|
147
|
-
const
|
|
148
|
-
for (let
|
|
149
|
-
return [
|
|
133
|
+
function Hr({ x: r, y: e, z: t }, n, o, i, s = 1) {
|
|
134
|
+
const l = 2 ** t, c = 120 / o / l, { x: u, y: h, lon: d, lat: p } = n, f = Math.abs((d[1] - d[0]) / (u - 1)), m = Math.abs((p[1] - p[0]) / (h - 1)), v = Math.ceil(c / f) * f, x = Math.ceil(c / m) * m;
|
|
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]) % x, i) {
|
|
137
|
+
let [T, I] = i.lon;
|
|
138
|
+
I > 180 && b <= 0 && (T -= 360, I -= 360);
|
|
139
|
+
const w = (T - d[0]) % v;
|
|
140
|
+
R = Math.max(R, w === 0 ? T : T - w + v), b = Math.min(b, I);
|
|
141
|
+
let _ = Math.max(...i.lat);
|
|
142
|
+
const k = (_ - p[0]) % x;
|
|
143
|
+
C = Math.min(C, k === 0 ? _ : _ - k - x), B = Math.max(B, Math.min(...i.lat));
|
|
144
|
+
}
|
|
145
|
+
const L = [];
|
|
146
|
+
for (let T = R; T <= b; T += v) L.push(T);
|
|
147
|
+
const M = [];
|
|
148
|
+
for (let T = C; T >= B; T -= x) M.push(T);
|
|
149
|
+
return [L, M];
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
const [o, i] =
|
|
151
|
+
function Kr(r, e, t, n) {
|
|
152
|
+
const [o, i] = Hr(r, e, t, n), s = [];
|
|
153
153
|
for (const l of i)
|
|
154
|
-
for (const
|
|
155
|
-
s.push([
|
|
154
|
+
for (const c of o)
|
|
155
|
+
s.push([c, l]);
|
|
156
156
|
return s;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return [
|
|
158
|
+
function Or(r, [e, t]) {
|
|
159
|
+
return [Ur(r, e), Qr(r, t)];
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
161
|
+
function Ur({ x: r, z: e }, t) {
|
|
162
|
+
return so(t) * 2 ** e - r;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
164
|
+
function Qr({ y: r, z: e }, t) {
|
|
165
|
+
return lo(t) * 2 ** e - r;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function so(r) {
|
|
168
168
|
return (180 + r) / 360;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function lo(r) {
|
|
171
171
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
g(this, "id");
|
|
180
|
+
g(this, "source");
|
|
181
|
+
g(this, "type", "custom");
|
|
182
182
|
this.id = r.id, this.source = r.source;
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
|
-
function
|
|
185
|
+
function Jr(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
|
|
190
|
+
var We, nt, de, Me, Ae, Ve, ze, me, He, Se, Kt, ot, Et, At, Rt, Ot, Sr, lr = (Sr = class {
|
|
191
191
|
/**
|
|
192
192
|
* @internal
|
|
193
193
|
*/
|
|
194
194
|
constructor(r) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
A(this, Se);
|
|
196
|
+
g(this, "id");
|
|
197
|
+
g(this, "source");
|
|
198
|
+
g(this, "type", "raster");
|
|
199
|
+
g(this, "minzoom");
|
|
200
|
+
g(this, "maxzoom");
|
|
201
|
+
g(this, "tileSize");
|
|
202
202
|
/**
|
|
203
203
|
* @internal
|
|
204
204
|
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
g(this, "paint", { "raster-fade-duration": 0 });
|
|
206
|
+
A(this, We);
|
|
207
|
+
A(this, nt);
|
|
208
|
+
A(this, de);
|
|
209
|
+
A(this, Me, 0);
|
|
210
|
+
A(this, Ae, 0);
|
|
211
|
+
A(this, Ve);
|
|
212
|
+
A(this, ze);
|
|
213
213
|
// current,next
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (!r.texture || r.updateTime < Math.max(a(this,
|
|
218
|
-
const e = Date.now(), t = a(this,
|
|
214
|
+
A(this, me, null);
|
|
215
|
+
A(this, He, null);
|
|
216
|
+
A(this, ot, async (r) => {
|
|
217
|
+
if (!r.texture || r.updateTime < Math.max(a(this, Me), a(this, Ae))) {
|
|
218
|
+
const e = Date.now(), t = a(this, Ve) ?? a(this, de).transition, n = t > 0 ? Math.max(0, a(this, Ae) - 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;
|
|
222
222
|
}
|
|
223
|
-
const { width: i, height: s } = o, l = i,
|
|
223
|
+
const { width: i, height: s } = o, l = i, c = a(this, de).painter.context.gl;
|
|
224
224
|
if (r.texture)
|
|
225
225
|
r.texture.bind();
|
|
226
226
|
else {
|
|
227
|
-
let
|
|
228
|
-
|
|
227
|
+
let u = a(this, de).renderFactory.getTexture(l);
|
|
228
|
+
u ? c.bindTexture(c.TEXTURE_2D, u) : (u = c.createTexture(), c.bindTexture(c.TEXTURE_2D, u), c.texStorage2D(c.TEXTURE_2D, 1, c.RGBA8, i, s), c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MIN_FILTER, c.LINEAR_MIPMAP_LINEAR), c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MAG_FILTER, c.LINEAR), c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE), c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE)), r.texture = { bind: () => c.bindTexture(c.TEXTURE_2D, u), texture: u };
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
c.texSubImage2D(c.TEXTURE_2D, 0, 0, 0, i, s, c.RGBA, c.UNSIGNED_BYTE, o), o.close(), r.updateTime = e, r.state = "loaded", n > 0 && requestAnimationFrame(() => a(this, ot).call(this, r));
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
A(this, Et, async (r) => {
|
|
234
234
|
var e;
|
|
235
|
-
(e = r.texture) != null && e.texture && a(this,
|
|
235
|
+
(e = r.texture) != null && e.texture && a(this, de).renderFactory.setTexture(this.tileSize * 2, r.texture.texture);
|
|
236
236
|
});
|
|
237
|
-
|
|
237
|
+
A(this, At, ({ canonical: r }) => a(this, me) ? io(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
|
+
A(this, Rt, () => !0);
|
|
244
|
+
this.id = r.id, this.minzoom = r.minzoom ?? 1, this.maxzoom = r.maxzoom ?? 22, this.tileSize = r.tileSize ?? 512, E(this, We, r.source), E(this, Ve, r.transition), E(this, ze, r.bound === void 0 ? null : r.bound), this.source = "#proxy-" + this.id;
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* @internal
|
|
@@ -253,117 +253,117 @@ var Ye, Je, se, _e, Ce, ke, Fe, he, Pe, Le, Vt, $e, yt, bt, gt, Bt, yr, Jt = (yr
|
|
|
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,
|
|
258
|
-
unloadTile: a(this,
|
|
259
|
-
hasTransition: a(this,
|
|
256
|
+
hasTile: a(this, At),
|
|
257
|
+
loadTile: a(this, ot),
|
|
258
|
+
unloadTile: a(this, Et),
|
|
259
|
+
hasTransition: a(this, Rt),
|
|
260
260
|
loaded: () => !0
|
|
261
|
-
}),
|
|
261
|
+
}), E(this, nt, r.getSource(this.source));
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* @internal
|
|
265
265
|
*/
|
|
266
266
|
onAdd(r) {
|
|
267
|
-
|
|
268
|
-
const e = r.getSource(a(this,
|
|
269
|
-
if (!e) throw new Error(`The source(id:${a(this,
|
|
267
|
+
E(this, de, r);
|
|
268
|
+
const e = r.getSource(a(this, We));
|
|
269
|
+
if (!e) throw new Error(`The source(id:${a(this, We)}) not found!`);
|
|
270
270
|
e.on("data", ({ data: t }) => {
|
|
271
|
-
|
|
272
|
-
}),
|
|
271
|
+
S(this, Se, Ot).call(this, t), S(this, Se, Kt).call(this);
|
|
272
|
+
}), S(this, Se, Ot).call(this, e.lastData());
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* @internal
|
|
276
276
|
*/
|
|
277
277
|
get renderFactory() {
|
|
278
|
-
return a(this,
|
|
278
|
+
return a(this, de).renderFactory;
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* @internal
|
|
282
282
|
*/
|
|
283
283
|
get data0() {
|
|
284
|
-
return a(this,
|
|
284
|
+
return a(this, me);
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
287
287
|
* @internal
|
|
288
288
|
*/
|
|
289
289
|
get data1() {
|
|
290
|
-
return a(this,
|
|
290
|
+
return a(this, He);
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
293
293
|
* @internal
|
|
294
294
|
*/
|
|
295
295
|
setOptions({ transition: r, bound: e }) {
|
|
296
|
-
r !== void 0 &&
|
|
296
|
+
r !== void 0 && E(this, Ve, r), e !== void 0 && E(this, ze, e), E(this, Me, Date.now()), E(this, Ae, 0), S(this, Se, Kt).call(this);
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, We = new WeakMap(), nt = new WeakMap(), de = new WeakMap(), Me = new WeakMap(), Ae = new WeakMap(), Ve = new WeakMap(), ze = new WeakMap(), me = new WeakMap(), He = new WeakMap(), Se = new WeakSet(), /**
|
|
299
299
|
* @internal
|
|
300
300
|
*/
|
|
301
|
-
|
|
302
|
-
a(this,
|
|
303
|
-
},
|
|
301
|
+
Kt = function() {
|
|
302
|
+
a(this, nt).fire({ type: "data", dataType: "source", sourceDataType: "content", sourceDataChanged: !0 });
|
|
303
|
+
}, ot = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Rt = new WeakMap(), Ot = function(r) {
|
|
304
304
|
if (!r) {
|
|
305
|
-
|
|
305
|
+
E(this, me, null), E(this, He, null);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
309
|
-
const e = a(this,
|
|
310
|
-
e > 0 && (
|
|
308
|
+
if (E(this, Me, Date.now()), a(this, me)) {
|
|
309
|
+
const e = a(this, Ve) ?? a(this, de).transition;
|
|
310
|
+
e > 0 && (zr(a(this, me), r) ? (E(this, He, a(this, me)), E(this, Ae, a(this, Me) + e)) : E(this, Ae, 0));
|
|
311
311
|
}
|
|
312
|
-
|
|
313
|
-
},
|
|
312
|
+
E(this, me, r), a(this, de).triggerRepaint();
|
|
313
|
+
}, Sr), co = class extends Pr {
|
|
314
314
|
constructor(e, t, n, o) {
|
|
315
315
|
super();
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
|
316
|
+
g(this, "type", "raster");
|
|
317
|
+
g(this, "id");
|
|
318
|
+
g(this, "tileSize");
|
|
319
|
+
g(this, "roundZoom");
|
|
320
|
+
g(this, "minzoom");
|
|
321
|
+
g(this, "maxzoom");
|
|
322
|
+
g(this, "onAdd");
|
|
323
|
+
g(this, "onRemove");
|
|
324
|
+
g(this, "prepare");
|
|
325
|
+
g(this, "hasTile");
|
|
326
|
+
g(this, "loadTile");
|
|
327
|
+
g(this, "abortTile");
|
|
328
|
+
g(this, "unloadTile");
|
|
329
|
+
g(this, "hasTransition");
|
|
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 Xr("data", { dataType: "source", sourceDataType: "metadata" }));
|
|
332
332
|
}
|
|
333
333
|
serialize() {
|
|
334
334
|
return { id: this.id, type: "proxy" };
|
|
335
335
|
}
|
|
336
|
-
},
|
|
337
|
-
function
|
|
336
|
+
}, Pt = 128;
|
|
337
|
+
function uo(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));
|
|
341
|
-
const i = l(), s =
|
|
341
|
+
const i = l(), s = c();
|
|
342
342
|
return { gl: r, program: o, uniform: i, attribute: s };
|
|
343
343
|
function l() {
|
|
344
|
-
const
|
|
345
|
-
for (let d = 0; d <
|
|
346
|
-
const { name: p, type: f, size:
|
|
347
|
-
|
|
344
|
+
const u = r.getProgramParameter(o, r.ACTIVE_UNIFORMS), h = {};
|
|
345
|
+
for (let d = 0; d < u; d++) {
|
|
346
|
+
const { name: p, type: f, size: m } = r.getActiveUniform(o, d), v = r.getUniformLocation(o, p);
|
|
347
|
+
v && (h[p] = { type: f, location: v, size: m });
|
|
348
348
|
}
|
|
349
349
|
return h;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
const
|
|
353
|
-
for (let d = 0; d <
|
|
354
|
-
const { name: p, type: f } = r.getActiveAttrib(o, d),
|
|
355
|
-
h[p] = { type: f, index:
|
|
351
|
+
function c() {
|
|
352
|
+
const u = r.getProgramParameter(o, r.ACTIVE_ATTRIBUTES), h = {};
|
|
353
|
+
for (let d = 0; d < u; d++) {
|
|
354
|
+
const { name: p, type: f } = r.getActiveAttrib(o, d), m = r.getAttribLocation(o, p);
|
|
355
|
+
h[p] = { type: f, index: m };
|
|
356
356
|
}
|
|
357
357
|
return h;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
360
|
+
function ho(r, e) {
|
|
361
|
+
return $r(r, r.VERTEX_SHADER, e);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
363
|
+
function fo(r, e) {
|
|
364
|
+
return $r(r, r.FRAGMENT_SHADER, e);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function $r(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,110 +371,110 @@ function Fr(r, e, t) {
|
|
|
371
371
|
}
|
|
372
372
|
return n;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Ut(r, e, t, n) {
|
|
375
375
|
const o = r.createVertexArray();
|
|
376
|
-
r.bindVertexArray(o),
|
|
377
|
-
const i = t.count, s = t.attribute.indices, l = s !== void 0,
|
|
378
|
-
return { gl: r, vao: o, count: i, mode: n, type:
|
|
376
|
+
r.bindVertexArray(o), mo(e, t), r.bindVertexArray(null);
|
|
377
|
+
const i = t.count, s = t.attribute.indices, l = s !== void 0, c = r.UNSIGNED_SHORT, u = l ? s.offset ?? 0 : 0;
|
|
378
|
+
return { gl: r, vao: o, count: i, mode: n, type: c, offset: u, indices: l };
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
const n =
|
|
382
|
-
let
|
|
380
|
+
function po(r, { x: e, y: t } = { x: 64, y: 64 }) {
|
|
381
|
+
const n = Pt / e, o = Pt / t, i = e + 1, s = new Uint8Array(i * (t + 1) * 2), l = new Uint16Array((i * 2 + 1) * t);
|
|
382
|
+
let c = 0, u = 0;
|
|
383
383
|
for (let h = 0; h < t; h++) {
|
|
384
384
|
for (let d = 0; d <= e; d++) {
|
|
385
|
-
s[
|
|
385
|
+
s[c++] = d * n, s[c++] = h * o;
|
|
386
386
|
const p = h * i + d;
|
|
387
|
-
l[
|
|
387
|
+
l[u++] = p, l[u++] = p + i;
|
|
388
388
|
}
|
|
389
|
-
l[
|
|
389
|
+
l[u++] = 65535;
|
|
390
390
|
}
|
|
391
391
|
for (let h = 0; h <= e; h++)
|
|
392
|
-
s[
|
|
393
|
-
return
|
|
392
|
+
s[c++] = h * n, s[c++] = Pt;
|
|
393
|
+
return cr(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 cr(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!");
|
|
402
402
|
let o = 0;
|
|
403
403
|
for (const i in e) {
|
|
404
|
-
const { size: s, data: l, divisor:
|
|
404
|
+
const { size: s, data: l, divisor: c, stride: u, offset: h, normalize: d, type: p } = e[i], f = r.createBuffer();
|
|
405
405
|
if (!f) throw new Error("Unable to initialize buffer!");
|
|
406
|
-
const
|
|
407
|
-
r.bindBuffer(
|
|
408
|
-
const
|
|
409
|
-
o = o === 0 ?
|
|
406
|
+
const m = i === "indices" ? r.ELEMENT_ARRAY_BUFFER : r.ARRAY_BUFFER;
|
|
407
|
+
r.bindBuffer(m, f), r.bufferData(m, l, r.STATIC_DRAW), t[i] = { size: s, type: p, normalize: d === !0, stride: u ?? 0, offset: h ?? 0, divisor: c ?? 0, buffer: f };
|
|
408
|
+
const v = (l.length - (h ?? 0)) / s;
|
|
409
|
+
o = o === 0 ? v : Math.min(o, v);
|
|
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 yt(r, e) {
|
|
414
414
|
const { gl: t, uniform: n } = r;
|
|
415
415
|
let o = 0;
|
|
416
416
|
for (const i in n) {
|
|
417
|
-
const { type: s, location: l, size:
|
|
418
|
-
if (e.hasOwnProperty(i) &&
|
|
417
|
+
const { type: s, location: l, size: c } = n[i], u = e[i];
|
|
418
|
+
if (e.hasOwnProperty(i) && u !== void 0)
|
|
419
419
|
switch (s) {
|
|
420
420
|
case WebGL2RenderingContext.FLOAT:
|
|
421
|
-
t.uniform1f(l,
|
|
421
|
+
t.uniform1f(l, u);
|
|
422
422
|
break;
|
|
423
423
|
case WebGL2RenderingContext.FLOAT_VEC2:
|
|
424
|
-
t.uniform2fv(l,
|
|
424
|
+
t.uniform2fv(l, u);
|
|
425
425
|
break;
|
|
426
426
|
case WebGL2RenderingContext.FLOAT_VEC3:
|
|
427
|
-
t.uniform3fv(l,
|
|
427
|
+
t.uniform3fv(l, u);
|
|
428
428
|
break;
|
|
429
429
|
case WebGL2RenderingContext.FLOAT_VEC4:
|
|
430
|
-
t.uniform4fv(l,
|
|
430
|
+
t.uniform4fv(l, u);
|
|
431
431
|
break;
|
|
432
432
|
case WebGL2RenderingContext.INT:
|
|
433
433
|
case WebGL2RenderingContext.BOOL:
|
|
434
|
-
t.uniform1i(l,
|
|
434
|
+
t.uniform1i(l, u);
|
|
435
435
|
break;
|
|
436
436
|
case WebGL2RenderingContext.INT_VEC2:
|
|
437
437
|
case WebGL2RenderingContext.BOOL_VEC2:
|
|
438
|
-
t.uniform2iv(l,
|
|
438
|
+
t.uniform2iv(l, u);
|
|
439
439
|
break;
|
|
440
440
|
case WebGL2RenderingContext.INT_VEC3:
|
|
441
441
|
case WebGL2RenderingContext.BOOL_VEC3:
|
|
442
|
-
t.uniform3iv(l,
|
|
442
|
+
t.uniform3iv(l, u);
|
|
443
443
|
break;
|
|
444
444
|
case WebGL2RenderingContext.INT_VEC4:
|
|
445
445
|
case WebGL2RenderingContext.BOOL_VEC4:
|
|
446
|
-
t.uniform4iv(l,
|
|
446
|
+
t.uniform4iv(l, u);
|
|
447
447
|
break;
|
|
448
448
|
case WebGL2RenderingContext.UNSIGNED_INT:
|
|
449
|
-
t.uniform1ui(l,
|
|
449
|
+
t.uniform1ui(l, u);
|
|
450
450
|
break;
|
|
451
451
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC2:
|
|
452
|
-
t.uniform2uiv(l,
|
|
452
|
+
t.uniform2uiv(l, u);
|
|
453
453
|
break;
|
|
454
454
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC3:
|
|
455
|
-
t.uniform3uiv(l,
|
|
455
|
+
t.uniform3uiv(l, u);
|
|
456
456
|
break;
|
|
457
457
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC4:
|
|
458
|
-
t.uniform4uiv(l,
|
|
458
|
+
t.uniform4uiv(l, u);
|
|
459
459
|
break;
|
|
460
460
|
case WebGL2RenderingContext.FLOAT_MAT2:
|
|
461
|
-
t.uniformMatrix2fv(l, !1,
|
|
461
|
+
t.uniformMatrix2fv(l, !1, u);
|
|
462
462
|
break;
|
|
463
463
|
case WebGL2RenderingContext.FLOAT_MAT3:
|
|
464
|
-
t.uniformMatrix3fv(l, !1,
|
|
464
|
+
t.uniformMatrix3fv(l, !1, u);
|
|
465
465
|
break;
|
|
466
466
|
case WebGL2RenderingContext.FLOAT_MAT4:
|
|
467
|
-
t.uniformMatrix4fv(l, !1,
|
|
467
|
+
t.uniformMatrix4fv(l, !1, u);
|
|
468
468
|
break;
|
|
469
469
|
case WebGL2RenderingContext.SAMPLER_2D:
|
|
470
470
|
case WebGL2RenderingContext.INT_SAMPLER_2D:
|
|
471
471
|
case WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D:
|
|
472
|
-
t.activeTexture(WebGL2RenderingContext.TEXTURE0 + o), t.bindTexture(WebGL2RenderingContext.TEXTURE_2D,
|
|
472
|
+
t.activeTexture(WebGL2RenderingContext.TEXTURE0 + o), t.bindTexture(WebGL2RenderingContext.TEXTURE_2D, u), t.uniform1i(l, o), o += c;
|
|
473
473
|
break;
|
|
474
474
|
case WebGL2RenderingContext.SAMPLER_3D:
|
|
475
475
|
case WebGL2RenderingContext.INT_SAMPLER_3D:
|
|
476
476
|
case WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D:
|
|
477
|
-
t.uniform1i(l, o), t.activeTexture(WebGL2RenderingContext.TEXTURE0 + o), t.bindTexture(WebGL2RenderingContext.TEXTURE_3D,
|
|
477
|
+
t.uniform1i(l, o), t.activeTexture(WebGL2RenderingContext.TEXTURE0 + o), t.bindTexture(WebGL2RenderingContext.TEXTURE_3D, u), o += c;
|
|
478
478
|
break;
|
|
479
479
|
default:
|
|
480
480
|
throw new Error("The uniform's type is undefined! type: " + s);
|
|
@@ -487,23 +487,23 @@ function ut(r, e) {
|
|
|
487
487
|
case WebGL2RenderingContext.SAMPLER_3D:
|
|
488
488
|
case WebGL2RenderingContext.INT_SAMPLER_3D:
|
|
489
489
|
case WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D:
|
|
490
|
-
o +=
|
|
490
|
+
o += c;
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function mo(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)
|
|
499
499
|
if (o.hasOwnProperty(s)) {
|
|
500
|
-
const { type: l, index:
|
|
501
|
-
switch (t.bindBuffer(t.ARRAY_BUFFER,
|
|
500
|
+
const { type: l, index: c } = n[s], { buffer: u, type: h, size: d, normalize: p, stride: f, divisor: m, offset: v } = o[s];
|
|
501
|
+
switch (t.bindBuffer(t.ARRAY_BUFFER, u), l) {
|
|
502
502
|
case WebGL2RenderingContext.FLOAT:
|
|
503
503
|
case WebGL2RenderingContext.FLOAT_VEC2:
|
|
504
504
|
case WebGL2RenderingContext.FLOAT_VEC3:
|
|
505
505
|
case WebGL2RenderingContext.FLOAT_VEC4:
|
|
506
|
-
t.vertexAttribPointer(
|
|
506
|
+
t.vertexAttribPointer(c, d, h, p, f, v);
|
|
507
507
|
break;
|
|
508
508
|
case WebGL2RenderingContext.BOOL:
|
|
509
509
|
case WebGL2RenderingContext.INT:
|
|
@@ -514,19 +514,19 @@ function ro(r, e) {
|
|
|
514
514
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC2:
|
|
515
515
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC3:
|
|
516
516
|
case WebGL2RenderingContext.UNSIGNED_INT_VEC4:
|
|
517
|
-
t.vertexAttribIPointer(
|
|
517
|
+
t.vertexAttribIPointer(c, d, h, f, v);
|
|
518
518
|
break;
|
|
519
519
|
default:
|
|
520
520
|
throw new Error("The buffer's type is undefined! type: " + l);
|
|
521
521
|
}
|
|
522
|
-
t.enableVertexAttribArray(
|
|
522
|
+
t.enableVertexAttribArray(c), m && t.vertexAttribDivisor && t.vertexAttribDivisor(c, m);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Qt(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 vo = O("I3ZlcnNpb24gMzAwIGVzDQo="), yo = O("I3ZlcnNpb24gMzAwIGVzDQo="), go = O("dW5pZm9ybSBmbG9hdCB1X29wYWNpdHk7DQp1bmlmb3JtIGhpZ2hwIHZlYzIgdV9kYXRhX2JvdW5kOw0KYm9vbCBpbnZhbGlkRGlzcGxheShjb25zdCBpbiBmbG9hdCB2YWwpIHsNCiAgICByZXR1cm4gaXNuYW4odmFsKSB8fCB2YWwgPCB1X2RhdGFfYm91bmQueCB8fCB2YWwgPiB1X2RhdGFfYm91bmQueTsNCn0NCg=="), bo = O("dW5pZm9ybSB2ZWM0IHVfYm91bmQ7DQpib29sIGludmFsaWRCb3VuZChjb25zdCBpbiB2ZWMyIHBvcykgew0KICAgIGJvb2wgYiA9IGJvb2wodV9ib3VuZC54ICE9IHVfYm91bmQueiAmJiB1X2JvdW5kLnkgIT0gdV9ib3VuZC53ICYmIChhbnkobGVzc1RoYW4ocG9zLCB1X2JvdW5kLnh5KSkgfHwgYW55KGdyZWF0ZXJUaGFuKHBvcywgdV9ib3VuZC56dykpKSk7DQogICAgaWYgKHVfYm91bmQueiA8PSBGMTgwKSByZXR1cm4gYjsNCiAgICB2ZWMyIHBvczM2MCA9IHZlYzIocG9zLnggKyBGMzYwLCBwb3MueSk7DQogICAgcmV0dXJuIGIgJiYgKGFueShsZXNzVGhhbihwb3MzNjAsIHVfYm91bmQueHkpKSB8fCBhbnkoZ3JlYXRlclRoYW4ocG9zMzYwLCB1X2JvdW5kLnp3KSkpOw0KfQ0K"), Io = O("dW5pZm9ybSBsb3dwIHNhbXBsZXIyRCB1X2NvbG9yOw0KdW5pZm9ybSBoaWdocCB2ZWMyIHVfY29sb3JfcmFuZ2U7DQp2ZWM0IHJlYWRDb2xvcihoaWdocCBmbG9hdCB2YWwpIHsNCiAgICBmbG9hdCB2ID0gKHZhbCAtIHVfY29sb3JfcmFuZ2UueCkgLyAodV9jb2xvcl9yYW5nZS55IC0gdV9jb2xvcl9yYW5nZS54KTsNCiAgICByZXR1cm4gdGV4dHVyZSh1X2NvbG9yLCB2ZWMyKHYsIEYwKSk7DQp9DQoNCg=="), Co = O("I2lmZGVmIFVTRV9NQVNLDQp1bmlmb3JtIHNhbXBsZXIyRCB1X21hc2s7DQp1bmlmb3JtIHZlYzIgdV9yZXNvbHV0aW9uOw0KYm9vbCBpbnZhbGlkTWFzaygpIHsNCiAgICB2ZWMyIHV2ID0gZ2xfRnJhZ0Nvb3JkLnh5IC8gdV9yZXNvbHV0aW9uOw0KICAgIHJldHVybiB0ZXh0dXJlKHVfbWFzaywgdXYpLnggPT0gRjA7DQp9DQojZW5kaWYNCg=="), xo = O("dW5pZm9ybSB2ZWMyIHVfZGF0YV9sb247DQp1bmlmb3JtIHZlYzIgdV9kYXRhX2xhdDsNCg0KZmxvYXQgZGF0YUxvbihmbG9hdCBsb24pIHsNCiAgICByZXR1cm4gbG9uICsgRjM2MCAqIChzdGVwKGxvbiwgdV9kYXRhX2xvbi55KSAtIHN0ZXAodV9kYXRhX2xvbi54LCBsb24pKTsNCn0NCmJvb2wgaW52YWxpZERhdGFCb3VuZChjb25zdCB2ZWMyIHBvcykgew0KICAgIHZlYzIgZGdMb24gPSB2ZWMyKG1pbih1X2RhdGFfbG9uLngsIHVfZGF0YV9sb24ueSksIG1heCh1X2RhdGFfbG9uLngsIHVfZGF0YV9sb24ueSkpOw0KICAgIHZlYzIgZGdMYXQgPSB2ZWMyKG1pbih1X2RhdGFfbGF0LngsIHVfZGF0YV9sYXQueSksIG1heCh1X2RhdGFfbGF0LngsIHVfZGF0YV9sYXQueSkpOw0KICAgIGJvb2wgdiA9IGJvb2wocG9zLnkgPCBkZ0xhdC54IHx8IHBvcy55ID4gZGdMYXQueSk7DQogICAgZmxvYXQgbG9uID0gZGF0YUxvbihwb3MueCk7DQogICAgcmV0dXJuIHYgfHwgbG9uIDwgZGdMb24ueCB8fCBsb24gPiBkZ0xvbi55Ow0KfQ0KZmxvYXQgZ3JpZERhdGEwKHNhbXBsZXIyRCBkYXRhLCB2ZWMyIGluZm8sIHZlYzIgdXYpIHsNCiAgICBoaWdocCBmbG9hdCB2ID0gdGV4dHVyZShkYXRhLCB1dikueDsNCiAgICAjaWZkZWYgREFUQTBfVUlOVA0KICAgIHYgPSBpbmZvLnggKyB2ICogaW5mby55Ow0KICAgICNlbmRpZg0KICAgIHJldHVybiB2Ow0KfQ0KDQp1bmlmb3JtIG1lZGl1bXAgc2FtcGxlcjJEIHVfZGF0YTAwOw0KdW5pZm9ybSBoaWdocCB2ZWMyIHVfZGF0YTAwX2luZm87DQojaWZkZWYgREFUQV9HUklEX1VWDQp1bmlmb3JtIG1lZGl1bXAgc2FtcGxlcjJEIHVfZGF0YTAxOw0KdW5pZm9ybSBoaWdocCB2ZWMyIHVfZGF0YTAxX2luZm87DQojZW5kaWYNCg0KI2lmZGVmIERBVEExDQp1bmlmb3JtIGZsb2F0IHVfdHJhbnNpdGlvbjsNCnVuaWZvcm0gbWVkaXVtcCBzYW1wbGVyMkQgdV9kYXRhMTA7DQp1bmlmb3JtIGhpZ2hwIHZlYzIgdV9kYXRhMTBfaW5mbzsNCmZsb2F0IGdyaWREYXRhMShzYW1wbGVyMkQgZGF0YSwgdmVjMiBpbmZvLCB2ZWMyIHV2KSB7DQogICAgaGlnaHAgZmxvYXQgdiA9IHRleHR1cmUoZGF0YSwgdXYpLng7DQogICAgI2lmZGVmIERBVEExX1VJTlQNCiAgICB2ID0gaW5mby54ICsgdiAqIGluZm8ueTsNCiAgICAjZW5kaWYNCiAgICByZXR1cm4gdjsNCn0NCiNpZmRlZiBEQVRBX0dSSURfVVYNCnVuaWZvcm0gbWVkaXVtcCBzYW1wbGVyMkQgdV9kYXRhMTE7DQp1bmlmb3JtIGhpZ2hwIHZlYzIgdV9kYXRhMTFfaW5mbzsNCmZsb2F0IHJlYWRHcmlkKHZlYzIgdXYpIHsNCiAgICBoaWdocCBmbG9hdCB2MCA9IGxlbmd0aCh2ZWMyKGdyaWREYXRhMCh1X2RhdGEwMCwgdV9kYXRhMDBfaW5mbywgdXYpLCBncmlkRGF0YTAodV9kYXRhMDEsIHVfZGF0YTAxX2luZm8sIHV2KSkpOw0KICAgIGhpZ2hwIGZsb2F0IHYxID0gbGVuZ3RoKHZlYzIoZ3JpZERhdGExKHVfZGF0YTEwLCB1X2RhdGExMF9pbmZvLCB1diksIGdyaWREYXRhMSh1X2RhdGExMSwgdV9kYXRhMTFfaW5mbywgdXYpKSk7DQogICAgcmV0dXJuIG1peCh2MCwgdjEsIHVfdHJhbnNpdGlvbik7DQp9DQojZWxzZQ0KZmxvYXQgcmVhZEdyaWQodmVjMiB1dikgew0KICAgIGhpZ2hwIGZsb2F0IHYwID0gZ3JpZERhdGEwKHVfZGF0YTAwLCB1X2RhdGEwMF9pbmZvLCB1dik7DQogICAgaGlnaHAgZmxvYXQgdjEgPSBncmlkRGF0YTEodV9kYXRhMTAsIHVfZGF0YTEwX2luZm8sIHV2KTsNCiAgICByZXR1cm4gbWl4KHYwLCB2MSwgdV90cmFuc2l0aW9uKTsNCn0NCiNlbmRpZg0KI2Vsc2UNCiNpZmRlZiBEQVRBX0dSSURfVVYNCnZlYzIgcmVhZEdyaWQyKHZlYzIgdXYpIHsNCiAgICByZXR1cm4gdmVjMihncmlkRGF0YTAodV9kYXRhMDAsIHVfZGF0YTAwX2luZm8sIHV2KSwgZ3JpZERhdGEwKHVfZGF0YTAxLCB1X2RhdGEwMV9pbmZvLCB1dikpOw0KfQ0KZmxvYXQgcmVhZEdyaWQodmVjMiB1dikgew0KICAgIHJldHVybiBsZW5ndGgocmVhZEdyaWQyKHV2KSk7DQp9DQojZWxzZQ0KZmxvYXQgcmVhZEdyaWQodmVjMiB1dikgew0KICAgIHJldHVybiBncmlkRGF0YTAodV9kYXRhMDAsIHVfZGF0YTAwX2luZm8sIHV2KTsNCn0NCiNlbmRpZg0KI2VuZGlmDQp2ZWMyIGRhdGFVdih2ZWMyIHBvcykgew0KICAgIHJldHVybiB2ZWMyKChkYXRhTG9uKHBvcy54KSAtIHVfZGF0YV9sb24ueCkgLyAodV9kYXRhX2xvbi55IC0gdV9kYXRhX2xvbi54KSwgKHBvcy55IC0gdV9kYXRhX2xhdC54KSAvICh1X2RhdGFfbGF0LnkgLSB1X2RhdGFfbGF0LngpKTsNCn0NCmZsb2F0IHJlYWREYXRhKHZlYzIgcG9zKSB7DQogICAgcmV0dXJuIHJlYWRHcmlkKGRhdGFVdihwb3MpKTsNCn0NCg=="), Eo = O("Y29uc3QgZmxvYXQgRVhURU5UID0gMTI4LjsNCmNvbnN0IGZsb2F0IFBJID0gMy4xNDE1OTI2NTM1ODk3OTM7DQpjb25zdCBmbG9hdCBGOTAgPSA5MC47DQpjb25zdCBmbG9hdCBGMTgwID0gMTgwLjsNCmNvbnN0IGZsb2F0IEYzNjAgPSAzNjAuOw0KY29uc3QgZmxvYXQgRjAgPSAwLjsNCmNvbnN0IGZsb2F0IEYxID0gMS47DQpjb25zdCBmbG9hdCBGXzEgPSAtMS47DQo="), Ao = O("dmVjMyBwcm9qZWN0aW9uR2xvYmUodmVjMyBwb3MpIHsNCiAgICBmbG9hdCB0aGV0YSA9ICgxLjUgLSAyLiAqIHBvcy54KSAqIFBJOw0KICAgIGZsb2F0IHBoaSA9IHBvcy55ICogUEk7DQogICAgZmxvYXQgbGVuID0gc2luKHBoaSk7DQogICAgcmV0dXJuIHZlYzMoY29zKHRoZXRhKSAqIGxlbiwgY29zKHBoaSksIHNpbih0aGV0YSkgKiBsZW4pICogcG9zLno7DQp9DQoNCnZlYzIgc2ltcGxlTG9uTGF0KHZlYzIgdXYpIHsNCiAgICByZXR1cm4gbWl4KHZlYzIoLUYxODAsIEY5MCksIHZlYzIoRjE4MCwgLUY5MCksIHV2KTsNCn0NCg0KdmVjMiBtZXJjYXRvclJldmVyc2UodmVjMiB1dikgew0KICAgIHZlYzIgcmUgPSBtaXgodmVjMigtRjE4MCksIHZlYzIoRjE4MCksIHV2KTsNCiAgICByZS55ID0gMTE0LjU5MTU1OTAyNjE2NDY1ICogYXRhbihleHAocmUueSAqIC0wLjAxNzQ1MzI5MjUxOTk0MzI5NSkpIC0gRjkwOw0KICAgIHJldHVybiByZTsNCn0NCg0KdmVjMiBtZXJjYXRvcih2ZWMyIGxsKSB7DQogICAgcmV0dXJuIHZlYzIoKEYxODAgKyBsbC54KSAvIEYzNjAsIChGMTgwIC0gKEYxODAgLyBQSSAqIGxvZyh0YW4oUEkgLyA0LiArIGxsLnkgKiBQSSAvIEYzNjApKSkpIC8gRjM2MCk7DQp9DQo="), Ro = `// 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
|
+
`, To = { header_vertex: vo, header_fragment: yo, use_mask: Co, use_display: go, use_bound: bo, use_color: Io, data_grid: xo, constant: Eo, projection: Ao };
|
|
1044
|
+
function yr(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(To))
|
|
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 Tt, wt, Lt, St, _t, Be, Ie, at, Re, _e, qr, Lo, it, jt, _r, wo = (_r = class {
|
|
1052
1052
|
constructor(r, e = 2) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1053
|
+
A(this, _e);
|
|
1054
|
+
A(this, Tt, {});
|
|
1055
|
+
A(this, wt, {});
|
|
1056
|
+
A(this, Lt, {});
|
|
1057
|
+
A(this, St, {});
|
|
1058
|
+
A(this, _t, {});
|
|
1059
|
+
A(this, Be);
|
|
1060
|
+
A(this, Ie);
|
|
1061
|
+
A(this, at, 0);
|
|
1062
|
+
A(this, Re);
|
|
1063
|
+
A(this, it, /* @__PURE__ */ new Map());
|
|
1064
|
+
E(this, Be, r), r.getExtension("OES_texture_float_linear"), E(this, Re, /* @__PURE__ */ new Map()), E(this, Ie, S(this, _e, qr).call(this, e));
|
|
1065
1065
|
}
|
|
1066
1066
|
vao(r, e) {
|
|
1067
|
-
const t = a(this,
|
|
1067
|
+
const t = a(this, Tt);
|
|
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 It, Ct, xt, Et, At, Me, ye, qe, xe, we, Pr, vo, et, Gt, br, mo = (br = class
|
|
|
1072
1072
|
return t[r];
|
|
1073
1073
|
}
|
|
1074
1074
|
buffer(r, e) {
|
|
1075
|
-
const t = a(this,
|
|
1075
|
+
const t = a(this, wt);
|
|
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,70 +1080,70 @@ var It, Ct, xt, Et, At, Me, ye, qe, xe, we, Pr, vo, et, Gt, br, mo = (br = 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, Lt);
|
|
1084
|
+
return n[r] || (n[r] = ho(a(this, Be), yr(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, St);
|
|
1088
|
+
return n[r] || (n[r] = fo(a(this, Be), yr(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, _t);
|
|
1092
|
+
return o[r] || (o[r] = uo(a(this, Be), e(), t(), n)), o[r];
|
|
1093
1093
|
}
|
|
1094
1094
|
exec(r, e, t) {
|
|
1095
|
-
const n =
|
|
1095
|
+
const n = Ft(this, at)._++ & 4095;
|
|
1096
1096
|
return new Promise((o) => {
|
|
1097
|
-
a(this,
|
|
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
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
execAll(r, e, t) {
|
|
1101
1101
|
const n = [];
|
|
1102
|
-
for (let o = 0; o < a(this,
|
|
1102
|
+
for (let o = 0; o < a(this, Ie).length; o++)
|
|
1103
1103
|
n.push(this.exec(r, e, t));
|
|
1104
1104
|
return Promise.all(n);
|
|
1105
1105
|
}
|
|
1106
1106
|
getTexture(r) {
|
|
1107
|
-
return
|
|
1107
|
+
return S(this, _e, jt).call(this, r).pop();
|
|
1108
1108
|
}
|
|
1109
1109
|
setTexture(r, e) {
|
|
1110
|
-
|
|
1110
|
+
S(this, _e, jt).call(this, r).push(e);
|
|
1111
1111
|
}
|
|
1112
|
-
},
|
|
1112
|
+
}, Tt = new WeakMap(), wt = new WeakMap(), Lt = new WeakMap(), St = new WeakMap(), _t = new WeakMap(), Be = new WeakMap(), Ie = new WeakMap(), at = new WeakMap(), Re = new WeakMap(), _e = new WeakSet(), qr = 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([Ro], { type: "application/javascript" })), { type: "module" });
|
|
1116
1116
|
e.push(n), n.onmessage = (o) => {
|
|
1117
1117
|
const i = o.data.key;
|
|
1118
|
-
a(this,
|
|
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
|
+
}, Lo = function(r, e, t) {
|
|
1123
|
+
const n = Ft(this, at)._++ & 4095;
|
|
1124
1124
|
return new Promise((o) => {
|
|
1125
|
-
a(this,
|
|
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
|
|
1127
|
+
}, it = new WeakMap(), jt = function(r) {
|
|
1128
|
+
let e = a(this, it).get(r);
|
|
1129
|
+
return e || (e = [], a(this, it).set(r, e)), e;
|
|
1130
|
+
}, _r);
|
|
1131
|
+
Fr("grid", ao).then();
|
|
1132
|
+
Fr("proxy", co).then();
|
|
1133
|
+
var j, he, st, Ke, K, en, gt, Jt, $t, qt, kr, So = (kr = class extends Yn {
|
|
1134
1134
|
constructor(e) {
|
|
1135
1135
|
super(e);
|
|
1136
|
-
|
|
1136
|
+
A(this, K);
|
|
1137
1137
|
//layer->zIndex
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1138
|
+
A(this, j);
|
|
1139
|
+
A(this, he);
|
|
1140
|
+
A(this, st);
|
|
1141
|
+
A(this, Ke, []);
|
|
1142
1142
|
/**
|
|
1143
1143
|
* 过度动画时间:毫秒
|
|
1144
1144
|
*/
|
|
1145
|
-
|
|
1146
|
-
|
|
1145
|
+
g(this, "transition");
|
|
1146
|
+
E(this, j, /* @__PURE__ */ new Map()), E(this, he, /* @__PURE__ */ new Map()), S(this, K, en).call(this, (e == null ? void 0 : e.style).layers), E(this, st, new wo(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 O, le, tt, Xe, z, Xr, dt, Nt, Yt, Ft, gr, yo = (gr = class extends Tn {
|
|
|
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
|
|
1159
|
+
return S(this, K, Jt).call(this, n, t), super.addLayer(e, t), this.sortLayer(), this;
|
|
1160
1160
|
{
|
|
1161
|
-
const o =
|
|
1162
|
-
return
|
|
1161
|
+
const o = S(this, K, qt).call(this, t);
|
|
1162
|
+
return S(this, K, gt).call(this, n, t), super.addLayer(e, o), this.sortLayer(), this;
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
/**
|
|
@@ -1168,12 +1168,12 @@ var O, le, tt, Xe, z, Xr, dt, Nt, Yt, Ft, gr, yo = (gr = class extends Tn {
|
|
|
1168
1168
|
* @param zIndex index or beforeId
|
|
1169
1169
|
*/
|
|
1170
1170
|
moveLayer(e, t = 0) {
|
|
1171
|
-
if (!a(this,
|
|
1172
|
-
if (
|
|
1173
|
-
return
|
|
1171
|
+
if (!a(this, j).has(e)) throw new Error(`The layer(id:${t}) does not exist!`);
|
|
1172
|
+
if (S(this, K, $t).call(this, e), typeof t == "string")
|
|
1173
|
+
return S(this, K, Jt).call(this, e, t), super.moveLayer(e, t), this.sortLayer(), this;
|
|
1174
1174
|
{
|
|
1175
|
-
const n =
|
|
1176
|
-
return
|
|
1175
|
+
const n = S(this, K, qt).call(this, t);
|
|
1176
|
+
return S(this, K, gt).call(this, e, t), super.moveLayer(e, n);
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
/**
|
|
@@ -1181,100 +1181,100 @@ var O, le, tt, Xe, z, Xr, dt, Nt, Yt, Ft, gr, yo = (gr = class extends Tn {
|
|
|
1181
1181
|
* @param id layer id
|
|
1182
1182
|
*/
|
|
1183
1183
|
removeLayer(e) {
|
|
1184
|
-
if (!a(this,
|
|
1185
|
-
return
|
|
1184
|
+
if (!a(this, j).has(e)) throw new Error(`The layer(id:${e}) does not exist!`);
|
|
1185
|
+
return S(this, K, $t).call(this, e), super.removeLayer(e);
|
|
1186
1186
|
}
|
|
1187
1187
|
/**
|
|
1188
1188
|
* show layer
|
|
1189
1189
|
* @param id layer id
|
|
1190
1190
|
*/
|
|
1191
1191
|
show(e) {
|
|
1192
|
-
a(this,
|
|
1192
|
+
a(this, j).has(e), super.setLayoutProperty(e, "visibility", "visible");
|
|
1193
1193
|
}
|
|
1194
1194
|
/**
|
|
1195
1195
|
* hide layer
|
|
1196
1196
|
* @param id
|
|
1197
1197
|
*/
|
|
1198
1198
|
hide(e) {
|
|
1199
|
-
a(this,
|
|
1199
|
+
a(this, j).has(e), super.setLayoutProperty(e, "visibility", "none");
|
|
1200
1200
|
}
|
|
1201
1201
|
/**
|
|
1202
1202
|
* @internal
|
|
1203
1203
|
*/
|
|
1204
1204
|
get renderFactory() {
|
|
1205
|
-
return a(this,
|
|
1205
|
+
return a(this, st);
|
|
1206
1206
|
}
|
|
1207
1207
|
setLayerLevelRule(e) {
|
|
1208
|
-
|
|
1208
|
+
E(this, Ke, 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, Ke).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, Ke).map((e) => e);
|
|
1216
1216
|
}
|
|
1217
1217
|
//endregion
|
|
1218
|
-
},
|
|
1218
|
+
}, j = new WeakMap(), he = new WeakMap(), st = new WeakMap(), Ke = new WeakMap(), K = new WeakSet(), //region private func
|
|
1219
1219
|
/**
|
|
1220
1220
|
* init mapbox layers
|
|
1221
1221
|
* @param layers
|
|
1222
1222
|
* @private
|
|
1223
1223
|
*/
|
|
1224
|
-
|
|
1224
|
+
en = function(e) {
|
|
1225
1225
|
if (e !== void 0)
|
|
1226
|
-
for (const t of e)
|
|
1226
|
+
for (const t of e) S(this, K, gt).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
|
-
|
|
1234
|
-
if (a(this,
|
|
1235
|
-
a(this,
|
|
1233
|
+
gt = function(e, t) {
|
|
1234
|
+
if (a(this, j).has(e)) throw new Error(`The layer(id:${e}) already exists!`);
|
|
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
|
}, /**
|
|
1237
1237
|
* add z-index by before id
|
|
1238
1238
|
* @param id layer id
|
|
1239
1239
|
* @param idBefore before layer id
|
|
1240
1240
|
* @private
|
|
1241
1241
|
*/
|
|
1242
|
-
|
|
1243
|
-
if (!a(this,
|
|
1244
|
-
const n = a(this,
|
|
1245
|
-
a(this,
|
|
1242
|
+
Jt = function(e, t) {
|
|
1243
|
+
if (!a(this, j).has(t)) throw new Error(`The before layer(id:${t}) does not exist!`);
|
|
1244
|
+
const n = a(this, j).get(t), o = a(this, he).get(n), i = o.findIndex((s) => s === t);
|
|
1245
|
+
a(this, j).set(e, n), o.splice(i, 0, t);
|
|
1246
1246
|
}, /**
|
|
1247
1247
|
* remove z-index
|
|
1248
1248
|
* @param id
|
|
1249
1249
|
* @private
|
|
1250
1250
|
*/
|
|
1251
|
-
|
|
1252
|
-
const t = a(this,
|
|
1253
|
-
n.splice(o, 1), a(this,
|
|
1251
|
+
$t = function(e) {
|
|
1252
|
+
const t = a(this, j).get(e), n = a(this, he).get(t), o = n.findIndex((i) => i === e);
|
|
1253
|
+
n.splice(o, 1), a(this, j).delete(e);
|
|
1254
1254
|
}, /**
|
|
1255
1255
|
* get z-index's before id
|
|
1256
1256
|
* @param zIndex z-index
|
|
1257
1257
|
* @return before layer id
|
|
1258
1258
|
* @private
|
|
1259
1259
|
*/
|
|
1260
|
-
|
|
1260
|
+
qt = function(e) {
|
|
1261
1261
|
let t;
|
|
1262
|
-
for (let n of a(this,
|
|
1262
|
+
for (let n of a(this, he).keys())
|
|
1263
1263
|
n > e && (t === void 0 || t > n) && (t = n);
|
|
1264
|
-
return t !== void 0 ? a(this,
|
|
1265
|
-
},
|
|
1264
|
+
return t !== void 0 ? a(this, he).get(t)[0] : void 0;
|
|
1265
|
+
}, kr), _o = 63710088e-1, Oe, Mr, ko = (Mr = class {
|
|
1266
1266
|
constructor() {
|
|
1267
|
-
|
|
1267
|
+
A(this, Oe);
|
|
1268
1268
|
}
|
|
1269
1269
|
get colorCanvas() {
|
|
1270
|
-
return a(this,
|
|
1270
|
+
return a(this, Oe) || E(this, Oe, new OffscreenCanvas(512, 1)), a(this, Oe);
|
|
1271
1271
|
}
|
|
1272
|
-
},
|
|
1273
|
-
function
|
|
1272
|
+
}, Oe = new WeakMap(), Mr);
|
|
1273
|
+
function tn(r) {
|
|
1274
1274
|
return r.data.BYTES_PER_ELEMENT <= 2;
|
|
1275
1275
|
}
|
|
1276
|
-
var
|
|
1277
|
-
function
|
|
1276
|
+
var Mo = new ko();
|
|
1277
|
+
function rn(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")
|
|
@@ -1288,115 +1288,115 @@ function zr(r, e, t, n = !1) {
|
|
|
1288
1288
|
o.push(d ? Math.log2(h) : h);
|
|
1289
1289
|
}
|
|
1290
1290
|
} else o = t;
|
|
1291
|
-
const i =
|
|
1291
|
+
const i = Mo.colorCanvas, s = i.getContext("2d"), l = i.width;
|
|
1292
1292
|
if (t.length % 2 === 0) {
|
|
1293
1293
|
const h = o[0], d = o[o.length - 2], p = d - h, f = s.createLinearGradient(0, 0, l, 0);
|
|
1294
|
-
for (let
|
|
1294
|
+
for (let m = 0; m < o.length; m += 2) f.addColorStop((o[m] - h) / p, o[m + 1]);
|
|
1295
1295
|
s.fillStyle = f, s.fillRect(0, 0, l, 1), e.u_color_range = [h, d];
|
|
1296
1296
|
} else {
|
|
1297
1297
|
let h = 0;
|
|
1298
1298
|
s.fillStyle = t[0], s.fillRect(h++, 0, 1, 1);
|
|
1299
1299
|
const d = o[1], p = o[o.length - 2], f = p - d;
|
|
1300
|
-
for (let
|
|
1301
|
-
s.fillStyle = o[
|
|
1302
|
-
const x = ~~((o[
|
|
1300
|
+
for (let m = 2; m < o.length - 1; m += 2) {
|
|
1301
|
+
s.fillStyle = o[m];
|
|
1302
|
+
const x = ~~((o[m + 1] - d) * (l - 1) / f) - h;
|
|
1303
1303
|
s.fillRect(h, 0, x, 1), h += x;
|
|
1304
1304
|
}
|
|
1305
1305
|
s.fillStyle = t[o.length - 1], s.fillRect(l - 1, 0, 1, 1), e.u_color_range = [d, p];
|
|
1306
1306
|
}
|
|
1307
|
-
let
|
|
1308
|
-
|
|
1309
|
-
const
|
|
1310
|
-
r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, l, 1, r.RGBA, r.UNSIGNED_BYTE,
|
|
1307
|
+
let c = e.u_color;
|
|
1308
|
+
c ? r.bindTexture(r.TEXTURE_2D, c) : (c = r.createTexture(), r.bindTexture(r.TEXTURE_2D, c), r.texStorage2D(r.TEXTURE_2D, 1, r.RGBA8, l, 1), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.NEAREST), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), e.u_color = c);
|
|
1309
|
+
const u = i.transferToImageBitmap();
|
|
1310
|
+
r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, l, 1, r.RGBA, r.UNSIGNED_BYTE, u), u.close(), r.bindTexture(r.TEXTURE_2D, null);
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1313
|
-
return !e &&
|
|
1312
|
+
function nn(r, e) {
|
|
1313
|
+
return !e && tn(r) ? "uint" : "float";
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function bt(r, e, t, n = !1) {
|
|
1316
1316
|
let o, i = 1;
|
|
1317
1317
|
Array.isArray(e) ? (o = e[0], e.length > 1 && (i = 2)) : o = e;
|
|
1318
|
-
const s =
|
|
1319
|
-
let
|
|
1320
|
-
return
|
|
1321
|
-
function
|
|
1318
|
+
const s = nn(o, n), l = `${s}-${t}-${n}`;
|
|
1319
|
+
let c = u(e, l);
|
|
1320
|
+
return c || (c = {}, Vo(r, c, e, t, n), e.texture.get(r)[l] = i === 1 ? [c.u_data00] : [c.u_data00, c.u_data01], e.info[l] = c), { number: i, filter: t, type: s, useLog: n, uniforms: c };
|
|
1321
|
+
function u(h, d) {
|
|
1322
1322
|
return h.texture || (h.texture = /* @__PURE__ */ new WeakMap()), (!h.texture.get(r) || !h.info) && (h.texture.set(r, {}), h.info = {}), h.info[d];
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function gr(r, e, t, n, o, i) {
|
|
1326
1326
|
const s = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1327
1327
|
if (o === 1 && i === 1)
|
|
1328
|
-
return
|
|
1329
|
-
const l = Math.floor(e.x / o),
|
|
1328
|
+
return Je(r, r.R8, e.x, e.y, r.RED, r.UNSIGNED_BYTE, e.data, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1329
|
+
const l = Math.floor(e.x / o), c = Math.floor(e.y / i), u = new Uint8Array(l * c);
|
|
1330
1330
|
let h = 0;
|
|
1331
1331
|
for (let d = 0; d < e.y; d += i) {
|
|
1332
1332
|
const p = d * e.x;
|
|
1333
1333
|
for (let f = 0; f < e.x; f += o)
|
|
1334
|
-
|
|
1334
|
+
u[h++] = e.data[p + f];
|
|
1335
1335
|
}
|
|
1336
|
-
return
|
|
1336
|
+
return Je(r, r.R8, l, c, r.RED, r.UNSIGNED_BYTE, u, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const s = e.data, l = typeof window.Float16Array == "function",
|
|
1338
|
+
function br(r, e, t, n, o, i) {
|
|
1339
|
+
const s = e.data, l = typeof window.Float16Array == "function", c = Math.floor(e.x / o), u = Math.floor(e.y / i), h = l ? new Float16Array(c * u) : new Float32Array(c * u), d = 1 << e.data.BYTES_PER_ELEMENT * 8 - 1, p = e.zeroNaN;
|
|
1340
1340
|
let f = 0;
|
|
1341
|
-
for (let
|
|
1342
|
-
const x =
|
|
1343
|
-
for (let
|
|
1344
|
-
const
|
|
1345
|
-
h[f++] = p &&
|
|
1341
|
+
for (let v = 0; v < e.y; v += i) {
|
|
1342
|
+
const x = v * e.x;
|
|
1343
|
+
for (let R = 0; R < e.x; R += o) {
|
|
1344
|
+
const C = s[x + R];
|
|
1345
|
+
h[f++] = p && C === 0 ? NaN : C - d;
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
1348
|
-
const
|
|
1349
|
-
return
|
|
1348
|
+
const m = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1349
|
+
return Je(
|
|
1350
1350
|
r,
|
|
1351
1351
|
r.R16F,
|
|
1352
|
-
u,
|
|
1353
1352
|
c,
|
|
1353
|
+
u,
|
|
1354
1354
|
r.RED,
|
|
1355
1355
|
l ? r.HALF_FLOAT : r.FLOAT,
|
|
1356
1356
|
l ? new Uint16Array(h.buffer) : h,
|
|
1357
|
-
|
|
1357
|
+
m,
|
|
1358
1358
|
n ? r.REPEAT : r.CLAMP_TO_EDGE
|
|
1359
1359
|
);
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function Ir(r, e, t, n, o, i) {
|
|
1362
1362
|
const s = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1363
1363
|
if (o === 1 && i === 1)
|
|
1364
|
-
return
|
|
1365
|
-
const l = Math.floor(e.x / o),
|
|
1364
|
+
return Je(r, r.R32F, e.x, e.y, r.RED, r.FLOAT, e.data, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1365
|
+
const l = Math.floor(e.x / o), c = Math.floor(e.y / i), u = new Float32Array(l * c);
|
|
1366
1366
|
let h = 0;
|
|
1367
1367
|
for (let d = 0; d < e.y; d += i) {
|
|
1368
1368
|
const p = d * e.x;
|
|
1369
1369
|
for (let f = 0; f < e.x; f += o)
|
|
1370
|
-
|
|
1370
|
+
u[h++] = e.data[p + f];
|
|
1371
1371
|
}
|
|
1372
|
-
return
|
|
1372
|
+
return Je(r, r.R32F, l, c, r.RED, r.FLOAT, u, s, n ? r.REPEAT : r.CLAMP_TO_EDGE);
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
const s = e.data, l = typeof window.Float16Array == "function",
|
|
1376
|
-
if (
|
|
1377
|
-
const { reference: f, scale:
|
|
1374
|
+
function Cr(r, e, t, n, o, i) {
|
|
1375
|
+
const s = e.data, l = typeof window.Float16Array == "function", c = Math.floor(e.x / o), u = Math.floor(e.y / i), h = l ? new Float16Array(c * u) : new Float32Array(c * u);
|
|
1376
|
+
if (tn(e)) {
|
|
1377
|
+
const { reference: f, scale: m, zeroNaN: v } = e;
|
|
1378
1378
|
let x = 0;
|
|
1379
|
-
for (let
|
|
1380
|
-
const
|
|
1381
|
-
for (let
|
|
1382
|
-
const
|
|
1383
|
-
h[x++] =
|
|
1379
|
+
for (let R = 0; R < e.y; R += i) {
|
|
1380
|
+
const C = R * e.x;
|
|
1381
|
+
for (let b = 0; b < e.x; b += o) {
|
|
1382
|
+
const B = s[C + b];
|
|
1383
|
+
h[x++] = v && B === 0 ? NaN : Math.log2(B * m + f);
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
1386
|
} else {
|
|
1387
1387
|
let f = 0;
|
|
1388
|
-
for (let
|
|
1389
|
-
const
|
|
1388
|
+
for (let m = 0; m < e.y; m += i) {
|
|
1389
|
+
const v = m * e.x;
|
|
1390
1390
|
for (let x = 0; x < e.x; x += o)
|
|
1391
|
-
h[f++] = Math.log2(e.data[
|
|
1391
|
+
h[f++] = Math.log2(e.data[v + x]);
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
const p = t === "linear" ? r.LINEAR : r.NEAREST;
|
|
1395
|
-
return
|
|
1395
|
+
return Je(
|
|
1396
1396
|
r,
|
|
1397
1397
|
r.R16F,
|
|
1398
|
-
u,
|
|
1399
1398
|
c,
|
|
1399
|
+
u,
|
|
1400
1400
|
r.RED,
|
|
1401
1401
|
l ? r.HALF_FLOAT : r.FLOAT,
|
|
1402
1402
|
l ? new Uint16Array(h.buffer) : h,
|
|
@@ -1404,188 +1404,188 @@ function cr(r, e, t, n, o, i) {
|
|
|
1404
1404
|
n ? r.REPEAT : r.CLAMP_TO_EDGE
|
|
1405
1405
|
);
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1408
|
-
const
|
|
1409
|
-
return r.bindTexture(r.TEXTURE_2D,
|
|
1407
|
+
function Je(r, e, t, n, o, i, s, l, c) {
|
|
1408
|
+
const u = r.createTexture();
|
|
1409
|
+
return r.bindTexture(r.TEXTURE_2D, u), 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, c), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.bindTexture(r.TEXTURE_2D, null), u;
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function Vo(r, e, t, n, o) {
|
|
1412
1412
|
let i, s = null;
|
|
1413
1413
|
Array.isArray(t) ? (i = t[0], t.length === 2 && (s = t[1])) : i = t;
|
|
1414
|
-
const l =
|
|
1415
|
-
e.u_data_lon = [d - f / 2, d + f * (
|
|
1416
|
-
const
|
|
1417
|
-
e.u_data_lat = [
|
|
1418
|
-
const
|
|
1414
|
+
const l = nn(i, o), c = r.getParameter(r.MAX_TEXTURE_SIZE), u = Math.ceil(i.x / c), h = Math.ceil(i.y / c), d = i.lon[0], f = (i.lon[1] - d) / (i.x - 1) * u, m = Math.floor(i.x / u);
|
|
1415
|
+
e.u_data_lon = [d - f / 2, d + f * (m - 0.5)];
|
|
1416
|
+
const v = i.lat[0], R = (i.lat[1] - v) / (i.y - 1) * h, C = Math.floor(i.y / h);
|
|
1417
|
+
e.u_data_lat = [v - R / 2, v + R * (C - 0.5)];
|
|
1418
|
+
const b = Math.round(e.u_data_lon[1] - e.u_data_lon[0]) === 360;
|
|
1419
1419
|
if (l === "uint") {
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1420
|
+
const L = i;
|
|
1421
|
+
if (L.zeroNaN || L.data.BYTES_PER_ELEMENT > 1 ? (e.u_data00 = br(r, L, n, b, u, h), e.u_data00_info = B(L.reference, L.scale, L.data.BYTES_PER_ELEMENT * 8)) : (e.u_data00 = gr(r, L, n, b, u, h), e.u_data00_info = [L.reference, L.scale * 255]), s) {
|
|
1422
|
+
const M = s;
|
|
1423
|
+
M.zeroNaN || M.data.BYTES_PER_ELEMENT > 1 ? (e.u_data01 = br(r, M, n, b, u, h), e.u_data01_info = B(M.reference, M.scale, M.data.BYTES_PER_ELEMENT * 8)) : (e.u_data01 = gr(r, M, n, b, u, h), e.u_data01_info = [M.reference, M.scale * 255]);
|
|
1424
1424
|
}
|
|
1425
1425
|
} else if (l === "float")
|
|
1426
|
-
e.u_data00 = o ?
|
|
1426
|
+
e.u_data00 = o ? Cr(r, i, n, b, u, h) : Ir(r, i, n, b, u, h), s && (e.u_data01 = o ? Cr(r, s, n, b, u, h) : Ir(r, s, n, b, u, h));
|
|
1427
1427
|
else
|
|
1428
1428
|
throw new Error(`Unknown data texture type: ${l}`);
|
|
1429
|
-
function
|
|
1430
|
-
return [(1 <<
|
|
1429
|
+
function B(L, M, T) {
|
|
1430
|
+
return [(1 << T - 1) * M + L, M];
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function on(r, e) {
|
|
1434
1434
|
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
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
r.u_elevation = (e.elevation ?? 0) /
|
|
1436
|
+
function an(r, e) {
|
|
1437
|
+
r.u_elevation = (e.elevation ?? 0) / _o;
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function Bo(r, e) {
|
|
1440
1440
|
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
1441
|
}
|
|
1442
|
-
var
|
|
1442
|
+
var Do = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KdW5pZm9ybSBtYXQ0IHVfbWF0cml4Ow0KdW5pZm9ybSBmbG9hdCB1X2VsZXZhdGlvbjsNCmluIHZlYzIgYV9wb3M7DQpvdXQgaGlnaHAgdmVjMiB2X3BvczsNCiNpbmNsdWRlIDxjb25zdGFudD4NCiNpZmRlZiBHTE9CRQ0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQp2b2lkIG1haW4oKSB7DQogICAgdl9wb3MgPSBhX3BvcyAvIEVYVEVOVDsNCiAgICBnbF9Qb3NpdGlvbiA9IHVfbWF0cml4ICogdmVjNChwcm9qZWN0aW9uR2xvYmUodmVjMyh2X3BvcywgRjEgKyB1X2VsZXZhdGlvbikpLCBGMSk7DQp9DQojZWxzZQ0Kdm9pZCBtYWluKCkgew0KICAgIHZfcG9zID0gYV9wb3M7DQogICAgZ2xfUG9zaXRpb24gPSB1X21hdHJpeCAqIHZlYzQoYV9wb3MsIHVfZWxldmF0aW9uLCBGMSk7DQp9DQojZW5kaWYNCg=="), No = O("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBoaWdocCBmbG9hdDsNCnByZWNpc2lvbiBoaWdocCBpbnQ7DQojaW5jbHVkZSA8ZGVmaW5lPg0KI2luY2x1ZGUgPGNvbnN0YW50Pg0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQojaW5jbHVkZSA8dXNlX2NvbG9yPg0KI2luY2x1ZGUgPHVzZV9kaXNwbGF5Pg0KI2luY2x1ZGUgPHVzZV9ib3VuZD4NCiNpbmNsdWRlIDx1c2VfbWFzaz4NCiNpbmNsdWRlIDxkYXRhX2dyaWQ+DQppbiBoaWdocCB2ZWMyIHZfcG9zOw0Kb3V0IGxvd3AgdmVjNCBvX2NvbG9yOw0Kdm9pZCBtYWluKCkgew0KICAgICNpZmRlZiBVU0VfTUFTSw0KICAgIGlmIChpbnZhbGlkTWFzaygpKWRpc2NhcmQ7DQogICAgI2VuZGlmDQogICAgI2lmZGVmIEdMT0JFDQogICAgdmVjMiBsb25MYXQgPSBzaW1wbGVMb25MYXQodl9wb3MpOw0KICAgICNlbHNlDQogICAgdmVjMiBsb25MYXQgPSBtZXJjYXRvclJldmVyc2UoZnJhY3Qodl9wb3MpKTsNCiAgICAjZW5kaWYNCiAgICBpZiAoaW52YWxpZEJvdW5kKGxvbkxhdCkgfHwgaW52YWxpZERhdGFCb3VuZChsb25MYXQpKWRpc2NhcmQ7DQogICAgZmxvYXQgdmFsID0gcmVhZERhdGEobG9uTGF0KTsNCiAgICBpZiAoaW52YWxpZERpc3BsYXkodmFsKSlkaXNjYXJkOw0KICAgIG9fY29sb3IgPSByZWFkQ29sb3IodmFsKSAqIHVfb3BhY2l0eTsNCn0NCg=="), Zo = {
|
|
1443
1443
|
color: [],
|
|
1444
1444
|
dataFilter: "linear",
|
|
1445
1445
|
min: void 0,
|
|
1446
1446
|
max: void 0,
|
|
1447
1447
|
elevation: 0,
|
|
1448
1448
|
opacity: 1
|
|
1449
|
-
},
|
|
1449
|
+
}, ae, Ce, ie, se, Ue, W, ee, ne, De, $, sn, er, tr, ln, rr, Vr, Go = (Vr = class extends jr {
|
|
1450
1450
|
constructor(e) {
|
|
1451
1451
|
super(e);
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1452
|
+
A(this, $);
|
|
1453
|
+
A(this, ae);
|
|
1454
|
+
A(this, Ce);
|
|
1455
|
+
A(this, ie);
|
|
1456
|
+
A(this, se);
|
|
1457
|
+
A(this, Ue);
|
|
1458
1458
|
// current,next
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1459
|
+
A(this, W, null);
|
|
1460
|
+
A(this, ee, null);
|
|
1461
|
+
A(this, ne);
|
|
1462
1462
|
// transition
|
|
1463
|
-
|
|
1464
|
-
|
|
1463
|
+
A(this, De, 0);
|
|
1464
|
+
E(this, ne, {}), E(this, se, Object.assign({}, Zo, e)), E(this, Ue, e.useLog ?? !1);
|
|
1465
1465
|
}
|
|
1466
1466
|
/**
|
|
1467
1467
|
* @internal
|
|
1468
1468
|
*/
|
|
1469
1469
|
onAdd(e, t) {
|
|
1470
|
-
|
|
1470
|
+
E(this, ae, e), E(this, Ce, e.renderFactory);
|
|
1471
1471
|
const n = e.getSource(this.source);
|
|
1472
1472
|
if (!n)
|
|
1473
1473
|
throw new Error(`The source(id:${this.source}) not found!`);
|
|
1474
|
-
|
|
1474
|
+
E(this, ie, n), n.on("data", ({ data: o }) => S(this, $, rr).call(this, o)), S(this, $, er).call(this, a(this, se), !0), S(this, $, rr).call(this, n.lastData());
|
|
1475
1475
|
}
|
|
1476
1476
|
/**
|
|
1477
1477
|
* @internal
|
|
1478
1478
|
*/
|
|
1479
1479
|
onRemove(e, t) {
|
|
1480
|
-
a(this,
|
|
1480
|
+
a(this, W) && (a(this, ie).unlink(a(this, W)), E(this, W, null)), a(this, ee) && (a(this, ie).unlink(a(this, ee)), E(this, ee, null)), a(this, ne).u_color && t.deleteTexture(a(this, ne).u_color);
|
|
1481
1481
|
}
|
|
1482
1482
|
/**
|
|
1483
1483
|
* @internal
|
|
1484
1484
|
*/
|
|
1485
1485
|
render(e, t) {
|
|
1486
|
-
if (!a(this,
|
|
1487
|
-
const n = a(this,
|
|
1486
|
+
if (!a(this, W)) return;
|
|
1487
|
+
const n = a(this, se).dataFilter, o = a(this, Ue), i = a(this, De) - Date.now(), s = t.shaderData.variantName;
|
|
1488
1488
|
let l;
|
|
1489
1489
|
if (i > 0) {
|
|
1490
|
-
a(this,
|
|
1491
|
-
const
|
|
1492
|
-
l =
|
|
1490
|
+
a(this, ne).u_transition = i / (a(this, se).transition ?? a(this, ae).transition);
|
|
1491
|
+
const u = bt(e, a(this, W), n, o), h = bt(e, a(this, ee), n, o);
|
|
1492
|
+
l = S(this, $, tr).call(this, s, u, h), Object.assign(a(this, ne), u.uniforms);
|
|
1493
1493
|
for (let d in h.uniforms)
|
|
1494
|
-
a(this,
|
|
1495
|
-
a(this,
|
|
1494
|
+
a(this, ne)[d.replace("u_data0", "u_data1")] = h.uniforms[d];
|
|
1495
|
+
a(this, ae).triggerRepaint();
|
|
1496
1496
|
} else {
|
|
1497
|
-
|
|
1498
|
-
const
|
|
1499
|
-
l =
|
|
1497
|
+
E(this, De, 0), E(this, ee, null);
|
|
1498
|
+
const u = bt(e, a(this, W), n, o);
|
|
1499
|
+
l = S(this, $, tr).call(this, s, u), Object.assign(a(this, ne), u.uniforms);
|
|
1500
1500
|
}
|
|
1501
|
-
a(this,
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1501
|
+
a(this, ne).u_matrix = S(this, $, sn).call(this, t), e.useProgram(l.program), e.enable(e.CULL_FACE), yt(l, a(this, ne));
|
|
1502
|
+
const c = a(this, Ce).vao(s, () => S(this, $, ln).call(this, e, s, l));
|
|
1503
|
+
Qt(c);
|
|
1504
1504
|
}
|
|
1505
1505
|
setOptions(e) {
|
|
1506
1506
|
var t;
|
|
1507
|
-
|
|
1507
|
+
S(this, $, er).call(this, e, e.color !== void 0 && Jr((t = a(this, se)) == null ? void 0 : t.color, e.color)), a(this, ae).triggerRepaint();
|
|
1508
1508
|
}
|
|
1509
|
-
},
|
|
1510
|
-
const n = e.variantName === "globe", { mainMatrix: o } = n ? a(this,
|
|
1509
|
+
}, ae = new WeakMap(), Ce = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), Ue = new WeakMap(), W = new WeakMap(), ee = new WeakMap(), ne = new WeakMap(), De = new WeakMap(), $ = new WeakSet(), sn = function({ shaderData: e, defaultProjectionData: t }) {
|
|
1510
|
+
const n = e.variantName === "globe", { mainMatrix: o } = n ? a(this, ae).transform.getProjectionData({ overscaledTileID: null, applyGlobeMatrix: !0 }) : t;
|
|
1511
1511
|
return o;
|
|
1512
|
-
},
|
|
1513
|
-
const n = a(this,
|
|
1514
|
-
t && e.color &&
|
|
1515
|
-
},
|
|
1516
|
-
const { number: o, type: i } = t, s = n !== void 0, l = `heatmap:${e}-${o}-${i + (s ? "-" + n.type : "")}-${a(this,
|
|
1517
|
-
return a(this,
|
|
1512
|
+
}, er = function(e, t) {
|
|
1513
|
+
const n = a(this, se), o = a(this, ne);
|
|
1514
|
+
t && e.color && rn(a(this, ae).painter.context.gl, o, e.color, a(this, Ue)), E(this, se, Object.assign(n, e)), Bo(o, n), on(o, n.bound), an(o, n);
|
|
1515
|
+
}, tr = function(e, t, n) {
|
|
1516
|
+
const { number: o, type: i } = t, s = n !== void 0, l = `heatmap:${e}-${o}-${i + (s ? "-" + n.type : "")}-${a(this, se).mask ? "mask" : "unmask"}`, c = e === "globe";
|
|
1517
|
+
return a(this, Ce).program(
|
|
1518
1518
|
l,
|
|
1519
|
-
() => a(this,
|
|
1520
|
-
() => a(this,
|
|
1519
|
+
() => a(this, Ce).vertex("heatmap:" + e, Do, () => c ? "#define GLOBE" : ""),
|
|
1520
|
+
() => a(this, Ce).fragment(
|
|
1521
1521
|
l,
|
|
1522
|
-
|
|
1522
|
+
No,
|
|
1523
1523
|
() => {
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1524
|
+
const u = [];
|
|
1525
|
+
if (c && u.push("GLOBE"), u.push(o === 1 ? "DATA_GRID" : "DATA_GRID_UV"), i === "uint" ? u.push("DATA0_UINT") : i === "float" && u.push("DATA0_FLOAT"), s) {
|
|
1526
1526
|
const h = n.type;
|
|
1527
|
-
|
|
1527
|
+
u.push("DATA1"), h === "uint" ? u.push("DATA1_UINT") : h === "float" && u.push("DATA1_FLOAT");
|
|
1528
1528
|
}
|
|
1529
|
-
return
|
|
1529
|
+
return u.map((h) => "#define " + h).join(`
|
|
1530
1530
|
`);
|
|
1531
1531
|
}
|
|
1532
1532
|
)
|
|
1533
1533
|
);
|
|
1534
|
-
},
|
|
1535
|
-
const o = a(this,
|
|
1534
|
+
}, ln = function(e, t, n) {
|
|
1535
|
+
const o = a(this, Ce).buffer(
|
|
1536
1536
|
t,
|
|
1537
|
-
() => t === "globe" ?
|
|
1537
|
+
() => t === "globe" ? po(e) : cr(e, {
|
|
1538
1538
|
a_pos: { size: 2, data: new Int8Array([-3, 0, -3, 1, 4, 0, 4, 1]), type: e.BYTE }
|
|
1539
1539
|
})
|
|
1540
1540
|
);
|
|
1541
|
-
return
|
|
1542
|
-
},
|
|
1541
|
+
return Ut(e, n, o, e.TRIANGLE_STRIP);
|
|
1542
|
+
}, rr = function(e) {
|
|
1543
1543
|
if (!e) {
|
|
1544
|
-
a(this,
|
|
1544
|
+
a(this, ee) && (a(this, ie).unlink(a(this, ee)), E(this, ee, null)), a(this, W) && (a(this, ie).unlink(a(this, W)), E(this, W, null), a(this, ae).triggerRepaint());
|
|
1545
1545
|
return;
|
|
1546
1546
|
}
|
|
1547
|
-
if (a(this,
|
|
1548
|
-
const t = a(this,
|
|
1549
|
-
t === 0 ? a(this,
|
|
1547
|
+
if (a(this, W)) {
|
|
1548
|
+
const t = a(this, se).transition ?? a(this, ae).transition;
|
|
1549
|
+
t === 0 ? a(this, ie).unlink(a(this, W)) : (a(this, ee) && a(this, ie).unlink(a(this, ee)), zr(a(this, W), e) ? (E(this, ee, a(this, W)), E(this, De, Date.now() + t)) : (a(this, ie).unlink(a(this, W)), E(this, De, 0)));
|
|
1550
1550
|
}
|
|
1551
|
-
a(this,
|
|
1552
|
-
},
|
|
1553
|
-
function
|
|
1551
|
+
a(this, ie).link(e), E(this, W, e), a(this, ae).triggerRepaint();
|
|
1552
|
+
}, Vr), Yo = "text-tile";
|
|
1553
|
+
function Fo(r) {
|
|
1554
1554
|
return r.data.BYTES_PER_ELEMENT <= 2;
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1556
|
+
function cn(r, e, t, n, o, i, s, l) {
|
|
1557
|
+
const c = Math.round((l - i[0]) / n);
|
|
1558
|
+
if (c < 0 || c >= e) return -1;
|
|
1559
1559
|
s - o[0] >= 360 && (s -= 360), o[1] - s >= 360 && (s += 360);
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1560
|
+
const u = Math.round((s - o[0]) / t);
|
|
1561
|
+
return u < 0 || u >= r ? -1 : c * r + u;
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function un(r, e) {
|
|
1564
1564
|
if (e < 0) return NaN;
|
|
1565
1565
|
{
|
|
1566
1566
|
let t = r.data[e];
|
|
1567
|
-
return
|
|
1567
|
+
return Fo(r) && (t = r.zeroNaN && t === 0 ? NaN : r.reference + r.scale * t), t;
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
-
function
|
|
1571
|
-
const { x: t, y: n, lon: o, lat: i } = r, s = new Float32Array(e.length), l = (o[1] - o[0]) / (t - 1),
|
|
1572
|
-
for (let
|
|
1573
|
-
const [h, d] = e[
|
|
1574
|
-
s[
|
|
1570
|
+
function Le(r, e) {
|
|
1571
|
+
const { x: t, y: n, lon: o, lat: i } = r, s = new Float32Array(e.length), l = (o[1] - o[0]) / (t - 1), c = (i[1] - i[0]) / (n - 1);
|
|
1572
|
+
for (let u = 0; u < e.length; u++) {
|
|
1573
|
+
const [h, d] = e[u], p = cn(t, n, l, c, o, i, h, d);
|
|
1574
|
+
s[u] = un(r, p);
|
|
1575
1575
|
}
|
|
1576
1576
|
return s;
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const { x: n, y: o, lon: i, lat: s } = r, l = new Float32Array(e.length * t.length),
|
|
1578
|
+
function pt(r, e, t) {
|
|
1579
|
+
const { x: n, y: o, lon: i, lat: s } = r, l = new Float32Array(e.length * t.length), c = (i[1] - i[0]) / (n - 1), u = (s[1] - s[0]) / (o - 1);
|
|
1580
1580
|
let h = 0;
|
|
1581
1581
|
for (const d of t)
|
|
1582
1582
|
for (const p of e) {
|
|
1583
|
-
const f =
|
|
1584
|
-
l[h++] =
|
|
1583
|
+
const f = cn(n, o, c, u, i, s, p, d);
|
|
1584
|
+
l[h++] = un(r, f);
|
|
1585
1585
|
}
|
|
1586
1586
|
return l;
|
|
1587
1587
|
}
|
|
1588
|
-
var
|
|
1588
|
+
var Po = {
|
|
1589
1589
|
// color: 'white',
|
|
1590
1590
|
color: (r) => "#fff",
|
|
1591
1591
|
min: void 0,
|
|
@@ -1595,67 +1595,67 @@ var So = {
|
|
|
1595
1595
|
convert: (r) => r.toFixed(1),
|
|
1596
1596
|
font: "24px Arial",
|
|
1597
1597
|
align: "center"
|
|
1598
|
-
},
|
|
1598
|
+
}, z, kt, dn, Br, Xo = (Br = class extends lr {
|
|
1599
1599
|
constructor(e) {
|
|
1600
1600
|
super(e);
|
|
1601
|
-
|
|
1602
|
-
|
|
1601
|
+
A(this, kt);
|
|
1602
|
+
A(this, z);
|
|
1603
1603
|
/**
|
|
1604
1604
|
* @internal
|
|
1605
1605
|
*/
|
|
1606
|
-
|
|
1606
|
+
g(this, "loadTile", async (e, t) => {
|
|
1607
1607
|
var o, i;
|
|
1608
|
-
const n =
|
|
1609
|
-
return n ? this.renderFactory.exec(
|
|
1608
|
+
const n = S(this, kt, dn).call(this, e, t);
|
|
1609
|
+
return n ? this.renderFactory.exec(Yo, {
|
|
1610
1610
|
canvas: { type: "2d", size: this.tileSize * 2 },
|
|
1611
1611
|
data: {
|
|
1612
|
-
font: a(this,
|
|
1613
|
-
align: a(this,
|
|
1614
|
-
opacity: a(this,
|
|
1615
|
-
convert: (o = a(this,
|
|
1616
|
-
color: typeof a(this,
|
|
1612
|
+
font: a(this, z).font,
|
|
1613
|
+
align: a(this, z).align,
|
|
1614
|
+
opacity: a(this, z).opacity,
|
|
1615
|
+
convert: (o = a(this, z).convert) == null ? void 0 : o.toString(),
|
|
1616
|
+
color: typeof a(this, z).color == "string" ? a(this, z).color : (i = a(this, z).color) == null ? void 0 : i.toString(),
|
|
1617
1617
|
data: n
|
|
1618
1618
|
}
|
|
1619
1619
|
}, [n]) : null;
|
|
1620
1620
|
});
|
|
1621
|
-
|
|
1622
|
-
|
|
1621
|
+
g(this, "setOptions", (e) => {
|
|
1622
|
+
E(this, z, Object.assign(a(this, z), e)), super.setOptions(e);
|
|
1623
1623
|
});
|
|
1624
|
-
|
|
1624
|
+
E(this, z, Object.assign({}, Po, e));
|
|
1625
1625
|
}
|
|
1626
|
-
},
|
|
1627
|
-
const { bound: n } = a(this,
|
|
1626
|
+
}, z = new WeakMap(), kt = new WeakSet(), dn = function(e, t) {
|
|
1627
|
+
const { bound: n } = a(this, z), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, i = Kr(e, o, a(this, z).cell, n);
|
|
1628
1628
|
if (i.length === 0) return null;
|
|
1629
1629
|
const s = h(this.data0, i);
|
|
1630
1630
|
if (t > 0) {
|
|
1631
1631
|
const d = t, p = 1 - d, f = h(this.data1, i);
|
|
1632
|
-
for (let
|
|
1633
|
-
s[
|
|
1632
|
+
for (let m = 0; m < s.length; m++)
|
|
1633
|
+
s[m] = p * s[m] + d * f[m];
|
|
1634
1634
|
}
|
|
1635
|
-
const l = [],
|
|
1635
|
+
const l = [], c = a(this, z).min, u = a(this, z).max;
|
|
1636
1636
|
for (let d = 0; d < s.length; d++) {
|
|
1637
1637
|
const p = s[d];
|
|
1638
|
-
if (isNaN(p) || p <
|
|
1639
|
-
const [f,
|
|
1640
|
-
l.push(f,
|
|
1638
|
+
if (isNaN(p) || p < c || p > u) continue;
|
|
1639
|
+
const [f, m] = Or(e, i[d]);
|
|
1640
|
+
l.push(f, m, p);
|
|
1641
1641
|
}
|
|
1642
1642
|
return l.length > 0 ? new Float32Array(l).buffer : null;
|
|
1643
1643
|
function h(d, p) {
|
|
1644
|
-
if (!Array.isArray(d)) return
|
|
1645
|
-
if (d.length === 1) return
|
|
1646
|
-
const f =
|
|
1647
|
-
for (let
|
|
1648
|
-
f[
|
|
1644
|
+
if (!Array.isArray(d)) return Le(d, p);
|
|
1645
|
+
if (d.length === 1) return Le(d[0], p);
|
|
1646
|
+
const f = Le(d[0], p), m = Le(d[1], p);
|
|
1647
|
+
for (let v = 0; v < f.length; v++)
|
|
1648
|
+
f[v] = Math.hypot(f[v], m[v]);
|
|
1649
1649
|
return f;
|
|
1650
1650
|
}
|
|
1651
|
-
},
|
|
1652
|
-
function
|
|
1651
|
+
}, Br), Wo = "vector-init-image", zo = "vector-tile-image", Ho = "vector-tile-arrow";
|
|
1652
|
+
function hn(r, ...e) {
|
|
1653
1653
|
for (const t of e)
|
|
1654
1654
|
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 :
|
|
1655
|
+
o !== void 0 && (r[n] = Array.isArray(o) || typeof o != "object" || o.byteLength !== void 0 ? o : hn(r[n] ?? {}, o));
|
|
1656
1656
|
return r;
|
|
1657
1657
|
}
|
|
1658
|
-
var
|
|
1658
|
+
var Ko = {
|
|
1659
1659
|
type: "uv",
|
|
1660
1660
|
image: void 0,
|
|
1661
1661
|
level: [],
|
|
@@ -1664,7 +1664,7 @@ var Bo = {
|
|
|
1664
1664
|
opacity: 1,
|
|
1665
1665
|
cell: 6,
|
|
1666
1666
|
flip: !1
|
|
1667
|
-
},
|
|
1667
|
+
}, Oo = {
|
|
1668
1668
|
type: "uv",
|
|
1669
1669
|
color: "white",
|
|
1670
1670
|
min: void 0,
|
|
@@ -1675,307 +1675,307 @@ var Bo = {
|
|
|
1675
1675
|
font: "36px serif",
|
|
1676
1676
|
text: "↓"
|
|
1677
1677
|
}
|
|
1678
|
-
},
|
|
1678
|
+
}, Uo = /* @__PURE__ */ new Set(), Y, lt, Mt, fn, Dr, Qo = (Dr = class extends lr {
|
|
1679
1679
|
constructor(e) {
|
|
1680
1680
|
super(e);
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1681
|
+
A(this, Mt);
|
|
1682
|
+
A(this, Y);
|
|
1683
|
+
A(this, lt, null);
|
|
1684
1684
|
/**
|
|
1685
1685
|
* @internal
|
|
1686
1686
|
*/
|
|
1687
|
-
|
|
1688
|
-
const n = a(this,
|
|
1687
|
+
g(this, "loadTile", async (e, t) => {
|
|
1688
|
+
const n = a(this, Y).type, o = S(this, Mt, fn).call(this, e, n, t);
|
|
1689
1689
|
if (!o) return null;
|
|
1690
1690
|
const i = { type: "2d", size: this.tileSize * 2 };
|
|
1691
|
-
return a(this,
|
|
1692
|
-
|
|
1691
|
+
return a(this, Y).image ? a(this, lt).then(() => this.renderFactory.exec(
|
|
1692
|
+
zo,
|
|
1693
1693
|
{
|
|
1694
1694
|
cache: "vector",
|
|
1695
1695
|
canvas: i,
|
|
1696
1696
|
data: {
|
|
1697
1697
|
type: n,
|
|
1698
|
-
color: a(this,
|
|
1699
|
-
image: a(this,
|
|
1700
|
-
level: a(this,
|
|
1701
|
-
flip: a(this,
|
|
1702
|
-
opacity: a(this,
|
|
1698
|
+
color: a(this, Y).color,
|
|
1699
|
+
image: a(this, Y).image,
|
|
1700
|
+
level: a(this, Y).level,
|
|
1701
|
+
flip: a(this, Y).flip,
|
|
1702
|
+
opacity: a(this, Y).opacity,
|
|
1703
1703
|
data: o
|
|
1704
1704
|
}
|
|
1705
1705
|
},
|
|
1706
1706
|
[o]
|
|
1707
1707
|
)) : this.renderFactory.exec(
|
|
1708
|
-
|
|
1708
|
+
Ho,
|
|
1709
1709
|
{
|
|
1710
1710
|
canvas: i,
|
|
1711
1711
|
data: {
|
|
1712
1712
|
type: n,
|
|
1713
|
-
color: a(this,
|
|
1714
|
-
opacity: a(this,
|
|
1715
|
-
flip: a(this,
|
|
1716
|
-
arrow: a(this,
|
|
1713
|
+
color: a(this, Y).color,
|
|
1714
|
+
opacity: a(this, Y).opacity,
|
|
1715
|
+
flip: a(this, Y).flip,
|
|
1716
|
+
arrow: a(this, Y).arrow,
|
|
1717
1717
|
data: o
|
|
1718
1718
|
}
|
|
1719
1719
|
},
|
|
1720
1720
|
[o]
|
|
1721
1721
|
);
|
|
1722
1722
|
});
|
|
1723
|
-
|
|
1724
|
-
|
|
1723
|
+
g(this, "setOptions", (e) => {
|
|
1724
|
+
E(this, Y, Object.assign(a(this, Y), e)), super.setOptions(e);
|
|
1725
1725
|
});
|
|
1726
|
-
|
|
1726
|
+
E(this, Y, hn({}, e.image ? Ko : Oo, e));
|
|
1727
1727
|
}
|
|
1728
1728
|
/**
|
|
1729
1729
|
* @internal
|
|
1730
1730
|
*/
|
|
1731
1731
|
onAdd(e) {
|
|
1732
|
-
if (super.onAdd(e), a(this,
|
|
1733
|
-
const t = a(this,
|
|
1734
|
-
|
|
1732
|
+
if (super.onAdd(e), a(this, Y).image) {
|
|
1733
|
+
const t = a(this, Y).image.src;
|
|
1734
|
+
Uo.add(t);
|
|
1735
1735
|
let n;
|
|
1736
|
-
|
|
1736
|
+
E(this, lt, new Promise((o) => n = o)), fetch(t).then((o) => o.blob()).then((o) => this.renderFactory.execAll(Wo, {
|
|
1737
1737
|
cache: "vector",
|
|
1738
1738
|
data: { name: t, blob: o }
|
|
1739
1739
|
})).then(() => n());
|
|
1740
1740
|
}
|
|
1741
1741
|
}
|
|
1742
|
-
},
|
|
1743
|
-
const { bound: o } = a(this,
|
|
1742
|
+
}, Y = new WeakMap(), lt = new WeakMap(), Mt = new WeakSet(), fn = function(e, t, n) {
|
|
1743
|
+
const { bound: o } = a(this, Y), i = Array.isArray(this.data0) ? this.data0[0] : this.data0, s = Kr(e, i, a(this, Y).cell, o);
|
|
1744
1744
|
if (s.length === 0) return null;
|
|
1745
|
-
const l = p(this.data0, s),
|
|
1745
|
+
const l = p(this.data0, s), c = t === "uv";
|
|
1746
1746
|
if (n > 0) {
|
|
1747
|
-
const f = n,
|
|
1748
|
-
if (
|
|
1747
|
+
const f = n, m = 1 - f, v = p(this.data1, s);
|
|
1748
|
+
if (c)
|
|
1749
1749
|
for (let x = 0; x < l.length; x++)
|
|
1750
|
-
l[x] =
|
|
1750
|
+
l[x] = m * l[x] + f * v[x];
|
|
1751
1751
|
else
|
|
1752
1752
|
for (let x = 0; x < l.length; x++) {
|
|
1753
|
-
let
|
|
1754
|
-
|
|
1753
|
+
let R = v[x] - l[x];
|
|
1754
|
+
R > 180 && (R -= 360), R < -180 && (R += 360), l[x] = l[x] + m * R;
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
const
|
|
1757
|
+
const u = [], h = a(this, Y).min, d = a(this, Y).max;
|
|
1758
1758
|
for (let f = 0; f < s.length; f++) {
|
|
1759
|
-
const
|
|
1759
|
+
const m = l[2 * f], v = l[2 * f + 1], x = c ? Math.hypot(m, v) : m;
|
|
1760
1760
|
if (isNaN(x) || x < h || x > d) continue;
|
|
1761
|
-
const [
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1764
|
-
return
|
|
1765
|
-
function p(f,
|
|
1766
|
-
let
|
|
1767
|
-
Array.isArray(f) ? f.length === 1 ?
|
|
1768
|
-
const
|
|
1769
|
-
for (let
|
|
1770
|
-
|
|
1771
|
-
return
|
|
1772
|
-
}
|
|
1773
|
-
},
|
|
1761
|
+
const [R, C] = Or(e, s[f]);
|
|
1762
|
+
u.push(R, C, m, v);
|
|
1763
|
+
}
|
|
1764
|
+
return u.length > 0 ? new Float32Array(u).buffer : null;
|
|
1765
|
+
function p(f, m) {
|
|
1766
|
+
let v, x;
|
|
1767
|
+
Array.isArray(f) ? f.length === 1 ? v = Le(f[0], m) : (v = Le(f[0], m), x = Le(f[1], m)) : v = Le(f, m);
|
|
1768
|
+
const R = new Float32Array(v.length * 2);
|
|
1769
|
+
for (let C = 0; C < v.length; C++)
|
|
1770
|
+
R[2 * C] = v[C], x && (R[2 * C + 1] = x[C]);
|
|
1771
|
+
return R;
|
|
1772
|
+
}
|
|
1773
|
+
}, Dr), jo = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQojaW5jbHVkZSA8ZGVmaW5lPg0KI2luY2x1ZGUgPGNvbnN0YW50Pg0KI2luY2x1ZGUgPHByb2plY3Rpb24+DQojaW5jbHVkZSA8dXNlX2Rpc3BsYXk+DQojaW5jbHVkZSA8dXNlX2JvdW5kPg0KI2luY2x1ZGUgPHVzZV9tYXNrPg0KI2luY2x1ZGUgPGRhdGFfZ3JpZD4NCnVuaWZvcm0gbWF0NCB1X21hdHJpeDsNCnVuaWZvcm0gbWF0NCB1X21hdHJpeF9pbnZlcnNlOw0KdW5pZm9ybSBmbG9hdCB1X2VsZXZhdGlvbjsNCnVuaWZvcm0gZmxvYXQgdV9zcGVlZDsNCnVuaWZvcm0gZmxvYXQgdV9zY2FsZTsNCg0KaW4gdmVjNCBhX2RhdGE7DQpvdXQgdmVjNCB2X2RhdGE7DQoNCiNpZmRlZiBHTE9CRQ0KdmVjMyB0aWxlKHZlYzMgcCkgew0KICAgIHZlYzQgcDAgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMCwgRjEpOw0KICAgIHZlYzQgcDEgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMSwgRjEpOw0KICAgIHAwID0gcDAgLyBwMC53Ow0KICAgIHAxID0gcDEgLyBwMS53Ow0KICAgIHZlYzMgTyA9IHAwLnh5ejsNCiAgICB2ZWMzIEQgPSBwMS54eXogLSBPOw0KICAgIGZsb2F0IHIgPSBGMSArIHAuejsNCiAgICBmbG9hdCBhID0gZG90KEQsIEQpOw0KICAgIGZsb2F0IGIgPSAyLiAqIGRvdChPLCBEKTsNCiAgICBmbG9hdCBjID0gZG90KE8sIE8pIC0gciAqIHI7DQogICAgZmxvYXQgZGVsdGEgPSBiICogYiAtIDQuICogYSAqIGM7DQogICAgaWYgKGRlbHRhIDw9IDAuKXJldHVybiB2ZWMzKEZfMSk7DQogICAgZGVsdGEgPSBzcXJ0KGRlbHRhKTsNCiAgICBmbG9hdCB0MSA9ICgtYiAtIGRlbHRhKSAvICgyLiAqIGEpOw0KICAgIGZsb2F0IHQyID0gKC1iICsgZGVsdGEpIC8gKDIuICogYSk7DQogICAgZmxvYXQgdCA9IHQxID4gRjAgPyB0MSA6IHQyOw0KICAgIGlmICh0IDw9IEYwKXJldHVybiB2ZWMzKEZfMSk7DQogICAgdmVjMyBQID0gTyArIEQgKiB0Ow0KICAgIHJldHVybiB2ZWMzKCgxLjUgKiBQSSAtIGF0YW4oUC56LCBQLngpKSAvICgyLiAqIFBJKSwgYWNvcyhQLnkgLyByKSAvIFBJLCByKTsNCn0NCnZlYzIgbG9uTGF0KHZlYzIgdHV2KSB7DQogICAgcmV0dXJuIHNpbXBsZUxvbkxhdCh0dXYpOw0KfQ0KdmVjMyB0YXJnZXQodmVjMyB0dXYsIHZlYzIgdXYpIHsNCiAgICByZXR1cm4gcHJvamVjdGlvbkdsb2JlKHZlYzModHV2LnggKyB1di54LCB0dXYueSAtIHV2LnksIHR1di56KSk7DQp9DQojZWxzZQ0KdmVjMyB0aWxlKHZlYzMgcCkgew0KICAgIHZlYzQgcDAgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMCwgRjEpOw0KICAgIHZlYzQgcDEgPSB1X21hdHJpeF9pbnZlcnNlICogdmVjNChwLnh5LCBGMSwgRjEpOw0KICAgIHAwID0gcDAgLyBwMC53Ow0KICAgIHAxID0gcDEgLyBwMS53Ow0KICAgIHJldHVybiBwMS56ID09IHAwLnogPyB2ZWMzKEYwKSA6IG1peChwMCwgcDEsIChwLnogLSBwMC56KSAvIChwMS56IC0gcDAueikpLnh5ejsNCn0NCnZlYzIgbG9uTGF0KHZlYzIgdHV2KSB7DQogICAgcmV0dXJuIG1lcmNhdG9yUmV2ZXJzZSh0dXYpOw0KfQ0KdmVjMyB0YXJnZXQodmVjMyB0dXYsIHZlYzIgdXYpIHsNCiAgICByZXR1cm4gdmVjMyh0dXYueCArIHV2LngsIHR1di55IC0gdXYueSwgdHV2LnopOw0KfQ0KI2VuZGlmDQoNCnZlYzMgbmV3UG9pbnQodmVjMyBwKSB7DQogICAgdmVjMyBzZWVkID0gdmVjMyhwLnogKiB1X3NwZWVkLCBwLnogKiBmbG9hdChnbF9WZXJ0ZXhJRCksIGZsb2F0KGdsX1ZlcnRleElEKSk7DQogICAgdXZlYzMgdTMgPSBmbG9hdEJpdHNUb1VpbnQoc2VlZCk7DQogICAgdTMgPSAoKHUzIF4gNjF1KSBeICh1MyA+PiAxNnUpKSAqIDl1Ow0KICAgIHUzID0gKHUzIF4gKHUzID4+IDR1KSkgKiAweDI3ZDRlYjJkdTsNCiAgICB1MyA9IHUzIF4gKHUzID4+IDE1dSk7DQogICAgcmV0dXJuIG1peCh2ZWMzKEZfMSwgRl8xLCAuNSksIHZlYzMoRjEpLCB2ZWMzKHUzKSAvIGZsb2F0KDB4RkZGRkZGRkZ1KSk7DQp9DQoNCnZvaWQgbWFpbigpIHsNCiAgICBib29sIGIgPSBhX2RhdGEueiA+IEYwICYmIGFsbChsZXNzVGhhbihhYnMoYV9kYXRhLnh5KSwgdmVjMihGMSkpKTsNCiAgICAjaWZkZWYgVVNFX01BU0sNCiAgICBiID0gYiAmJiB0ZXh0dXJlKHVfbWFzaywgYV9kYXRhLnh5ICogLjUgKyAuNSkueCAhPSBGMDsNCiAgICAjZW5kaWYNCiAgICB2ZWMzIGRhdGEgPSBiID8gYV9kYXRhLnh5eiA6IG5ld1BvaW50KGFfZGF0YS54eXopOw0KICAgIHZlYzMgcDAgPSB2ZWMzKGRhdGEueHksIHVfZWxldmF0aW9uKTsNCiAgICB2ZWMzIHR1diA9IHRpbGUocDApOw0KICAgIGlmICh0dXYueSA+PSBGMCAmJiB0dXYueSA8PSBGMSkgew0KICAgICAgICB2ZWMyIGxsID0gbG9uTGF0KHR1di54eSk7DQogICAgICAgIGlmICghaW52YWxpZEJvdW5kKGxsKSAmJiAhaW52YWxpZERhdGFCb3VuZChsbCkpIHsNCiAgICAgICAgICAgIHZlYzIgdXYgPSByZWFkR3JpZDIoZGF0YVV2KGxsKSk7DQogICAgICAgICAgICBmbG9hdCB2YWwgPSBsZW5ndGgodXYpOw0KICAgICAgICAgICAgdmVjMyB0ID0gdGFyZ2V0KHR1diwgdXYgKiB1X3NwZWVkIC8gMTYzODQuKTsNCiAgICAgICAgICAgIHZlYzQgcDEgPSB1X21hdHJpeCAqIHZlYzQodCwgRjEpOw0KICAgICAgICAgICAgdl9kYXRhID0gdmVjNChtaXgocDAueHksIHAxLnh5IC8gcDEudywgdV9zY2FsZSksIGRhdGEueiAtIC4wMDUsIGIgPyB2YWwgOiBGXzEpOw0KICAgICAgICAgICAgcmV0dXJuOw0KICAgICAgICB9DQogICAgfQ0KICAgIHZfZGF0YSA9IHZlYzQocDAueHksIC1kYXRhLnosIEYwKTsNCn0NCg=="), xr = O("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBtZWRpdW1wIGZsb2F0Ow0Kb3V0IGxvd3AgdmVjNCBvX2NvbG9yOw0Kdm9pZCBtYWluKCkgew0KICAgIG9fY29sb3IgPSB2ZWM0KDEuKTsNCn0NCg=="), Jo = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQp1bmlmb3JtIHZlYzIgdV9zaXplOw0KaW4gdmVjMiBhX3BvczsNCmluIHZlYzQgYV9kYXRhMDsNCmluIHZlYzQgYV9kYXRhMTsNCi8vY29uc3QgdmVjNCBhX2RhdGEwID0gdmVjNCguNSwgLjI1LCAxLCAxLik7DQovL2NvbnN0IHZlYzQgYV9kYXRhMSA9IHZlYzQoLS41LCAtLjI1LCAxLCAzMC4pOw0Kb3V0IHZlYzIgdl92YWw7DQpjb25zdCBmbG9hdCBGMSA9IDEuOw0KY29uc3QgZmxvYXQgRjAgPSAwLjsNCmNvbnN0IGZsb2F0IEYwNSA9IC41Ow0KDQp2b2lkIG1haW4oKSB7DQogICAgdmVjMiBkaXIgPSBub3JtYWxpemUoYV9kYXRhMS54eSAtIGFfZGF0YTAueHkpOw0KICAgIHZlYzMgZGF0YSA9IEYwNSAqICgoYV9wb3MueCArIEYxKSAqIGFfZGF0YTEueHl3IC0gKGFfcG9zLnggLSBGMSkgKiBhX2RhdGEwLnh5dyk7DQogICAgdmVjMiBvZmZzZXQgPSB2ZWMyKGRpci55LCAtZGlyLngpICogYV9wb3MueSAqIHVfc2l6ZTsNCiAgICBnbF9Qb3NpdGlvbiA9IGFfZGF0YTAudyA+IEYwICYmIGFfZGF0YTEudyA+IEYwID8gdmVjNChkYXRhLnh5ICsgb2Zmc2V0LCBGMCwgRjEpIDogdmVjNChGMCk7DQogICAgdl92YWwgPSB2ZWMyKGRhdGEueiwgYV9wb3MueSk7DQp9DQo="), $o = O("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBtZWRpdW1wIGZsb2F0Ow0KI2luY2x1ZGUgPGNvbnN0YW50Pg0KI2luY2x1ZGUgPHVzZV9jb2xvcj4NCmluIHZlYzIgdl92YWw7DQpvdXQgbG93cCB2ZWM0IG9fY29sb3I7DQoNCnZvaWQgbWFpbigpIHsNCiAgICBvX2NvbG9yID0gcmVhZENvbG9yKHZfdmFsLngpICogbWl4KDEuLCAwLjg3NSwgYWJzKHZfdmFsLnkpKTsNCn0NCg=="), Er = O("I2luY2x1ZGUgPGhlYWRlcl92ZXJ0ZXg+DQppbiB2ZWMyIGFfcG9zOw0Kb3V0IHZlYzIgdl9wb3M7DQp2b2lkIG1haW4oKSB7DQogICAgZ2xfUG9zaXRpb24gPSB2ZWM0KGFfcG9zLCAwLjAsIDEuMCk7DQogICAgdl9wb3MgPSBhX3BvcyAqIC41ICsgLjU7DQp9DQo="), qo = O("I2luY2x1ZGUgPGhlYWRlcl9mcmFnbWVudD4NCnByZWNpc2lvbiBtZWRpdW1wIGZsb2F0Ow0KdW5pZm9ybSBsb3dwIHNhbXBsZXIyRCB1X2ZyYW1lOw0KaW4gdmVjMiB2X3BvczsNCm91dCB2ZWM0IG9fY29sb3I7DQp2b2lkIG1haW4oKSB7DQogICAgb19jb2xvciA9IHRleHR1cmUodV9mcmFtZSwgdl9wb3MpOw0KICAgIGlmIChvX2NvbG9yLmEgPCAuNSkgZGlzY2FyZDsNCn0NCg=="), fe = {
|
|
1774
1774
|
feedback: "particle-feedback",
|
|
1775
1775
|
blend: "particle-blend",
|
|
1776
1776
|
screen: "particle-screen",
|
|
1777
1777
|
draw: "particle-draw"
|
|
1778
|
-
},
|
|
1778
|
+
}, ea = {
|
|
1779
1779
|
type: "uv",
|
|
1780
1780
|
color: [],
|
|
1781
1781
|
disappear: 1,
|
|
1782
1782
|
size: 1,
|
|
1783
1783
|
speed: 1,
|
|
1784
1784
|
elevation: 0
|
|
1785
|
-
},
|
|
1785
|
+
}, ve, X, Qe, te, ye, J, je, Te, oe, H, V, pn, mn, vn, yn, gn, bn, In, It, Cn, nr, or, ar, xn, En, ir, Nr, ta = (Nr = class extends jr {
|
|
1786
1786
|
constructor(e) {
|
|
1787
1787
|
super(e);
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1788
|
+
A(this, V);
|
|
1789
|
+
A(this, ve);
|
|
1790
|
+
A(this, X);
|
|
1791
|
+
A(this, Qe);
|
|
1792
|
+
A(this, te);
|
|
1793
|
+
A(this, ye, null);
|
|
1794
|
+
A(this, J);
|
|
1795
|
+
A(this, je, !1);
|
|
1796
|
+
A(this, Te);
|
|
1797
|
+
A(this, oe);
|
|
1798
|
+
A(this, H);
|
|
1799
|
+
g(this, "visible", !0);
|
|
1800
|
+
E(this, J, {}), E(this, te, Object.assign({}, ea, e)), E(this, Te, e.count ?? 8192), E(this, H, { width: 0, height: 0, buffer: null });
|
|
1801
1801
|
}
|
|
1802
1802
|
/**
|
|
1803
1803
|
* @internal
|
|
1804
1804
|
*/
|
|
1805
1805
|
onAdd(e, t) {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
}), e.on("moveend", () =>
|
|
1806
|
+
E(this, ve, e), e.on("movestart", () => {
|
|
1807
|
+
E(this, je, !0), S(this, V, ir).call(this, t);
|
|
1808
|
+
}), e.on("moveend", () => E(this, je, !1)), e.on("projectiontransition", () => S(this, V, ir).call(this, t)), E(this, X, e.renderFactory);
|
|
1809
1809
|
const n = e.getSource(this.source);
|
|
1810
1810
|
if (!n) throw new Error(`The source(id:${this.source}) not found!`);
|
|
1811
|
-
|
|
1811
|
+
E(this, Qe, n), n.on("data", ({ data: o }) => S(this, V, ar).call(this, o)), S(this, V, or).call(this, a(this, te), !0), S(this, V, ar).call(this, n.lastData());
|
|
1812
1812
|
}
|
|
1813
1813
|
/**
|
|
1814
1814
|
* @internal
|
|
1815
1815
|
*/
|
|
1816
1816
|
render(e, t) {
|
|
1817
|
-
if (!a(this,
|
|
1818
|
-
|
|
1819
|
-
const n = a(this,
|
|
1820
|
-
Object.assign(n, i.uniforms),
|
|
1821
|
-
const s =
|
|
1822
|
-
n.u_scale = 1 / 2 ** Math.max(1, a(this,
|
|
1823
|
-
const d =
|
|
1824
|
-
e.useProgram(d.program),
|
|
1817
|
+
if (!a(this, ye) || a(this, je) || !this.visible) return;
|
|
1818
|
+
S(this, V, pn).call(this, e);
|
|
1819
|
+
const n = a(this, J), o = t.shaderData.variantName, i = bt(e, a(this, ye), "linear");
|
|
1820
|
+
Object.assign(n, i.uniforms), S(this, V, En).call(this, t);
|
|
1821
|
+
const s = S(this, V, mn).call(this, o, i.type), l = S(this, V, vn).call(this), c = S(this, V, gn).call(this), u = S(this, V, Cn).call(this, e, s.program, c.program), h = a(this, Te);
|
|
1822
|
+
n.u_scale = 1 / 2 ** Math.max(1, a(this, ve).getZoom() - 1), e.useProgram(s.program), e.bindVertexArray(u.feedbackVao), yt(s, n), e.enable(e.RASTERIZER_DISCARD), e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, u.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, H).buffer), e.useProgram(l.program), e.enable(e.BLEND), e.blendColor(0, 0, 0, n.u_disappear), e.blendFunc(e.ZERO, e.CONSTANT_ALPHA), Qt(S(this, V, yn).call(this, e, l)), e.disable(e.BLEND), e.useProgram(c.program), e.bindVertexArray(u.drawVao), yt(c, n), e.drawArraysInstanced(e.TRIANGLE_STRIP, 0, 4, h), e.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
1823
|
+
const d = S(this, V, bn).call(this);
|
|
1824
|
+
e.useProgram(d.program), yt(d, n), Qt(S(this, V, In).call(this, e, d)), a(this, ve).triggerRepaint();
|
|
1825
1825
|
}
|
|
1826
1826
|
setOptions(e) {
|
|
1827
1827
|
var t;
|
|
1828
|
-
|
|
1828
|
+
S(this, V, or).call(this, e, e.color !== void 0 && Jr((t = a(this, te)) == null ? void 0 : t.color, e.color)), a(this, ve).triggerRepaint();
|
|
1829
1829
|
}
|
|
1830
|
-
},
|
|
1830
|
+
}, ve = new WeakMap(), X = new WeakMap(), Qe = new WeakMap(), te = new WeakMap(), ye = new WeakMap(), J = new WeakMap(), je = new WeakMap(), Te = new WeakMap(), oe = new WeakMap(), H = new WeakMap(), V = new WeakSet(), pn = function(e) {
|
|
1831
1831
|
const t = e.drawingBufferWidth, n = e.drawingBufferHeight;
|
|
1832
|
-
if (a(this,
|
|
1832
|
+
if (a(this, H).width === t && a(this, H).height === n)
|
|
1833
1833
|
return;
|
|
1834
|
-
a(this,
|
|
1835
|
-
const o = a(this,
|
|
1834
|
+
a(this, H).width = t, a(this, H).height = n, a(this, H).buffer || (a(this, H).buffer = e.createFramebuffer());
|
|
1835
|
+
const o = a(this, H).buffer;
|
|
1836
1836
|
e.bindFramebuffer(e.FRAMEBUFFER, o);
|
|
1837
1837
|
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 = `${
|
|
1843
|
-
return a(this,
|
|
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, J).u_frame = i;
|
|
1839
|
+
const s = a(this, te).size * devicePixelRatio;
|
|
1840
|
+
a(this, J).u_size = [s / t, s / n];
|
|
1841
|
+
}, mn = function(e, t) {
|
|
1842
|
+
const n = `${fe.feedback}:${e}-${t}-${a(this, te).type}-${a(this, te).mask ? "mask" : "unmask"}`, o = e === "globe";
|
|
1843
|
+
return a(this, X).program(
|
|
1844
1844
|
n,
|
|
1845
|
-
() => a(this,
|
|
1845
|
+
() => a(this, X).vertex(n, jo, () => {
|
|
1846
1846
|
const i = ["DATA_GRID_UV"];
|
|
1847
1847
|
return o && i.push("GLOBE"), t === "uint" ? i.push("DATA0_UINT") : t === "float" && i.push("DATA0_FLOAT"), i.map((s) => "#define " + s).join(`
|
|
1848
1848
|
`);
|
|
1849
1849
|
}),
|
|
1850
|
-
() => a(this,
|
|
1850
|
+
() => a(this, X).fragment(fe.blend, xr),
|
|
1851
1851
|
["v_data"]
|
|
1852
1852
|
);
|
|
1853
|
-
},
|
|
1854
|
-
return a(this,
|
|
1855
|
-
},
|
|
1856
|
-
return a(this,
|
|
1857
|
-
const n =
|
|
1858
|
-
return
|
|
1853
|
+
}, vn = function() {
|
|
1854
|
+
return a(this, X).program(fe.blend, () => a(this, X).vertex(fe.screen, Er), () => a(this, X).fragment(fe.blend, xr));
|
|
1855
|
+
}, yn = function(e, t) {
|
|
1856
|
+
return a(this, X).vao(fe.blend, () => {
|
|
1857
|
+
const n = S(this, V, It).call(this, e);
|
|
1858
|
+
return Ut(e, t, n, e.TRIANGLE_STRIP);
|
|
1859
1859
|
});
|
|
1860
|
-
},
|
|
1861
|
-
const e =
|
|
1862
|
-
return a(this,
|
|
1863
|
-
},
|
|
1864
|
-
const e =
|
|
1865
|
-
return a(this,
|
|
1866
|
-
},
|
|
1867
|
-
return a(this,
|
|
1868
|
-
const n =
|
|
1869
|
-
return
|
|
1860
|
+
}, gn = function() {
|
|
1861
|
+
const e = fe.draw;
|
|
1862
|
+
return a(this, X).program(e, () => a(this, X).vertex(e, Jo), () => a(this, X).fragment(e, $o));
|
|
1863
|
+
}, bn = function() {
|
|
1864
|
+
const e = fe.screen;
|
|
1865
|
+
return a(this, X).program(e, () => a(this, X).vertex(e, Er), () => a(this, X).fragment(e, qo));
|
|
1866
|
+
}, In = function(e, t) {
|
|
1867
|
+
return a(this, X).vao(fe.screen, () => {
|
|
1868
|
+
const n = S(this, V, It).call(this, e);
|
|
1869
|
+
return Ut(e, t, n, e.TRIANGLE_STRIP);
|
|
1870
1870
|
});
|
|
1871
|
-
},
|
|
1872
|
-
return a(this,
|
|
1873
|
-
|
|
1874
|
-
() =>
|
|
1871
|
+
}, It = function(e) {
|
|
1872
|
+
return a(this, X).buffer(
|
|
1873
|
+
fe.screen,
|
|
1874
|
+
() => cr(e, { a_pos: { size: 2, data: new Int8Array([-1, 1, -1, -1, 1, 1, 1, -1]), type: e.BYTE } })
|
|
1875
1875
|
);
|
|
1876
|
-
},
|
|
1877
|
-
if (a(this,
|
|
1878
|
-
const d = a(this,
|
|
1879
|
-
return a(this,
|
|
1876
|
+
}, Cn = function(e, t, n) {
|
|
1877
|
+
if (a(this, oe)) {
|
|
1878
|
+
const d = a(this, oe)[0];
|
|
1879
|
+
return a(this, oe)[0] = a(this, oe)[1], a(this, oe)[1] = d, d;
|
|
1880
1880
|
}
|
|
1881
|
-
const o =
|
|
1882
|
-
return
|
|
1881
|
+
const o = S(this, V, It).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);
|
|
1882
|
+
return E(this, oe, [{
|
|
1883
1883
|
buffer: i,
|
|
1884
|
-
feedbackVao:
|
|
1885
|
-
feedback:
|
|
1884
|
+
feedbackVao: u(t, i),
|
|
1885
|
+
feedback: c(s),
|
|
1886
1886
|
drawVao: h(n, o, [s, i])
|
|
1887
1887
|
}, {
|
|
1888
1888
|
buffer: s,
|
|
1889
|
-
feedbackVao:
|
|
1890
|
-
feedback:
|
|
1889
|
+
feedbackVao: u(t, s),
|
|
1890
|
+
feedback: c(null),
|
|
1891
1891
|
drawVao: h(n, o, [i, s])
|
|
1892
|
-
}]),
|
|
1892
|
+
}]), S(this, V, nr).call(this, e), a(this, oe)[0];
|
|
1893
1893
|
function l(d, p) {
|
|
1894
1894
|
const f = e.createBuffer();
|
|
1895
1895
|
return e.bindBuffer(e.ARRAY_BUFFER, f), e.bufferData(e.ARRAY_BUFFER, d, p), f;
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function c(d) {
|
|
1898
1898
|
const p = e.createTransformFeedback();
|
|
1899
1899
|
return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, p), d && e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER, 0, d), p;
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function u(d, p) {
|
|
1902
1902
|
const f = e.createVertexArray();
|
|
1903
1903
|
e.bindVertexArray(f), e.bindBuffer(e.ARRAY_BUFFER, p);
|
|
1904
|
-
const
|
|
1905
|
-
return e.enableVertexAttribArray(
|
|
1904
|
+
const m = e.getAttribLocation(d, "a_data");
|
|
1905
|
+
return e.enableVertexAttribArray(m), e.vertexAttribPointer(m, 4, e.FLOAT, !1, 0, 0), f;
|
|
1906
1906
|
}
|
|
1907
1907
|
function h(d, p, f) {
|
|
1908
|
-
const
|
|
1909
|
-
e.bindVertexArray(
|
|
1908
|
+
const m = e.createVertexArray();
|
|
1909
|
+
e.bindVertexArray(m);
|
|
1910
1910
|
for (let x = 0; x < f.length; x++) {
|
|
1911
1911
|
e.bindBuffer(e.ARRAY_BUFFER, f[x]);
|
|
1912
|
-
const
|
|
1913
|
-
e.enableVertexAttribArray(
|
|
1912
|
+
const R = e.getAttribLocation(d, "a_data" + x);
|
|
1913
|
+
e.enableVertexAttribArray(R), e.vertexAttribPointer(R, 4, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(R, 1);
|
|
1914
1914
|
}
|
|
1915
1915
|
e.bindBuffer(e.ARRAY_BUFFER, p);
|
|
1916
|
-
const
|
|
1917
|
-
return e.enableVertexAttribArray(
|
|
1916
|
+
const v = e.getAttribLocation(d, "a_pos");
|
|
1917
|
+
return e.enableVertexAttribArray(v), e.vertexAttribPointer(v, 2, e.BYTE, !1, 0, 0), m;
|
|
1918
1918
|
}
|
|
1919
|
-
},
|
|
1920
|
-
if (!a(this,
|
|
1921
|
-
e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, a(this,
|
|
1922
|
-
const t = a(this,
|
|
1919
|
+
}, nr = function(e) {
|
|
1920
|
+
if (!a(this, oe)) return;
|
|
1921
|
+
e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, a(this, oe)[1].feedback), e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER, 0, null);
|
|
1922
|
+
const t = a(this, oe)[0].buffer, n = new Float32Array(a(this, Te) * 4);
|
|
1923
1923
|
for (let o = 0; o < n.length; o += 4)
|
|
1924
1924
|
n[o] = Math.random() * 2 - 1, n[o + 1] = Math.random() * 2 - 1, n[o + 2] = Math.random() * 0.5 + 0.5;
|
|
1925
1925
|
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,
|
|
1926
|
+
}, or = function(e, t) {
|
|
1927
|
+
const n = a(this, te), o = a(this, J);
|
|
1928
|
+
if (t && e.color && rn(a(this, ve).painter.context.gl, o, e.color), E(this, te, Object.assign(n, e)), on(o, n.bound), an(o, n), o.u_disappear = 1 - 0.03 * n.disappear, o.u_speed = a(this, te).speed, a(this, H).buffer) {
|
|
1929
|
+
const i = a(this, te).size * devicePixelRatio;
|
|
1930
|
+
a(this, J).u_size = [i / a(this, H).width, i / a(this, H).height];
|
|
1931
1931
|
}
|
|
1932
|
-
},
|
|
1932
|
+
}, ar = function(e) {
|
|
1933
1933
|
if (e && (!Array.isArray(e) || e.length < 2))
|
|
1934
1934
|
throw new Error("particle data must be uv | dv data!");
|
|
1935
|
-
a(this,
|
|
1936
|
-
},
|
|
1937
|
-
if (a(this,
|
|
1938
|
-
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:
|
|
1939
|
-
for (let
|
|
1940
|
-
const
|
|
1941
|
-
p[
|
|
1942
|
-
}
|
|
1943
|
-
return [{ x: l, y:
|
|
1944
|
-
},
|
|
1935
|
+
a(this, ye) && a(this, Qe).unlink(a(this, ye)), E(this, ye, S(this, V, xn).call(this, e)), a(this, ye) && a(this, Qe).link(a(this, ye)), a(this, ve).triggerRepaint();
|
|
1936
|
+
}, xn = function(e) {
|
|
1937
|
+
if (a(this, te).type === "uv" || !e || !Array.isArray(e) || e.length != 2) return e;
|
|
1938
|
+
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: c, lon: u, lat: h, data: d } = e[1], p = new Float32Array(d.length), f = new Float32Array(d.length);
|
|
1939
|
+
for (let m = 0; m < d.length; m++) {
|
|
1940
|
+
const v = (t[m] * o + n) * Math.PI / 180, x = -(d[m] * s + i);
|
|
1941
|
+
p[m] = x * Math.sin(v), f[m] = x * Math.cos(v);
|
|
1942
|
+
}
|
|
1943
|
+
return [{ x: l, y: c, lon: u, lat: h, data: p }, { x: l, y: c, lon: u, lat: h, data: f }];
|
|
1944
|
+
}, En = function({ shaderData: e, defaultProjectionData: t }) {
|
|
1945
1945
|
const n = e.variantName === "globe";
|
|
1946
|
-
a(this,
|
|
1946
|
+
a(this, J).u_matrix = n ? a(this, ve).transform.getProjectionData({
|
|
1947
1947
|
overscaledTileID: null,
|
|
1948
1948
|
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],
|
|
1955
|
-
let
|
|
1956
|
-
|
|
1949
|
+
}).mainMatrix : t.mainMatrix, a(this, J).u_matrix_inverse || (a(this, J).u_matrix_inverse = new Float32Array(16), ra(a(this, J).u_matrix_inverse, a(this, J).u_matrix));
|
|
1950
|
+
}, ir = function(e) {
|
|
1951
|
+
a(this, J).u_matrix_inverse = void 0, a(this, H).buffer && (S(this, V, nr).call(this, e), e.bindFramebuffer(e.FRAMEBUFFER, a(this, H).buffer), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.bindFramebuffer(e.FRAMEBUFFER, null));
|
|
1952
|
+
}, Nr);
|
|
1953
|
+
function ra(r, e) {
|
|
1954
|
+
const t = e[0], n = e[1], o = e[2], i = e[3], s = e[4], l = e[5], c = e[6], u = e[7], h = e[8], d = e[9], p = e[10], f = e[11], m = e[12], v = e[13], x = e[14], R = e[15], C = t * l - n * s, b = t * c - o * s, B = t * u - i * s, L = n * c - o * l, M = n * u - i * l, T = o * u - i * c, I = h * v - d * m, w = h * x - p * m, _ = h * R - f * m, k = d * x - p * v, G = d * R - f * v, F = p * R - f * x;
|
|
1955
|
+
let D = C * F - b * G + B * k + L * _ - M * w + T * I;
|
|
1956
|
+
D && (D = 1 / D, r[0] = (l * F - c * G + u * k) * D, r[1] = (o * G - n * F - i * k) * D, r[2] = (v * T - x * M + R * L) * D, r[3] = (p * M - d * T - f * L) * D, r[4] = (c * _ - s * F - u * w) * D, r[5] = (t * F - o * _ + i * w) * D, r[6] = (x * B - m * T - R * b) * D, r[7] = (h * T - p * B + f * b) * D, r[8] = (s * G - l * _ + u * I) * D, r[9] = (n * _ - t * G - 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 - c * I) * D, r[13] = (t * k - n * w + o * I) * D, r[14] = (v * b - m * L - x * C) * D, r[15] = (h * L - d * b + p * C) * D);
|
|
1957
1957
|
}
|
|
1958
|
-
var
|
|
1959
|
-
|
|
1960
|
-
function
|
|
1958
|
+
var na = "isoline-tile", oa = 2;
|
|
1959
|
+
aa(oa * 2 + 1, 1);
|
|
1960
|
+
function aa(r, e) {
|
|
1961
1961
|
const t = r + 1, n = new Float32Array(t * e);
|
|
1962
1962
|
for (let o = 0; o < e; o++) {
|
|
1963
1963
|
const i = new Float32Array(r), s = new Float32Array(r);
|
|
1964
1964
|
n[t * o] = 1;
|
|
1965
|
-
const l = o / e,
|
|
1966
|
-
for (let
|
|
1967
|
-
i[
|
|
1965
|
+
const l = o / e, c = (e - o) / e;
|
|
1966
|
+
for (let u = 0; u < r; ++u) {
|
|
1967
|
+
i[u] = u + l, s[u] = u + c;
|
|
1968
1968
|
let h = 0;
|
|
1969
|
-
for (let d = 0; d <
|
|
1970
|
-
const p = s[d], f = i[
|
|
1971
|
-
n[t * o + d] = h + p *
|
|
1969
|
+
for (let d = 0; d < u + 1; ++d) {
|
|
1970
|
+
const p = s[d], f = i[u - d], m = n[t * o + d] / (p + f);
|
|
1971
|
+
n[t * o + d] = h + p * m, h = f * m;
|
|
1972
1972
|
}
|
|
1973
|
-
n[t * o +
|
|
1973
|
+
n[t * o + u + 1] = h;
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
return n;
|
|
1977
1977
|
}
|
|
1978
|
-
var
|
|
1978
|
+
var mt = {
|
|
1979
1979
|
interval: 0,
|
|
1980
1980
|
offset: 0,
|
|
1981
1981
|
tension: 1,
|
|
@@ -1993,27 +1993,27 @@ var lt = {
|
|
|
1993
1993
|
},
|
|
1994
1994
|
style: void 0,
|
|
1995
1995
|
opacity: 1
|
|
1996
|
-
},
|
|
1996
|
+
}, ge, Vt, An, Zr, ia = (Zr = class extends lr {
|
|
1997
1997
|
constructor(e) {
|
|
1998
1998
|
super(e);
|
|
1999
|
-
|
|
2000
|
-
|
|
1999
|
+
A(this, Vt);
|
|
2000
|
+
A(this, ge);
|
|
2001
2001
|
/**
|
|
2002
2002
|
* @internal
|
|
2003
2003
|
*/
|
|
2004
|
-
|
|
2005
|
-
var d, p, f,
|
|
2006
|
-
const n =
|
|
2004
|
+
g(this, "loadTile", async (e, t) => {
|
|
2005
|
+
var d, p, f, m, v, x, R, C, b;
|
|
2006
|
+
const n = S(this, Vt, An).call(this, e, t);
|
|
2007
2007
|
if (!n) return null;
|
|
2008
|
-
const o = a(this,
|
|
2008
|
+
const o = a(this, ge), i = t > 0 || o.label === null ? void 0 : {
|
|
2009
2009
|
...o.label,
|
|
2010
2010
|
convert: o.label.convert.toString()
|
|
2011
|
-
}, { width: s, color: l, dash:
|
|
2012
|
-
below: { width: ((d =
|
|
2013
|
-
at: { width: ((
|
|
2014
|
-
above: { width: ((
|
|
2011
|
+
}, { width: s, color: l, dash: c } = o, u = o.style ?? {}, h = {
|
|
2012
|
+
below: { width: ((d = u.below) == null ? void 0 : d.width) ?? s, color: ((p = u.below) == null ? void 0 : p.color) ?? l, dash: ((f = u.below) == null ? void 0 : f.dash) ?? c },
|
|
2013
|
+
at: { width: ((m = u.at) == null ? void 0 : m.width) ?? s, color: ((v = u.at) == null ? void 0 : v.color) ?? l, dash: ((x = u.at) == null ? void 0 : x.dash) ?? c },
|
|
2014
|
+
above: { width: ((R = u.above) == null ? void 0 : R.width) ?? s, color: ((C = u.above) == null ? void 0 : C.color) ?? l, dash: ((b = u.above) == null ? void 0 : b.dash) ?? c }
|
|
2015
2015
|
};
|
|
2016
|
-
return this.renderFactory.exec(
|
|
2016
|
+
return this.renderFactory.exec(na, {
|
|
2017
2017
|
canvas: { type: "2d", size: this.tileSize * 2 },
|
|
2018
2018
|
data: {
|
|
2019
2019
|
interval: o.interval,
|
|
@@ -2027,38 +2027,38 @@ var lt = {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
}, [n]);
|
|
2029
2029
|
});
|
|
2030
|
-
|
|
2030
|
+
E(this, ge, Object.assign({}, mt, e)), a(this, ge).label = e.label === null ? null : Object.assign({}, mt.label, e.label);
|
|
2031
2031
|
}
|
|
2032
2032
|
setOptions(e) {
|
|
2033
|
-
|
|
2033
|
+
E(this, ge, Object.assign({}, mt, e)), a(this, ge).label = e.label === null ? null : Object.assign({}, mt.label, e.label), super.setOptions(e);
|
|
2034
2034
|
}
|
|
2035
|
-
},
|
|
2036
|
-
const { bound: n } = a(this,
|
|
2035
|
+
}, ge = new WeakMap(), Vt = new WeakSet(), An = function(e, t) {
|
|
2036
|
+
const { bound: n } = a(this, ge), o = Array.isArray(this.data0) ? this.data0[0] : this.data0, [i, s] = Hr(e, o, a(this, ge).cell, n, 5);
|
|
2037
2037
|
if (i.length === 0 || s.length === 0) return null;
|
|
2038
2038
|
const l = d(this.data0, i, s);
|
|
2039
2039
|
if (t > 0) {
|
|
2040
|
-
const p = t, f = 1 - p,
|
|
2041
|
-
for (let
|
|
2042
|
-
l[
|
|
2040
|
+
const p = t, f = 1 - p, m = d(this.data1, i, s);
|
|
2041
|
+
for (let v = 0; v < l.length; v++)
|
|
2042
|
+
l[v] = f * l[v] + p * m[v];
|
|
2043
2043
|
}
|
|
2044
|
-
const
|
|
2044
|
+
const c = 2 + i.length + s.length, u = new Float32Array(c + l.length);
|
|
2045
2045
|
let h = 0;
|
|
2046
|
-
|
|
2047
|
-
for (const p of i)
|
|
2048
|
-
for (const p of s)
|
|
2049
|
-
return
|
|
2050
|
-
function d(p, f,
|
|
2051
|
-
if (!Array.isArray(p)) return
|
|
2052
|
-
if (p.length === 1) return
|
|
2053
|
-
const
|
|
2054
|
-
for (let
|
|
2055
|
-
|
|
2056
|
-
return
|
|
2057
|
-
}
|
|
2058
|
-
},
|
|
2059
|
-
function
|
|
2046
|
+
u[h++] = i.length, u[h++] = s.length;
|
|
2047
|
+
for (const p of i) u[h++] = Ur(e, p);
|
|
2048
|
+
for (const p of s) u[h++] = Qr(e, p);
|
|
2049
|
+
return u.set(l, c), u.buffer;
|
|
2050
|
+
function d(p, f, m) {
|
|
2051
|
+
if (!Array.isArray(p)) return pt(p, f, m);
|
|
2052
|
+
if (p.length === 1) return pt(p[0], f, m);
|
|
2053
|
+
const v = pt(p[0], f, m), x = pt(p[1], f, m);
|
|
2054
|
+
for (let R = 0; R < v.length; R++)
|
|
2055
|
+
v[R] = Math.hypot(v[R], x[R]);
|
|
2056
|
+
return v;
|
|
2057
|
+
}
|
|
2058
|
+
}, Zr);
|
|
2059
|
+
function Ar(r, e) {
|
|
2060
2060
|
var o;
|
|
2061
|
-
const t = new
|
|
2061
|
+
const t = new So({
|
|
2062
2062
|
interactive: !0,
|
|
2063
2063
|
attributionControl: !1,
|
|
2064
2064
|
maplibreLogo: !1,
|
|
@@ -2080,7 +2080,7 @@ function hr(r, e) {
|
|
|
2080
2080
|
validateStyle: !1,
|
|
2081
2081
|
...r,
|
|
2082
2082
|
// @ts-ignore
|
|
2083
|
-
style:
|
|
2083
|
+
style: oo
|
|
2084
2084
|
}), n = r.tiandituToken ?? ((o = window == null ? void 0 : window.present) == null ? void 0 : o.tiandituToken) ?? "";
|
|
2085
2085
|
return t.on("load", () => {
|
|
2086
2086
|
t.resize(), n && (t.addSource("baselayersource__tian-di-tu", {
|
|
@@ -2128,7 +2128,7 @@ function hr(r, e) {
|
|
|
2128
2128
|
}), n && t.setLayoutProperty("baselayer__bing-map-layer", "visibility", "none"), t.setMinZoom(2);
|
|
2129
2129
|
}), t;
|
|
2130
2130
|
}
|
|
2131
|
-
class
|
|
2131
|
+
class sa {
|
|
2132
2132
|
/**
|
|
2133
2133
|
* 创建渲染器实例
|
|
2134
2134
|
* @param name - 渲染器名称(可选),用作 ID 前缀
|
|
@@ -2138,7 +2138,7 @@ class Qo {
|
|
|
2138
2138
|
* 渲染器名称标识
|
|
2139
2139
|
* 用于生成的 ID 前缀,便于调试和识别
|
|
2140
2140
|
*/
|
|
2141
|
-
|
|
2141
|
+
g(this, "name");
|
|
2142
2142
|
this.name = e ?? "";
|
|
2143
2143
|
}
|
|
2144
2144
|
/**
|
|
@@ -2155,44 +2155,44 @@ class Qo {
|
|
|
2155
2155
|
* ```
|
|
2156
2156
|
*/
|
|
2157
2157
|
createId() {
|
|
2158
|
-
return this.name ? `${this.name}__${
|
|
2158
|
+
return this.name ? `${this.name}__${Ct()}` : Ct();
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
|
-
const
|
|
2162
|
-
class
|
|
2161
|
+
const la = "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/oiyD3k9sLuZ/cPqEvgtxPbi/kfnL7hL4Icj+5vZD7ye0T+iLI/eT2Qu4nt0/oiyD3k9sLvV+HHwG9X5IkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSdKKX7/lNRJyP7m9kPvJ7X/UAoa8R0DuJ7cXcj+5/Q/6Asj95PZC7ie3/0FewLmd3p/3uju30/vzHgJ5AeT2Qu4ntxd0/zmeuADb7ae3E/s/von/ZnYXq00dP5Rver6Z3cVqk3/79dntrMSND2BldjdvTeT2Qu4nt5fO/R9PcYQF3LWR2wu5n9xeCP0fV5GkBWQjuX1co/aT28c1Sv/HOZa4gNFKbh//pvbbzuv/oC/AdvttB6MvYKW/68ey2tOxvaw0jfaV2Z2s9nRsnzzFtY8/1vqfZnb21kXuJ7eX7v0fV4GY+IPdf9dH7ie3F0r/xwg9h2Pij/lDoPVnJ7nfdlb/Bzb8r3M/bQejl9xvO699go4/fj6EvE7w8/mz+/P6ldW5XZDbJ63jFpD7ye3lrX8cEkPe39lKT9f2Seu4BeT+u/b2H/1fd42j/+5+B09thP4PROQDcn+2oz78g91/1Ujq/0DFXiD3j3bkh3+w+6/aSf0fyOgTcj/6wz/Y/eT2CX0B5H5yeyH3k9sn9EWQ+8nthdx/1V7XhrzXFir2Armf3F7I/ef2cegh94GMPiH3k9sLuf/nyPtf3sdAxx/sfnJ7IfeT2yf0RZD7ye2F3E9un9AXQe4ntxdyP7l9Ql8EuZ/cXsj95PYJfRHkfnJ7IfeT2yf0RZD7ye2F3E9un9AXQe4ntxdyP7l9Ql8EuZ/cXsj95HZJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJ0vHrt7xGQu4ntxdyP7l9UotIOdOZ7bOc6cz2f+Vce7mAJ/lsB9n4JJ/dXfY9yWc7yMYn+ezusu9NPt9Ghq7K9+wqu1bkO3aVXavyPbvKrhX5jl1l16p8z/Yy8E0+v7vse5PP7yzbVuQ7dpZtb/L5nWXbm3y+jQy9k891kZ138rkOsvFOPtdFdt7J5zrIxjv5XDsZnHK+m+xNOd9Jtqac7yZ7U853kq0p59vK8CHnusrukjNdZfeQc11ld8mZrrK75AwCfQm22287GH0B5P6VH8CYeZvb0UpT1/6Vnq7tk9ZxC8j9T+2Ej/+prXv/U1f39gki8sFVP+WPf9U42q/udXPVSOm/6qO0T1CxF879tA+A3F7I/eT2CTL65PzHp+2C3F7I/eT2CTr+YPfTP35y/0r7mHmb21rruAXkfnJ7Ifc/tY9D72mmDUTkA3I/ub1c9VN++FeNo/3qXluo2AvkfnJ7Gf0/P/v/5VxH505a+wQZfULuJ7cX8g//3E7s/0DHH+x+cnsh9+MPvoG+BHI/ub2Q+8ntE/oiyP3k9kLuJ7dP6Isg95PbC7mf3D6hL4LcT24v5H5y+4S+CHI/ub2Q+8ntE/oiyP3k9kLuJ7dP6Isg95PbC7mf3D6hL4LcT24v5H5y+4S+CHI/ub2Q+8ntE/oiyP3k9kLuJ7dP6Isg95PbC7mf3D6hL4LcT24v5H5y+4S+CHI/ub2Q+8ntE/oiyP3k9kLuJ7dP6Isg95PbC7mf3C5JkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiSuX7/lNRJyP7m9kPvJ7ZNaxJWc6yq7h5zrKJtLznSW7UPOdZTNQ861lwtYke/YWbatyHfsKrue5LMdZOOKfMeusmtFvqOFjFyV79lVdq3Id+wqu1ble3aVXSvyHbvKrlX5nu1l4Jt8fnfZ9yaf31m2rch37CzbnuSzu8u+N/l8Gxl6J5/rIjuv5DNdZOedfK6L7LySz3SRnXfyuXYy+CxnO8rms5ztJntTzneTvWc52032nuVsaxlfcqazbC8501V2DznXVXaXnOkqu0vOIHyzgJWZ3ZD7z+3d2lZ8074ysxNy+2Ql7ptl7WalqWv/SlPX9rLS1LV/padr++QpjrCAu7Zz+93M7p66ureXu7Zz+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==";
|
|
2162
|
+
class ca {
|
|
2163
2163
|
constructor(e, t, n) {
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2164
|
+
g(this, "bluestar");
|
|
2165
|
+
g(this, "viewer");
|
|
2166
|
+
g(this, "state");
|
|
2167
|
+
g(this, "wegRenderer");
|
|
2168
2168
|
/** 主数据源 ID */
|
|
2169
|
-
|
|
2169
|
+
g(this, "sourceId");
|
|
2170
2170
|
/** 热力图图层 ID */
|
|
2171
|
-
|
|
2171
|
+
g(this, "colorMapId");
|
|
2172
2172
|
/** 文本图层 ID */
|
|
2173
|
-
|
|
2173
|
+
g(this, "gridValueId");
|
|
2174
2174
|
/** 等值线图层 ID */
|
|
2175
|
-
|
|
2175
|
+
g(this, "contourLayerId");
|
|
2176
2176
|
/** 向量图层 ID */
|
|
2177
|
-
|
|
2177
|
+
g(this, "vectorLayerId");
|
|
2178
2178
|
/** 粒子图层 ID */
|
|
2179
|
-
|
|
2179
|
+
g(this, "particleLayerId");
|
|
2180
2180
|
/** 值与方向数据源 ID */
|
|
2181
|
-
|
|
2181
|
+
g(this, "valueDirectionSourceId");
|
|
2182
2182
|
/** 热力图图层实例 */
|
|
2183
|
-
|
|
2183
|
+
g(this, "colorMapLayer");
|
|
2184
2184
|
/** 文本图层实例 */
|
|
2185
|
-
|
|
2185
|
+
g(this, "gridValueLayer");
|
|
2186
2186
|
/** 等值线图层实例 */
|
|
2187
|
-
|
|
2187
|
+
g(this, "contourLayer");
|
|
2188
2188
|
/** 向量图层实例 */
|
|
2189
|
-
|
|
2189
|
+
g(this, "vectorLayer");
|
|
2190
2190
|
/** 粒子图层实例 */
|
|
2191
|
-
|
|
2191
|
+
g(this, "particleLayer");
|
|
2192
2192
|
/** 热力图数据源 */
|
|
2193
|
-
|
|
2193
|
+
g(this, "mainSource");
|
|
2194
2194
|
/** 值与方向数据源 */
|
|
2195
|
-
|
|
2195
|
+
g(this, "valueDirectionSource");
|
|
2196
2196
|
this.bluestar = e, this.viewer = e.viewer, this.state = t, this.wegRenderer = n, this.sourceId = this.createId("VSOURCE"), this.colorMapId = this.createId("color"), this.gridValueId = this.createId("grid"), this.contourLayerId = this.createId("contour"), this.vectorLayerId = this.createId("vector"), this.particleLayerId = this.createId("particle"), this.valueDirectionSourceId = this.createId("DSOURCE");
|
|
2197
2197
|
}
|
|
2198
2198
|
/** 生成唯一 ID */
|
|
@@ -2216,39 +2216,42 @@ class Jo {
|
|
|
2216
2216
|
data: e.block.V.data,
|
|
2217
2217
|
bitLength: e.block.V.bitLength,
|
|
2218
2218
|
reference: e.block.V.offset,
|
|
2219
|
-
scale: e.block.V.scale
|
|
2219
|
+
scale: e.block.V.scale,
|
|
2220
|
+
zeroNaN: this.state.zeroToNaN
|
|
2220
2221
|
}) : this.mainSource.setData({
|
|
2221
2222
|
lon: [e.west, e.east],
|
|
2222
2223
|
lat: [e.north, e.south],
|
|
2223
2224
|
x: e.width,
|
|
2224
2225
|
y: e.height,
|
|
2225
|
-
data: e.block.V.data
|
|
2226
|
+
data: e.block.V.data,
|
|
2227
|
+
zeroNaN: this.state.zeroToNaN
|
|
2226
2228
|
});
|
|
2227
2229
|
let t = e.block.U ?? e.block.D ?? void 0;
|
|
2228
2230
|
t && this.valueDirectionSource && (e.dtype === "uint8" || e.dtype === "uint16" ? this.valueDirectionSource.setData([
|
|
2229
|
-
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: t.data, bitLength: t.bitLength, reference: t.offset, scale: t.scale },
|
|
2230
|
-
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: e.block.V.data, bitLength: e.block.V.bitLength, reference: e.block.V.offset, scale: e.block.V.scale }
|
|
2231
|
+
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: t.data, bitLength: t.bitLength, reference: t.offset, scale: t.scale, zeroNaN: this.state.zeroToNaN },
|
|
2232
|
+
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: e.block.V.data, bitLength: e.block.V.bitLength, reference: e.block.V.offset, scale: e.block.V.scale, zeroNaN: this.state.zeroToNaN }
|
|
2231
2233
|
]) : this.valueDirectionSource.setData([
|
|
2232
|
-
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: t.data },
|
|
2233
|
-
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: e.block.V.data }
|
|
2234
|
+
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: t.data, zeroNaN: this.state.zeroToNaN },
|
|
2235
|
+
{ lon: [e.west, e.east], lat: [e.north, e.south], x: e.width, y: e.height, data: e.block.V.data, zeroNaN: this.state.zeroToNaN }
|
|
2234
2236
|
]));
|
|
2235
2237
|
}
|
|
2236
2238
|
/** 创建热力图图层 */
|
|
2237
2239
|
createColorMapLayer(e) {
|
|
2238
|
-
const { colorRamp: t, colorRampDefaultColor: n, linearValue: o,
|
|
2239
|
-
n &&
|
|
2240
|
+
const { colorRamp: t, colorRampDefaultColor: n, linearValue: o, linearColorRamp: i, alpha: s } = this.state, l = t.map((c) => [c.value, c.color]).flat();
|
|
2241
|
+
n && l.unshift(n), this.colorMapLayer = new Go({
|
|
2240
2242
|
id: this.colorMapId,
|
|
2241
2243
|
source: e.ftype === "UV" ? this.valueDirectionSourceId : this.sourceId,
|
|
2242
2244
|
dataFilter: o ? "linear" : "nearest",
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
+
colorRampFilter: i ? "linear" : "nearest",
|
|
2246
|
+
color: l,
|
|
2247
|
+
opacity: s,
|
|
2245
2248
|
elevation: 0
|
|
2246
2249
|
});
|
|
2247
2250
|
}
|
|
2248
2251
|
/** 创建文本图层(网格数值) */
|
|
2249
2252
|
createTextLayer(e) {
|
|
2250
2253
|
const { gridValueStyle: t, gridValueFormat: n, cell: o } = this.state;
|
|
2251
|
-
this.gridValueLayer = new
|
|
2254
|
+
this.gridValueLayer = new Xo({
|
|
2252
2255
|
id: this.gridValueId,
|
|
2253
2256
|
source: e.ftype === "UV" ? this.valueDirectionSourceId : this.sourceId,
|
|
2254
2257
|
cell: o,
|
|
@@ -2279,20 +2282,20 @@ class Jo {
|
|
|
2279
2282
|
convert: o.format ?? i ?? ((l) => l.toFixed(1))
|
|
2280
2283
|
} : null
|
|
2281
2284
|
};
|
|
2282
|
-
n.cell && (s.cell = n.cell), this.contourLayer = new
|
|
2285
|
+
n.cell && (s.cell = n.cell), this.contourLayer = new ia(s);
|
|
2283
2286
|
}
|
|
2284
2287
|
/** 创建向量和粒子图层 */
|
|
2285
2288
|
createVectorAndParticleLayers(e) {
|
|
2286
|
-
const { level: t, vectorColor: n, cell: o, vectorImage: i, particleConfig: s, colorRamp: l } = this.state,
|
|
2287
|
-
this.vectorLayer = new
|
|
2289
|
+
const { level: t, vectorColor: n, cell: o, vectorImage: i, particleConfig: s, colorRamp: l } = this.state, c = e.ftype.toLowerCase();
|
|
2290
|
+
this.vectorLayer = new Qo({
|
|
2288
2291
|
id: this.vectorLayerId,
|
|
2289
2292
|
source: this.valueDirectionSourceId,
|
|
2290
2293
|
level: [...t],
|
|
2291
|
-
type:
|
|
2294
|
+
type: c,
|
|
2292
2295
|
color: n,
|
|
2293
2296
|
cell: o,
|
|
2294
2297
|
image: {
|
|
2295
|
-
src: (i == null ? void 0 : i.url) ??
|
|
2298
|
+
src: (i == null ? void 0 : i.url) ?? la,
|
|
2296
2299
|
count: [
|
|
2297
2300
|
(i == null ? void 0 : i.column) ?? 5,
|
|
2298
2301
|
(i == null ? void 0 : i.row) ?? 5
|
|
@@ -2301,14 +2304,14 @@ class Jo {
|
|
|
2301
2304
|
}
|
|
2302
2305
|
});
|
|
2303
2306
|
const h = (s.colorRamp ?? l).map((d) => [d.value, d.color]).flat();
|
|
2304
|
-
this.particleLayer = new
|
|
2307
|
+
this.particleLayer = new ta({
|
|
2305
2308
|
id: this.particleLayerId,
|
|
2306
2309
|
source: this.valueDirectionSourceId,
|
|
2307
2310
|
color: h,
|
|
2308
2311
|
size: s.size,
|
|
2309
2312
|
speed: s.speed,
|
|
2310
2313
|
disappear: s.disappear,
|
|
2311
|
-
type:
|
|
2314
|
+
type: c
|
|
2312
2315
|
});
|
|
2313
2316
|
}
|
|
2314
2317
|
// ======================== 图层添加与可见性 ========================
|
|
@@ -2326,7 +2329,7 @@ class Jo {
|
|
|
2326
2329
|
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);
|
|
2327
2330
|
}
|
|
2328
2331
|
}
|
|
2329
|
-
function
|
|
2332
|
+
function ua() {
|
|
2330
2333
|
return {
|
|
2331
2334
|
name: void 0,
|
|
2332
2335
|
fillFulling: !0,
|
|
@@ -2334,6 +2337,7 @@ function $o() {
|
|
|
2334
2337
|
gridValue: !1,
|
|
2335
2338
|
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],
|
|
2336
2339
|
linearValue: !1,
|
|
2340
|
+
linearColorRamp: !1,
|
|
2337
2341
|
contour: [],
|
|
2338
2342
|
contourStyle: {
|
|
2339
2343
|
width: 2,
|
|
@@ -2370,36 +2374,37 @@ function $o() {
|
|
|
2370
2374
|
speed: 0.3,
|
|
2371
2375
|
disappear: 1,
|
|
2372
2376
|
colorRamp: void 0
|
|
2373
|
-
}
|
|
2377
|
+
},
|
|
2378
|
+
zeroToNaN: !1
|
|
2374
2379
|
};
|
|
2375
2380
|
}
|
|
2376
|
-
class
|
|
2381
|
+
class ur {
|
|
2377
2382
|
constructor(e, t, n) {
|
|
2378
|
-
|
|
2379
|
-
|
|
2383
|
+
g(this, "bluestar");
|
|
2384
|
+
g(this, "viewer");
|
|
2380
2385
|
/** 响应式完整状态 */
|
|
2381
|
-
|
|
2386
|
+
g(this, "state");
|
|
2382
2387
|
// —— 图层引用 ——
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
this.bluestar = e, this.viewer = e.viewer, this.wegRenderer = n, this.state =
|
|
2388
|
+
g(this, "sourceId", "");
|
|
2389
|
+
g(this, "colorMapId", "");
|
|
2390
|
+
g(this, "gridValueId", "");
|
|
2391
|
+
g(this, "contourLayerId", "");
|
|
2392
|
+
g(this, "vectorLayerId", "");
|
|
2393
|
+
g(this, "colorMapLayer");
|
|
2394
|
+
g(this, "gridValueLayer");
|
|
2395
|
+
g(this, "contourLayer");
|
|
2396
|
+
g(this, "vectorLayer");
|
|
2397
|
+
g(this, "particleLayer");
|
|
2398
|
+
g(this, "mainSource");
|
|
2399
|
+
g(this, "valueDirectionSource");
|
|
2400
|
+
g(this, "_watchersSetup", !1);
|
|
2401
|
+
g(this, "wegRenderer");
|
|
2402
|
+
this.bluestar = e, this.viewer = e.viewer, this.wegRenderer = n, this.state = Ge(ua()), this.applyConfig(t);
|
|
2398
2403
|
}
|
|
2399
2404
|
/** 将用户配置合并到响应式 state 中 */
|
|
2400
2405
|
applyConfig(e) {
|
|
2401
2406
|
const t = this.state;
|
|
2402
|
-
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.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);
|
|
2407
|
+
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);
|
|
2403
2408
|
}
|
|
2404
2409
|
/**
|
|
2405
2410
|
* 绑定图层引用并启动 watcher 监听
|
|
@@ -2424,7 +2429,7 @@ class qt {
|
|
|
2424
2429
|
this.vectorLayer && this.vectorLayer.setOptions({ color: e, level: [...this.state.level], cell: this.state.cell });
|
|
2425
2430
|
}), P(() => this.state.cell, (e) => {
|
|
2426
2431
|
this.vectorLayer && this.vectorLayer.setOptions({ cell: e, level: [...this.state.level], color: this.state.vectorColor }), this.gridValueLayer && this.gridValueLayer.setOptions({ cell: e ?? 4 });
|
|
2427
|
-
}), 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.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()));
|
|
2432
|
+
}), 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()));
|
|
2428
2433
|
}
|
|
2429
2434
|
// ======================== 图层更新方法 ========================
|
|
2430
2435
|
updateHeatmapLayer() {
|
|
@@ -2462,7 +2467,7 @@ class qt {
|
|
|
2462
2467
|
}
|
|
2463
2468
|
updateTextLayer() {
|
|
2464
2469
|
if (!this.gridValueLayer) return;
|
|
2465
|
-
const { gridValueStyle: e, gridValueFormat: t } = this.state, n =
|
|
2470
|
+
const { gridValueStyle: e, gridValueFormat: t } = this.state, n = ur.checkGridValueColor(
|
|
2466
2471
|
e.color ?? ((o) => "#000")
|
|
2467
2472
|
);
|
|
2468
2473
|
this.gridValueLayer.setOptions({
|
|
@@ -2474,7 +2479,7 @@ class qt {
|
|
|
2474
2479
|
// ======================== 静态工具方法 ========================
|
|
2475
2480
|
static checkGridValueColor(e) {
|
|
2476
2481
|
if (typeof e == "string") {
|
|
2477
|
-
if (
|
|
2482
|
+
if (ft.rgbaMatcher.test(e) || ft.rrggbbaaMatcher.test(e) || ft.rgbParenthesesMatcher.test(e) || ft.hslParenthesesMatcher.test(e)) return () => e;
|
|
2478
2483
|
try {
|
|
2479
2484
|
const n = new Function(`return (${e})`)();
|
|
2480
2485
|
return n(1), n;
|
|
@@ -2501,7 +2506,7 @@ class qt {
|
|
|
2501
2506
|
this.wegRenderer.layerManager.createSource(e);
|
|
2502
2507
|
}
|
|
2503
2508
|
}
|
|
2504
|
-
class
|
|
2509
|
+
class da extends sa {
|
|
2505
2510
|
/**
|
|
2506
2511
|
* 构造函数,初始化 Weg 渲染器并添加对应的地图图层
|
|
2507
2512
|
* @param bluestar - BlueStar 实例
|
|
@@ -2510,14 +2515,14 @@ class qo extends Qo {
|
|
|
2510
2515
|
*/
|
|
2511
2516
|
constructor(t, n, o) {
|
|
2512
2517
|
super(o.name);
|
|
2513
|
-
|
|
2518
|
+
g(this, "bluestar");
|
|
2514
2519
|
/** 图层管理器 */
|
|
2515
|
-
|
|
2520
|
+
g(this, "layerManager");
|
|
2516
2521
|
/** 属性控制器(持有响应式 state + watch) */
|
|
2517
|
-
|
|
2522
|
+
g(this, "propertyController");
|
|
2518
2523
|
if (this.bluestar = t, !o)
|
|
2519
2524
|
throw new Error("weg config 不能为空");
|
|
2520
|
-
this.propertyController = new
|
|
2525
|
+
this.propertyController = new ur(t, o, this), this.layerManager = new ca(t, this.propertyController.state, this), this.layerManager.createLayers(n), this.propertyController.bindLayers({
|
|
2521
2526
|
sourceId: this.layerManager.sourceId,
|
|
2522
2527
|
colorMapId: this.layerManager.colorMapId,
|
|
2523
2528
|
gridValueId: this.layerManager.gridValueId,
|
|
@@ -2927,14 +2932,14 @@ class qo extends Qo {
|
|
|
2927
2932
|
this.layerManager.destroy();
|
|
2928
2933
|
}
|
|
2929
2934
|
}
|
|
2930
|
-
function
|
|
2935
|
+
function ha(r) {
|
|
2931
2936
|
return new Promise((e, t) => {
|
|
2932
2937
|
r.toBlob((n) => {
|
|
2933
2938
|
n ? e(URL.createObjectURL(n)) : t(new Error("Failed to convert canvas to blob."));
|
|
2934
2939
|
}, "image/png");
|
|
2935
2940
|
});
|
|
2936
2941
|
}
|
|
2937
|
-
async function
|
|
2942
|
+
async function Rr(r, e = 1) {
|
|
2938
2943
|
const { width: t, height: n, block: o, ftype: i, pixelFormat: s } = r;
|
|
2939
2944
|
if (s !== "RGB")
|
|
2940
2945
|
throw new Error(`Weg 文件格式错误:期望 pixelFormat 为 "RGB",实际为 "${s}"`);
|
|
@@ -2943,20 +2948,20 @@ async function fr(r, e = 1) {
|
|
|
2943
2948
|
const l = o.V.data;
|
|
2944
2949
|
if (!l)
|
|
2945
2950
|
throw new Error("Weg 文件数据为空");
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2948
|
-
const
|
|
2949
|
-
if (!
|
|
2951
|
+
const c = document.createElement("canvas");
|
|
2952
|
+
c.width = t, c.height = n;
|
|
2953
|
+
const u = c.getContext("2d");
|
|
2954
|
+
if (!u)
|
|
2950
2955
|
throw new Error("无法获取 Canvas 2D 上下文");
|
|
2951
|
-
const h =
|
|
2956
|
+
const h = u.createImageData(t, n), d = h.data;
|
|
2952
2957
|
for (let f = 0; f < t * n; f++) {
|
|
2953
|
-
const
|
|
2954
|
-
d[
|
|
2955
|
-
let
|
|
2956
|
-
e !== 1 && (
|
|
2958
|
+
const m = f * 3, v = f * 4, x = l[m], R = l[m + 1], C = l[m + 2];
|
|
2959
|
+
d[v] = isNaN(x) ? 0 : Math.round(x), d[v + 1] = isNaN(R) ? 0 : Math.round(R), d[v + 2] = isNaN(C) ? 0 : Math.round(C);
|
|
2960
|
+
let b = 255;
|
|
2961
|
+
e !== 1 && (b = Math.round(255 * e)), b = Math.min(255, Math.max(0, b)), d[v + 3] = b;
|
|
2957
2962
|
}
|
|
2958
|
-
return
|
|
2959
|
-
uri: await
|
|
2963
|
+
return u.putImageData(h, 0, 0), {
|
|
2964
|
+
uri: await ha(c),
|
|
2960
2965
|
west: r.west,
|
|
2961
2966
|
north: r.north,
|
|
2962
2967
|
east: r.east,
|
|
@@ -2964,7 +2969,7 @@ async function fr(r, e = 1) {
|
|
|
2964
2969
|
alpha: e
|
|
2965
2970
|
};
|
|
2966
2971
|
}
|
|
2967
|
-
class
|
|
2972
|
+
class fa {
|
|
2968
2973
|
/**
|
|
2969
2974
|
* 创建图片渲染器实例
|
|
2970
2975
|
* @param bluestar - BlueStar 实例
|
|
@@ -2972,46 +2977,46 @@ class ta {
|
|
|
2972
2977
|
* @param imageRenderOptions - 可选的渲染选项配置
|
|
2973
2978
|
*/
|
|
2974
2979
|
constructor(e, t, n) {
|
|
2975
|
-
|
|
2980
|
+
g(this, "bluestar");
|
|
2976
2981
|
/**
|
|
2977
2982
|
* MapLibre GL 地图实例
|
|
2978
2983
|
*/
|
|
2979
|
-
|
|
2984
|
+
g(this, "map");
|
|
2980
2985
|
/**
|
|
2981
2986
|
* 图片透明度(内部存储)
|
|
2982
2987
|
*/
|
|
2983
|
-
|
|
2988
|
+
g(this, "_alpha");
|
|
2984
2989
|
/**
|
|
2985
2990
|
* 图片源唯一标识符
|
|
2986
2991
|
*/
|
|
2987
|
-
|
|
2992
|
+
g(this, "sourceId");
|
|
2988
2993
|
/**
|
|
2989
2994
|
* 图片图层唯一标识符
|
|
2990
2995
|
*/
|
|
2991
|
-
|
|
2996
|
+
g(this, "imageLayerId");
|
|
2992
2997
|
/**
|
|
2993
2998
|
* 图片显示地理范围
|
|
2994
2999
|
*/
|
|
2995
|
-
|
|
3000
|
+
g(this, "bound");
|
|
2996
3001
|
/**
|
|
2997
3002
|
* 是否使用线性插值
|
|
2998
3003
|
*/
|
|
2999
|
-
|
|
3004
|
+
g(this, "linerValue", !0);
|
|
3000
3005
|
/**
|
|
3001
3006
|
* 当前 WegFile 数据(用于 getter 返回)
|
|
3002
3007
|
*/
|
|
3003
|
-
|
|
3008
|
+
g(this, "_wegFile", null);
|
|
3004
3009
|
/**
|
|
3005
3010
|
* 当前图片 URI(用于内存管理)
|
|
3006
3011
|
*/
|
|
3007
|
-
|
|
3012
|
+
g(this, "uri", "");
|
|
3008
3013
|
this.bluestar = e;
|
|
3009
3014
|
const o = e.viewer;
|
|
3010
3015
|
n || (n = {
|
|
3011
3016
|
alpha: 1,
|
|
3012
3017
|
linerValue: !0
|
|
3013
3018
|
}), this.map = o;
|
|
3014
|
-
const i =
|
|
3019
|
+
const i = Ct(), s = Ct();
|
|
3015
3020
|
this.sourceId = i, this.imageLayerId = s, this.bound = {
|
|
3016
3021
|
west: t.west,
|
|
3017
3022
|
south: t.south,
|
|
@@ -3028,7 +3033,7 @@ class ta {
|
|
|
3028
3033
|
const t = this.map;
|
|
3029
3034
|
let n, o;
|
|
3030
3035
|
if ("dtype" in e)
|
|
3031
|
-
this._wegFile = e, o = await
|
|
3036
|
+
this._wegFile = e, o = await Rr(e), n = o.uri, this.uri = n;
|
|
3032
3037
|
else {
|
|
3033
3038
|
if (o = e, !o.url) throw new Error("url is required");
|
|
3034
3039
|
n = o.url;
|
|
@@ -3123,7 +3128,7 @@ class ta {
|
|
|
3123
3128
|
async setWegData(e) {
|
|
3124
3129
|
if (!("dtype" in e))
|
|
3125
3130
|
throw new Error("数据不是 weg");
|
|
3126
|
-
const t = await
|
|
3131
|
+
const t = await Rr(e);
|
|
3127
3132
|
this._wegFile = e, this.setImage(t.uri, t), this.uri = t.uri;
|
|
3128
3133
|
}
|
|
3129
3134
|
/**
|
|
@@ -3174,8 +3179,8 @@ class ta {
|
|
|
3174
3179
|
this.map.removeLayer(this.imageLayerId), this.map.removeSource(this.sourceId), this.uri && URL.revokeObjectURL(this.uri);
|
|
3175
3180
|
}
|
|
3176
3181
|
}
|
|
3177
|
-
const
|
|
3178
|
-
class
|
|
3182
|
+
const _i = new Xn();
|
|
3183
|
+
class pa {
|
|
3179
3184
|
/**
|
|
3180
3185
|
* 创建 BlueStar 实例
|
|
3181
3186
|
*
|
|
@@ -3190,20 +3195,20 @@ class ra {
|
|
|
3190
3195
|
*/
|
|
3191
3196
|
constructor(e, t) {
|
|
3192
3197
|
/** MapLibre GL 地图实例(通过 viewer 访问) */
|
|
3193
|
-
|
|
3194
|
-
|
|
3198
|
+
g(this, "viewer");
|
|
3199
|
+
g(this, "map");
|
|
3195
3200
|
/** 地图容器 DOM 元素或 ID */
|
|
3196
|
-
|
|
3201
|
+
g(this, "domId");
|
|
3197
3202
|
/** 地图是否已准备就绪 */
|
|
3198
|
-
|
|
3203
|
+
g(this, "ready", !1);
|
|
3199
3204
|
/** 事件监听器注册表 */
|
|
3200
|
-
|
|
3205
|
+
g(this, "listener", { "BlueStar:ready": [] });
|
|
3201
3206
|
/** 浮窗组件实例列表 */
|
|
3202
|
-
|
|
3207
|
+
g(this, "bubbleList", []);
|
|
3203
3208
|
this.domId = e.domId;
|
|
3204
|
-
const n =
|
|
3205
|
-
e.incomponent === void 0 || e.incomponent === !0 ? (
|
|
3206
|
-
e.domId && e.domId.value && (this.domId = e.domId.value), this.map =
|
|
3209
|
+
const n = Wr();
|
|
3210
|
+
e.incomponent === void 0 || e.incomponent === !0 ? (Ln("blueStar", this), sr(() => {
|
|
3211
|
+
e.domId && e.domId.value && (this.domId = e.domId.value), this.map = Ar({
|
|
3207
3212
|
...e.config,
|
|
3208
3213
|
container: this.domId
|
|
3209
3214
|
}), this.viewer = this.map, this.map.on("load", () => {
|
|
@@ -3217,9 +3222,9 @@ class ra {
|
|
|
3217
3222
|
o.loadResult.blueStar = this, o.callback(this, o.loadResult.useApiInterceptor);
|
|
3218
3223
|
}), this.listener["BlueStar:ready"] = [], this.initBubbleClick();
|
|
3219
3224
|
});
|
|
3220
|
-
}),
|
|
3225
|
+
}), Sn(() => {
|
|
3221
3226
|
this.destroy();
|
|
3222
|
-
})) : (this.map =
|
|
3227
|
+
})) : (this.map = Ar({
|
|
3223
3228
|
...e.config,
|
|
3224
3229
|
container: this.domId
|
|
3225
3230
|
}), this.viewer = this.map, this.map.on("load", () => {
|
|
@@ -3243,7 +3248,7 @@ class ra {
|
|
|
3243
3248
|
const t = document.querySelectorAll(".bluestar-bubble-container");
|
|
3244
3249
|
if (t.length > 0) {
|
|
3245
3250
|
const n = e.originalEvent, o = t[0].parentElement, i = Array.from(o.children), l = this.map.getCanvas().getBoundingClientRect();
|
|
3246
|
-
let
|
|
3251
|
+
let c, u = -1;
|
|
3247
3252
|
for (let h = 0; h < t.length; h++) {
|
|
3248
3253
|
const d = t[h], p = d.getBoundingClientRect(), f = {
|
|
3249
3254
|
left: p.left - l.left,
|
|
@@ -3252,12 +3257,12 @@ class ra {
|
|
|
3252
3257
|
bottom: p.bottom - l.top
|
|
3253
3258
|
};
|
|
3254
3259
|
if (f.left < n.offsetX && f.right > n.offsetX && f.top < n.offsetY && f.bottom > n.offsetY) {
|
|
3255
|
-
let
|
|
3256
|
-
|
|
3260
|
+
let m = i.indexOf(d);
|
|
3261
|
+
m > u && (c = d, u = m);
|
|
3257
3262
|
}
|
|
3258
3263
|
}
|
|
3259
|
-
if (
|
|
3260
|
-
const h =
|
|
3264
|
+
if (c) {
|
|
3265
|
+
const h = c.getAttribute("data-bluestar-bubble-id");
|
|
3261
3266
|
if (h !== void 0 && h !== "") {
|
|
3262
3267
|
const d = this.bubbleList.find((p) => p.props.id == h);
|
|
3263
3268
|
d && d.exposed && d.exposed.bubbleClick && d.exposed.bubbleClick();
|
|
@@ -3319,7 +3324,7 @@ class ra {
|
|
|
3319
3324
|
*/
|
|
3320
3325
|
renderWeg(e, t) {
|
|
3321
3326
|
if (!this.map) throw new Error("请先初始化地图");
|
|
3322
|
-
return new
|
|
3327
|
+
return new da(this, e, t);
|
|
3323
3328
|
}
|
|
3324
3329
|
/**
|
|
3325
3330
|
* 渲染图片叠加层
|
|
@@ -3356,7 +3361,7 @@ class ra {
|
|
|
3356
3361
|
*/
|
|
3357
3362
|
renderImage(e, t) {
|
|
3358
3363
|
if (!this.map) throw new Error("请先初始化地图");
|
|
3359
|
-
return new
|
|
3364
|
+
return new fa(this, e, t);
|
|
3360
3365
|
}
|
|
3361
3366
|
/**
|
|
3362
3367
|
* 添加事件监听器
|
|
@@ -3451,13 +3456,13 @@ class ra {
|
|
|
3451
3456
|
return this.map.getLayerLevelRule();
|
|
3452
3457
|
}
|
|
3453
3458
|
}
|
|
3454
|
-
function
|
|
3459
|
+
function Nt(r = () => {
|
|
3455
3460
|
}) {
|
|
3456
|
-
const e =
|
|
3461
|
+
const e = _n("blueStar", null), t = Wr(), n = {
|
|
3457
3462
|
blueStar: e,
|
|
3458
3463
|
useApiInterceptor: t
|
|
3459
3464
|
};
|
|
3460
|
-
return
|
|
3465
|
+
return sr(() => {
|
|
3461
3466
|
const o = e;
|
|
3462
3467
|
if (o)
|
|
3463
3468
|
o.viewer ? (n.blueStar = o, r(o, t)) : o.addEventListener("BlueStar:ready", r, n);
|
|
@@ -3465,7 +3470,7 @@ function er(r = () => {
|
|
|
3465
3470
|
throw new Error("请检查上级组件是否创建了 BlueStar 实例");
|
|
3466
3471
|
}), n;
|
|
3467
3472
|
}
|
|
3468
|
-
const
|
|
3473
|
+
const ma = ["data-bluestar-bubble-id"], va = /* @__PURE__ */ $e({
|
|
3469
3474
|
__name: "bubble",
|
|
3470
3475
|
props: {
|
|
3471
3476
|
lon: {},
|
|
@@ -3479,7 +3484,7 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3479
3484
|
},
|
|
3480
3485
|
emits: ["click"],
|
|
3481
3486
|
setup(r, { expose: e, emit: t }) {
|
|
3482
|
-
const n =
|
|
3487
|
+
const n = kn(), o = r, i = t, s = Ge({
|
|
3483
3488
|
x: 0,
|
|
3484
3489
|
y: 0,
|
|
3485
3490
|
active: !0
|
|
@@ -3487,10 +3492,10 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3487
3492
|
function l(d) {
|
|
3488
3493
|
return d != null;
|
|
3489
3494
|
}
|
|
3490
|
-
let
|
|
3491
|
-
function
|
|
3495
|
+
let c;
|
|
3496
|
+
function u() {
|
|
3492
3497
|
if (l(o.lon) && l(o.lat)) {
|
|
3493
|
-
const { x: d, y: p } =
|
|
3498
|
+
const { x: d, y: p } = c.project([o.lon, o.lat]);
|
|
3494
3499
|
s.x = d, s.y = p;
|
|
3495
3500
|
}
|
|
3496
3501
|
}
|
|
@@ -3499,27 +3504,27 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3499
3504
|
o.window || i("click", o.data, o.id);
|
|
3500
3505
|
}
|
|
3501
3506
|
});
|
|
3502
|
-
const h =
|
|
3503
|
-
|
|
3507
|
+
const h = Nt((d) => {
|
|
3508
|
+
c = d.viewer, u(), c.on("move", u), o.window || h.blueStar.bubbleList.push(n);
|
|
3504
3509
|
});
|
|
3505
|
-
return
|
|
3510
|
+
return Bt(() => {
|
|
3506
3511
|
const d = h.blueStar.bubbleList.findIndex((p) => n === p);
|
|
3507
|
-
d >= 0 && h.blueStar.bubbleList.splice(d, 1),
|
|
3508
|
-
}), (d, p) => (
|
|
3509
|
-
class:
|
|
3512
|
+
d >= 0 && h.blueStar.bubbleList.splice(d, 1), c.off("move", u);
|
|
3513
|
+
}), (d, p) => (N(), Z("div", {
|
|
3514
|
+
class: pe(["bluestar-bubble-container", { "no-event": o.window ? "" : "no-event" }]),
|
|
3510
3515
|
"data-bluestar-bubble-id": o.id,
|
|
3511
|
-
style:
|
|
3516
|
+
style: tt(`position: absolute;left: calc(${s.x}px + ${o.offsetX}rem); top: calc(${s.y}px + ${o.offsetY}rem)`),
|
|
3512
3517
|
onClick: p[0] || (p[0] = (f) => i("click", o.data, o.id))
|
|
3513
3518
|
}, [
|
|
3514
|
-
|
|
3515
|
-
], 14,
|
|
3519
|
+
Dt(d.$slots, "default", {}, void 0, !0)
|
|
3520
|
+
], 14, ma));
|
|
3516
3521
|
}
|
|
3517
|
-
}),
|
|
3522
|
+
}), ut = (r, e) => {
|
|
3518
3523
|
const t = r.__vccOpts || r;
|
|
3519
3524
|
for (const [n, o] of e)
|
|
3520
3525
|
t[n] = o;
|
|
3521
3526
|
return t;
|
|
3522
|
-
},
|
|
3527
|
+
}, ya = /* @__PURE__ */ ut(va, [["__scopeId", "data-v-fb281ccf"]]), ga = /* @__PURE__ */ $e({
|
|
3523
3528
|
__name: "bubble-manager",
|
|
3524
3529
|
props: {
|
|
3525
3530
|
data: { default: () => [] },
|
|
@@ -3529,39 +3534,245 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3529
3534
|
clusterPixelRange: { default: 100 }
|
|
3530
3535
|
},
|
|
3531
3536
|
setup(r) {
|
|
3532
|
-
const e = r, t =
|
|
3537
|
+
const e = r, t = Ge({
|
|
3533
3538
|
list: [],
|
|
3534
3539
|
groupCountList: []
|
|
3535
|
-
}), n =
|
|
3540
|
+
}), n = Nt(() => {
|
|
3536
3541
|
i(), n.blueStar.viewer.on("move", i);
|
|
3537
3542
|
});
|
|
3538
|
-
|
|
3543
|
+
Bt(() => {
|
|
3539
3544
|
n.blueStar.viewer.off("move", i);
|
|
3540
3545
|
}), P(() => [e.data, e.idKey, e.latKey, e.lonKey], i);
|
|
3541
3546
|
let o;
|
|
3542
3547
|
function i() {
|
|
3543
3548
|
o && clearTimeout(o), o = setTimeout(() => {
|
|
3544
|
-
const s = n.blueStar.viewer.getBounds(), l = s.getWest(),
|
|
3545
|
-
for (let
|
|
3546
|
-
const
|
|
3547
|
-
if (
|
|
3548
|
-
const x = n.blueStar.viewer.project([
|
|
3549
|
+
const s = n.blueStar.viewer.getBounds(), l = s.getWest(), c = s.getEast(), u = s.getSouth(), h = s.getNorth(), d = [], p = [], f = [];
|
|
3550
|
+
for (let m = 0; m < e.data.length; m++) {
|
|
3551
|
+
const v = e.data[m];
|
|
3552
|
+
if (v[e.lonKey] >= l && v[e.lonKey] <= c && v[e.latKey] >= u && v[e.latKey] <= h) {
|
|
3553
|
+
const x = n.blueStar.viewer.project([v[e.lonKey], v[e.latKey]]);
|
|
3549
3554
|
if (!x) break;
|
|
3550
|
-
const
|
|
3551
|
-
|
|
3555
|
+
const R = p.findIndex((C) => Math.sqrt((C.x - x.x) ** 2 + (C.y - x.y) ** 2) < Ht(e.clusterPixelRange));
|
|
3556
|
+
R < 0 ? (d.push(v), p.push(x), f.push([v])) : f[R].push(v);
|
|
3552
3557
|
}
|
|
3553
3558
|
}
|
|
3554
3559
|
t.list = d, t.groupCountList = f;
|
|
3555
3560
|
}, 100);
|
|
3556
3561
|
}
|
|
3557
|
-
return (s, l) => (
|
|
3558
|
-
value:
|
|
3559
|
-
count: t.groupCountList[
|
|
3560
|
-
group: t.groupCountList[
|
|
3561
|
-
key:
|
|
3562
|
+
return (s, l) => (N(!0), Z(Ee, null, Ze(t.list, (c, u) => Dt(s.$slots, "default", {
|
|
3563
|
+
value: c,
|
|
3564
|
+
count: t.groupCountList[u].length,
|
|
3565
|
+
group: t.groupCountList[u],
|
|
3566
|
+
key: c[e.idKey]
|
|
3562
3567
|
})), 128));
|
|
3563
3568
|
}
|
|
3564
|
-
}),
|
|
3569
|
+
}), ba = {
|
|
3570
|
+
key: 0,
|
|
3571
|
+
style: { position: "absolute", top: "0", left: "0", width: "100%", height: "100%", "pointer-events": "none", overflow: "hidden" }
|
|
3572
|
+
}, Ia = ["onClick"], Ca = 5e3, xa = /* @__PURE__ */ $e({
|
|
3573
|
+
__name: "bubble-overlay",
|
|
3574
|
+
props: {
|
|
3575
|
+
data: {},
|
|
3576
|
+
lonKey: { default: "lon" },
|
|
3577
|
+
latKey: { default: "lat" },
|
|
3578
|
+
idKey: { default: "id" },
|
|
3579
|
+
clusterPixelRange: { default: 100 },
|
|
3580
|
+
offsetX: { default: 0 },
|
|
3581
|
+
offsetY: { default: 0 },
|
|
3582
|
+
clickable: { type: Boolean, default: !0 },
|
|
3583
|
+
window: { type: Boolean, default: !0 }
|
|
3584
|
+
},
|
|
3585
|
+
emits: ["click"],
|
|
3586
|
+
setup(r, { emit: e }) {
|
|
3587
|
+
const t = r, n = e, o = pr(() => Array.isArray(t.data) ? t.data : t.data ? [t.data] : []), i = pr(() => o.value.length > 0), s = Mn([]), l = {};
|
|
3588
|
+
let c = 16;
|
|
3589
|
+
function u() {
|
|
3590
|
+
return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
3591
|
+
}
|
|
3592
|
+
let h, d = null;
|
|
3593
|
+
Nt((I) => {
|
|
3594
|
+
h = I.viewer, c = u(), x(), h.on("move", p), h.on("zoomend", f), h.on("click", T);
|
|
3595
|
+
}), Bt(() => {
|
|
3596
|
+
h && (h.off("move", p), h.off("zoomend", f), h.off("click", T)), d == null || d.terminate();
|
|
3597
|
+
}), P(
|
|
3598
|
+
() => [o.value.length, t.lonKey, t.latKey, t.clusterPixelRange],
|
|
3599
|
+
() => x(),
|
|
3600
|
+
{ flush: "post" }
|
|
3601
|
+
);
|
|
3602
|
+
function p() {
|
|
3603
|
+
R();
|
|
3604
|
+
}
|
|
3605
|
+
function f() {
|
|
3606
|
+
c = u(), x();
|
|
3607
|
+
}
|
|
3608
|
+
function m(I) {
|
|
3609
|
+
return new Promise((w) => setTimeout(w, I));
|
|
3610
|
+
}
|
|
3611
|
+
let v = 0;
|
|
3612
|
+
async function x() {
|
|
3613
|
+
const I = ++v;
|
|
3614
|
+
if (await m(80), I !== v) return;
|
|
3615
|
+
const w = o.value;
|
|
3616
|
+
if (!w.length || !h) {
|
|
3617
|
+
s.value = [];
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
const _ = h.getBounds(), k = _.getWest(), G = _.getEast(), F = _.getSouth(), D = _.getNorth(), Q = [], Ye = 5e3;
|
|
3621
|
+
for (let q = 0; q < w.length; q += Ye) {
|
|
3622
|
+
if (I !== v) return;
|
|
3623
|
+
const dr = Math.min(q + Ye, w.length);
|
|
3624
|
+
for (let Zt = q; Zt < dr; Zt++) {
|
|
3625
|
+
const Gt = w[Zt], dt = Gt[t.lonKey], ht = Gt[t.latKey];
|
|
3626
|
+
if (dt == null || ht == null || dt < k || dt > G || ht < F || ht > D) continue;
|
|
3627
|
+
const hr = h.project([dt, ht]);
|
|
3628
|
+
Q.push({ item: { ...Gt }, x: hr.x, y: hr.y });
|
|
3629
|
+
}
|
|
3630
|
+
if (dr < w.length && (await m(0), I !== v))
|
|
3631
|
+
return;
|
|
3632
|
+
}
|
|
3633
|
+
const Fe = w.length >= Ca ? await B(Q) : C(Q);
|
|
3634
|
+
I === v && (s.value = Fe.map((q) => ({
|
|
3635
|
+
id: q.item[t.idKey] ?? `${q.x}-${q.y}`,
|
|
3636
|
+
x: q.x,
|
|
3637
|
+
y: q.y,
|
|
3638
|
+
count: q.group.length,
|
|
3639
|
+
group: q.group,
|
|
3640
|
+
original: q.item
|
|
3641
|
+
})));
|
|
3642
|
+
}
|
|
3643
|
+
function R() {
|
|
3644
|
+
const I = s.value;
|
|
3645
|
+
if (!I.length || !h) return;
|
|
3646
|
+
const w = t.offsetX * c, _ = t.offsetY * c;
|
|
3647
|
+
for (const k of I) {
|
|
3648
|
+
const G = h.project([
|
|
3649
|
+
k.original[t.lonKey],
|
|
3650
|
+
k.original[t.latKey]
|
|
3651
|
+
]), F = l[k.id];
|
|
3652
|
+
F && (F.style.transform = `translate3d(${G.x + w}px,${G.y + _}px,0)`);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
function C(I) {
|
|
3656
|
+
const w = Ht(t.clusterPixelRange) || t.clusterPixelRange, _ = /* @__PURE__ */ new Map();
|
|
3657
|
+
for (const k of I) {
|
|
3658
|
+
const G = Math.floor(k.x / w), F = Math.floor(k.y / w);
|
|
3659
|
+
let D = !1;
|
|
3660
|
+
for (let Q = -1; Q <= 1 && !D; Q++)
|
|
3661
|
+
for (let Ye = -1; Ye <= 1 && !D; Ye++) {
|
|
3662
|
+
const Fe = _.get(`${G + Q},${F + Ye}`);
|
|
3663
|
+
Fe && Math.sqrt(
|
|
3664
|
+
(k.x - Fe.x) ** 2 + (k.y - Fe.y) ** 2
|
|
3665
|
+
) < w && (Fe.group.push(k.item), D = !0);
|
|
3666
|
+
}
|
|
3667
|
+
D || _.set(`${G},${F}`, {
|
|
3668
|
+
item: k.item,
|
|
3669
|
+
x: k.x,
|
|
3670
|
+
y: k.y,
|
|
3671
|
+
group: [k.item]
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3674
|
+
return Array.from(_.values());
|
|
3675
|
+
}
|
|
3676
|
+
function b() {
|
|
3677
|
+
if (!d) {
|
|
3678
|
+
const I = `
|
|
3679
|
+
self.onmessage = function(e) {
|
|
3680
|
+
const { visible, cellSize } = e.data
|
|
3681
|
+
const grid = new Map()
|
|
3682
|
+
|
|
3683
|
+
for (const v of visible) {
|
|
3684
|
+
const cellX = Math.floor(v.x / cellSize)
|
|
3685
|
+
const cellY = Math.floor(v.y / cellSize)
|
|
3686
|
+
let merged = false
|
|
3687
|
+
|
|
3688
|
+
for (let dx = -1; dx <= 1 && !merged; dx++) {
|
|
3689
|
+
for (let dy = -1; dy <= 1 && !merged; dy++) {
|
|
3690
|
+
const key = (cellX + dx) + ',' + (cellY + dy)
|
|
3691
|
+
const neighbor = grid.get(key)
|
|
3692
|
+
if (neighbor) {
|
|
3693
|
+
const dist = Math.sqrt((v.x - neighbor.x) ** 2 + (v.y - neighbor.y) ** 2)
|
|
3694
|
+
if (dist < cellSize) {
|
|
3695
|
+
neighbor.group.push(v.item)
|
|
3696
|
+
merged = true
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
if (!merged) {
|
|
3703
|
+
grid.set(cellX + ',' + cellY, {
|
|
3704
|
+
item: v.item,
|
|
3705
|
+
x: v.x,
|
|
3706
|
+
y: v.y,
|
|
3707
|
+
group: [v.item],
|
|
3708
|
+
})
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
|
|
3712
|
+
self.postMessage({ result: Array.from(grid.values()) })
|
|
3713
|
+
}
|
|
3714
|
+
`, w = new Blob([I], { type: "application/javascript" });
|
|
3715
|
+
d = new Worker(URL.createObjectURL(w));
|
|
3716
|
+
}
|
|
3717
|
+
return d;
|
|
3718
|
+
}
|
|
3719
|
+
function B(I) {
|
|
3720
|
+
return new Promise((w) => {
|
|
3721
|
+
const _ = b(), k = (G) => {
|
|
3722
|
+
_.removeEventListener("message", k), w(G.data.result);
|
|
3723
|
+
};
|
|
3724
|
+
_.addEventListener("message", k), _.postMessage({
|
|
3725
|
+
visible: I,
|
|
3726
|
+
cellSize: Ht(t.clusterPixelRange) || t.clusterPixelRange
|
|
3727
|
+
});
|
|
3728
|
+
});
|
|
3729
|
+
}
|
|
3730
|
+
function L(I, w) {
|
|
3731
|
+
w ? l[I] = w : delete l[I];
|
|
3732
|
+
}
|
|
3733
|
+
function M(I) {
|
|
3734
|
+
t.clickable && n("click", I.original, I.id);
|
|
3735
|
+
}
|
|
3736
|
+
function T(I) {
|
|
3737
|
+
if (t.window || !t.clickable) return;
|
|
3738
|
+
const { clientX: w, clientY: _ } = I.originalEvent, k = s.value;
|
|
3739
|
+
for (let G = k.length - 1; G >= 0; G--) {
|
|
3740
|
+
const F = k[G], D = l[F.id];
|
|
3741
|
+
if (!D) continue;
|
|
3742
|
+
const Q = D.getBoundingClientRect();
|
|
3743
|
+
if (w >= Q.left && w <= Q.right && _ >= Q.top && _ <= Q.bottom) {
|
|
3744
|
+
n("click", F.original, F.id);
|
|
3745
|
+
return;
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
return (I, w) => i.value ? (N(), Z("div", ba, [
|
|
3750
|
+
(N(!0), Z(Ee, null, Ze(s.value, (_) => (N(), Z("div", {
|
|
3751
|
+
key: _.id,
|
|
3752
|
+
ref_for: !0,
|
|
3753
|
+
ref: (k) => L(_.id, k),
|
|
3754
|
+
style: tt({
|
|
3755
|
+
position: "absolute",
|
|
3756
|
+
left: 0,
|
|
3757
|
+
top: 0,
|
|
3758
|
+
transform: `translate3d(${_.x + I.offsetX * Xt(c)}px,${_.y + I.offsetY * Xt(c)}px,0)`,
|
|
3759
|
+
// window=false 时始终穿透,拖拽不阻塞,点击由 map.click 命中检测处理
|
|
3760
|
+
pointerEvents: I.window && I.clickable ? "auto" : "none",
|
|
3761
|
+
willChange: "transform"
|
|
3762
|
+
}),
|
|
3763
|
+
onClick: Vn((k) => M(_), ["stop"])
|
|
3764
|
+
}, [
|
|
3765
|
+
Dt(I.$slots, "default", {
|
|
3766
|
+
item: _.original,
|
|
3767
|
+
count: _.count,
|
|
3768
|
+
group: _.group,
|
|
3769
|
+
x: _.x,
|
|
3770
|
+
y: _.y
|
|
3771
|
+
})
|
|
3772
|
+
], 12, Ia))), 128))
|
|
3773
|
+
])) : be("", !0);
|
|
3774
|
+
}
|
|
3775
|
+
}), Ea = { class: "map-contaienr" }, Aa = {
|
|
3565
3776
|
__name: "map",
|
|
3566
3777
|
props: {
|
|
3567
3778
|
config: {
|
|
@@ -3570,23 +3781,23 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3570
3781
|
},
|
|
3571
3782
|
emits: ["load"],
|
|
3572
3783
|
setup(r, { emit: e }) {
|
|
3573
|
-
const t = e, n = r, o =
|
|
3784
|
+
const t = e, n = r, o = le(null), i = new pa({
|
|
3574
3785
|
// @ts-ignore
|
|
3575
|
-
domId:
|
|
3576
|
-
config:
|
|
3786
|
+
domId: mr(o),
|
|
3787
|
+
config: mr(n.config)
|
|
3577
3788
|
}, () => {
|
|
3578
3789
|
t("load", i);
|
|
3579
3790
|
});
|
|
3580
|
-
return (s, l) => (
|
|
3581
|
-
|
|
3791
|
+
return (s, l) => (N(), Z("div", Ea, [
|
|
3792
|
+
y("div", {
|
|
3582
3793
|
ref_key: "mapContainer",
|
|
3583
3794
|
ref: o,
|
|
3584
3795
|
class: "map-contaienr"
|
|
3585
3796
|
}, null, 512),
|
|
3586
|
-
|
|
3797
|
+
Dt(s.$slots, "default", {}, void 0, !0)
|
|
3587
3798
|
]));
|
|
3588
3799
|
}
|
|
3589
|
-
},
|
|
3800
|
+
}, Rn = /* @__PURE__ */ ut(Aa, [["__scopeId", "data-v-151cd952"]]), Ra = [
|
|
3590
3801
|
{
|
|
3591
3802
|
name: "降水",
|
|
3592
3803
|
colors: [
|
|
@@ -3709,301 +3920,301 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
3709
3920
|
{ color: "#000000", value: 100 }
|
|
3710
3921
|
]
|
|
3711
3922
|
}
|
|
3712
|
-
],
|
|
3923
|
+
], Ta = { class: "color-bar-dialog" }, wa = { class: "dialog-body" }, La = { class: "preset-management" }, Sa = { class: "preset-list" }, _a = ["onClick"], ka = { class: "preset-colors-preview" }, Ma = {
|
|
3713
3924
|
key: 0,
|
|
3714
3925
|
class: "more-count"
|
|
3715
|
-
},
|
|
3926
|
+
}, Va = { class: "preset-info" }, Ba = { class: "preset-name-wrapper" }, Da = { class: "preset-name" }, Na = {
|
|
3716
3927
|
key: 0,
|
|
3717
3928
|
class: "preset-badge"
|
|
3718
|
-
},
|
|
3929
|
+
}, Za = { class: "preset-count" }, Ga = ["onClick"], Ya = {
|
|
3719
3930
|
key: 0,
|
|
3720
3931
|
class: "empty-preset-tip"
|
|
3721
|
-
},
|
|
3932
|
+
}, Fa = { class: "section-title-wrapper" }, Pa = { class: "color-actions" }, Xa = { class: "current-count" }, Wa = { class: "color-list" }, za = { class: "color-index" }, Ha = { class: "color-input-wrapper" }, Ka = ["onUpdate:modelValue"], Oa = { class: "color-input-wrapper" }, Ua = ["onUpdate:modelValue"], Qa = ["onClick"], ja = {
|
|
3722
3933
|
key: 0,
|
|
3723
3934
|
class: "save-dialog-overlay"
|
|
3724
|
-
},
|
|
3935
|
+
}, Ja = { class: "save-dialog" }, Tr = "bluestar-color-presets", $a = /* @__PURE__ */ $e({
|
|
3725
3936
|
__name: "color-bar-edit",
|
|
3726
3937
|
props: {
|
|
3727
3938
|
modelValue: { default: () => [] }
|
|
3728
3939
|
},
|
|
3729
3940
|
emits: ["confirm", "cancel"],
|
|
3730
3941
|
setup(r, { emit: e }) {
|
|
3731
|
-
const t = r, n = e, o =
|
|
3732
|
-
|
|
3733
|
-
i.value =
|
|
3734
|
-
...
|
|
3942
|
+
const t = r, n = e, o = le([...t.modelValue]), i = le([]), s = le(-1), l = le(!1), c = le(""), u = le(!1), h = le(""), d = le("success");
|
|
3943
|
+
sr(() => {
|
|
3944
|
+
i.value = Ra.map((I) => ({
|
|
3945
|
+
...I,
|
|
3735
3946
|
isPreset: !0
|
|
3736
3947
|
}));
|
|
3737
|
-
const
|
|
3738
|
-
if (
|
|
3948
|
+
const T = localStorage.getItem(Tr);
|
|
3949
|
+
if (T)
|
|
3739
3950
|
try {
|
|
3740
|
-
JSON.parse(
|
|
3951
|
+
JSON.parse(T).forEach((w) => {
|
|
3741
3952
|
i.value.push({
|
|
3742
|
-
...
|
|
3953
|
+
...w,
|
|
3743
3954
|
isPreset: !1
|
|
3744
3955
|
});
|
|
3745
3956
|
});
|
|
3746
|
-
} catch (
|
|
3747
|
-
console.error("解析色卡数据失败",
|
|
3957
|
+
} catch (I) {
|
|
3958
|
+
console.error("解析色卡数据失败", I);
|
|
3748
3959
|
}
|
|
3749
3960
|
});
|
|
3750
3961
|
function p() {
|
|
3751
|
-
const
|
|
3752
|
-
localStorage.setItem(
|
|
3962
|
+
const T = i.value.filter((I) => !I.isPreset);
|
|
3963
|
+
localStorage.setItem(Tr, JSON.stringify(T));
|
|
3753
3964
|
}
|
|
3754
|
-
function f(
|
|
3755
|
-
h.value =
|
|
3756
|
-
|
|
3965
|
+
function f(T, I = "success") {
|
|
3966
|
+
h.value = T, d.value = I, u.value = !0, setTimeout(() => {
|
|
3967
|
+
u.value = !1;
|
|
3757
3968
|
}, 2e3);
|
|
3758
3969
|
}
|
|
3759
|
-
function
|
|
3760
|
-
|
|
3970
|
+
function m() {
|
|
3971
|
+
c.value = "", l.value = !0;
|
|
3761
3972
|
}
|
|
3762
|
-
function
|
|
3763
|
-
l.value = !1,
|
|
3973
|
+
function v() {
|
|
3974
|
+
l.value = !1, c.value = "";
|
|
3764
3975
|
}
|
|
3765
3976
|
function x() {
|
|
3766
|
-
if (!
|
|
3977
|
+
if (!c.value.trim()) {
|
|
3767
3978
|
f("请输入色卡名称", "error");
|
|
3768
3979
|
return;
|
|
3769
3980
|
}
|
|
3770
|
-
const
|
|
3771
|
-
if (
|
|
3772
|
-
if (confirm(`色卡"${
|
|
3773
|
-
i.value[
|
|
3981
|
+
const T = i.value.findIndex((I) => !I.isPreset && I.name === c.value.trim());
|
|
3982
|
+
if (T !== -1)
|
|
3983
|
+
if (confirm(`色卡"${c.value}"已存在,是否覆盖?`))
|
|
3984
|
+
i.value[T].colors = [...o.value], p(), f("色卡已更新", "success");
|
|
3774
3985
|
else {
|
|
3775
|
-
|
|
3986
|
+
v();
|
|
3776
3987
|
return;
|
|
3777
3988
|
}
|
|
3778
3989
|
else {
|
|
3779
|
-
const
|
|
3780
|
-
name:
|
|
3990
|
+
const I = {
|
|
3991
|
+
name: c.value.trim(),
|
|
3781
3992
|
colors: [...o.value],
|
|
3782
3993
|
isPreset: !1
|
|
3783
3994
|
};
|
|
3784
|
-
i.value.push(
|
|
3995
|
+
i.value.push(I), p(), f("色卡保存成功", "success");
|
|
3785
3996
|
}
|
|
3786
|
-
|
|
3997
|
+
v();
|
|
3787
3998
|
}
|
|
3788
|
-
function
|
|
3789
|
-
|
|
3999
|
+
function R(T) {
|
|
4000
|
+
T < 0 || T >= i.value.length || (s.value = T, o.value = JSON.parse(JSON.stringify(i.value[T].colors)), f(`已加载色卡:${i.value[T].name}`, "success"));
|
|
3790
4001
|
}
|
|
3791
|
-
function
|
|
3792
|
-
|
|
3793
|
-
const
|
|
3794
|
-
if (
|
|
4002
|
+
function C(T, I) {
|
|
4003
|
+
I.stopPropagation();
|
|
4004
|
+
const w = i.value[T];
|
|
4005
|
+
if (w.isPreset) {
|
|
3795
4006
|
f("预置色卡不能删除", "error");
|
|
3796
4007
|
return;
|
|
3797
4008
|
}
|
|
3798
|
-
confirm(`确定要删除色卡"${
|
|
4009
|
+
confirm(`确定要删除色卡"${w.name}"吗?`) && (i.value.splice(T, 1), p(), s.value === T ? s.value = -1 : s.value > T && s.value--, f("色卡已删除", "success"));
|
|
3799
4010
|
}
|
|
3800
|
-
function
|
|
3801
|
-
const
|
|
4011
|
+
function b() {
|
|
4012
|
+
const T = o.value.length > 0 ? o.value[o.value.length - 1].value : 0;
|
|
3802
4013
|
o.value.push({
|
|
3803
4014
|
color: "#ffffff",
|
|
3804
|
-
value:
|
|
4015
|
+
value: T + 10
|
|
3805
4016
|
}), s.value !== -1 && i.value[s.value] && (i.value[s.value].colors = [...o.value], p()), f("颜色已添加", "success");
|
|
3806
4017
|
}
|
|
3807
|
-
function
|
|
3808
|
-
if (
|
|
4018
|
+
function B(T, I) {
|
|
4019
|
+
if (I.stopPropagation(), o.value.length <= 2) {
|
|
3809
4020
|
f("至少保留两个颜色", "error");
|
|
3810
4021
|
return;
|
|
3811
4022
|
}
|
|
3812
|
-
o.value.splice(
|
|
4023
|
+
o.value.splice(T, 1), s.value !== -1 && i.value[s.value] && (i.value[s.value].colors = [...o.value], p()), f("颜色已删除", "success");
|
|
3813
4024
|
}
|
|
3814
|
-
const
|
|
4025
|
+
const L = () => {
|
|
3815
4026
|
n("confirm", o.value);
|
|
3816
|
-
},
|
|
4027
|
+
}, M = () => {
|
|
3817
4028
|
n("cancel");
|
|
3818
4029
|
};
|
|
3819
|
-
return (
|
|
3820
|
-
|
|
3821
|
-
|
|
4030
|
+
return (T, I) => (N(), Z("div", Ta, [
|
|
4031
|
+
I[10] || (I[10] = y("div", { class: "dialog-header" }, [
|
|
4032
|
+
y("h3", null, "颜色编辑")
|
|
3822
4033
|
], -1)),
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
4034
|
+
y("div", wa, [
|
|
4035
|
+
y("div", La, [
|
|
4036
|
+
y("div", { class: "preset-header" }, [
|
|
4037
|
+
I[2] || (I[2] = y("span", { class: "section-title" }, "我的色卡", -1)),
|
|
4038
|
+
y("button", {
|
|
3828
4039
|
class: "btn-save-preset",
|
|
3829
|
-
onClick:
|
|
4040
|
+
onClick: m,
|
|
3830
4041
|
title: "保存当前色卡"
|
|
3831
|
-
},
|
|
3832
|
-
|
|
4042
|
+
}, I[1] || (I[1] = [
|
|
4043
|
+
y("svg", {
|
|
3833
4044
|
width: "16",
|
|
3834
4045
|
height: "16",
|
|
3835
4046
|
viewBox: "0 0 16 16",
|
|
3836
4047
|
fill: "currentColor"
|
|
3837
4048
|
}, [
|
|
3838
|
-
|
|
4049
|
+
y("path", { d: "M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zm-3 14H5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2zm0-4H5V4h6v7z" })
|
|
3839
4050
|
], -1),
|
|
3840
|
-
|
|
4051
|
+
qe(" 保存色卡 ", -1)
|
|
3841
4052
|
]))
|
|
3842
4053
|
]),
|
|
3843
|
-
|
|
3844
|
-
(
|
|
3845
|
-
key:
|
|
3846
|
-
class:
|
|
3847
|
-
onClick: (
|
|
4054
|
+
y("div", Sa, [
|
|
4055
|
+
(N(!0), Z(Ee, null, Ze(i.value, (w, _) => (N(), Z("div", {
|
|
4056
|
+
key: _,
|
|
4057
|
+
class: pe(["preset-item", { active: s.value === _ }]),
|
|
4058
|
+
onClick: (k) => R(_)
|
|
3848
4059
|
}, [
|
|
3849
|
-
|
|
3850
|
-
(
|
|
3851
|
-
key:
|
|
4060
|
+
y("div", ka, [
|
|
4061
|
+
(N(!0), Z(Ee, null, Ze(w.colors.slice(0, 5), (k, G) => (N(), Z("div", {
|
|
4062
|
+
key: G,
|
|
3852
4063
|
class: "preview-color-block",
|
|
3853
|
-
style:
|
|
4064
|
+
style: tt({ backgroundColor: k.color })
|
|
3854
4065
|
}, null, 4))), 128)),
|
|
3855
|
-
|
|
4066
|
+
w.colors.length > 5 ? (N(), Z("div", Ma, "+" + ce(w.colors.length - 5), 1)) : be("", !0)
|
|
3856
4067
|
]),
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
4068
|
+
y("div", Va, [
|
|
4069
|
+
y("div", Ba, [
|
|
4070
|
+
y("span", Da, ce(w.name), 1),
|
|
4071
|
+
w.isPreset ? (N(), Z("span", Na, "预置")) : be("", !0)
|
|
3861
4072
|
]),
|
|
3862
|
-
|
|
4073
|
+
y("span", Za, ce(w.colors.length) + "个颜色", 1)
|
|
3863
4074
|
]),
|
|
3864
|
-
|
|
4075
|
+
w.isPreset ? be("", !0) : (N(), Z("button", {
|
|
3865
4076
|
key: 0,
|
|
3866
4077
|
class: "btn-delete-preset",
|
|
3867
|
-
onClick: (
|
|
4078
|
+
onClick: (k) => C(_, k),
|
|
3868
4079
|
title: "删除色卡"
|
|
3869
|
-
},
|
|
3870
|
-
|
|
4080
|
+
}, I[3] || (I[3] = [
|
|
4081
|
+
y("svg", {
|
|
3871
4082
|
width: "14",
|
|
3872
4083
|
height: "14",
|
|
3873
4084
|
viewBox: "0 0 14 14",
|
|
3874
4085
|
fill: "currentColor"
|
|
3875
4086
|
}, [
|
|
3876
|
-
|
|
4087
|
+
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" })
|
|
3877
4088
|
], -1)
|
|
3878
|
-
]), 8,
|
|
3879
|
-
], 10,
|
|
3880
|
-
i.value.length === 0 ? (
|
|
4089
|
+
]), 8, Ga))
|
|
4090
|
+
], 10, _a))), 128)),
|
|
4091
|
+
i.value.length === 0 ? (N(), Z("div", Ya, ' 暂无保存的色卡,点击"保存色卡"创建 ')) : be("", !0)
|
|
3881
4092
|
])
|
|
3882
4093
|
]),
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
4094
|
+
y("div", Fa, [
|
|
4095
|
+
I[5] || (I[5] = y("span", { class: "section-title" }, "使用色卡", -1)),
|
|
4096
|
+
y("div", Pa, [
|
|
4097
|
+
y("button", {
|
|
3887
4098
|
class: "btn-add-color",
|
|
3888
|
-
onClick:
|
|
4099
|
+
onClick: b,
|
|
3889
4100
|
title: "添加颜色"
|
|
3890
|
-
},
|
|
3891
|
-
|
|
4101
|
+
}, I[4] || (I[4] = [
|
|
4102
|
+
y("svg", {
|
|
3892
4103
|
width: "16",
|
|
3893
4104
|
height: "16",
|
|
3894
4105
|
viewBox: "0 0 16 16",
|
|
3895
4106
|
fill: "currentColor"
|
|
3896
4107
|
}, [
|
|
3897
|
-
|
|
4108
|
+
y("path", { d: "M8 0a1 1 0 0 1 1 1v6h6a1 1 0 1 1 0 2H9v6a1 1 0 1 1-2 0V9H1a1 1 0 0 1 0-2h6V1a1 1 0 0 1 1-1z" })
|
|
3898
4109
|
], -1),
|
|
3899
|
-
|
|
4110
|
+
qe(" 添加颜色 ", -1)
|
|
3900
4111
|
])),
|
|
3901
|
-
|
|
4112
|
+
y("span", Xa, "共 " + ce(o.value.length) + " 个颜色", 1)
|
|
3902
4113
|
])
|
|
3903
4114
|
]),
|
|
3904
|
-
|
|
3905
|
-
(
|
|
4115
|
+
y("div", Wa, [
|
|
4116
|
+
(N(!0), Z(Ee, null, Ze(o.value, (w, _) => (N(), Z("div", {
|
|
3906
4117
|
class: "color-item",
|
|
3907
|
-
key:
|
|
4118
|
+
key: _
|
|
3908
4119
|
}, [
|
|
3909
|
-
|
|
3910
|
-
|
|
4120
|
+
y("div", za, ce(_ + 1), 1),
|
|
4121
|
+
y("div", {
|
|
3911
4122
|
class: "color-preview",
|
|
3912
|
-
style:
|
|
4123
|
+
style: tt({ backgroundColor: w.color })
|
|
3913
4124
|
}, null, 4),
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
4125
|
+
y("div", Ha, [
|
|
4126
|
+
I[6] || (I[6] = y("label", null, "数值:", -1)),
|
|
4127
|
+
ke(y("input", {
|
|
3917
4128
|
class: "color-set",
|
|
3918
4129
|
type: "number",
|
|
3919
|
-
"onUpdate:modelValue": (
|
|
4130
|
+
"onUpdate:modelValue": (k) => w.value = k,
|
|
3920
4131
|
step: "0.1"
|
|
3921
|
-
}, null, 8,
|
|
4132
|
+
}, null, 8, Ka), [
|
|
3922
4133
|
[
|
|
3923
|
-
|
|
3924
|
-
|
|
4134
|
+
et,
|
|
4135
|
+
w.value,
|
|
3925
4136
|
void 0,
|
|
3926
4137
|
{ number: !0 }
|
|
3927
4138
|
]
|
|
3928
4139
|
])
|
|
3929
4140
|
]),
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
4141
|
+
y("div", Oa, [
|
|
4142
|
+
I[7] || (I[7] = y("label", null, "颜色:", -1)),
|
|
4143
|
+
ke(y("input", {
|
|
3933
4144
|
class: "color-picker",
|
|
3934
4145
|
type: "color",
|
|
3935
|
-
"onUpdate:modelValue": (
|
|
3936
|
-
}, null, 8,
|
|
3937
|
-
[
|
|
4146
|
+
"onUpdate:modelValue": (k) => w.color = k
|
|
4147
|
+
}, null, 8, Ua), [
|
|
4148
|
+
[et, w.color]
|
|
3938
4149
|
])
|
|
3939
4150
|
]),
|
|
3940
|
-
|
|
4151
|
+
y("button", {
|
|
3941
4152
|
class: "btn-delete-color",
|
|
3942
|
-
onClick: (
|
|
4153
|
+
onClick: (k) => B(_, k),
|
|
3943
4154
|
title: "删除此颜色"
|
|
3944
|
-
},
|
|
3945
|
-
|
|
4155
|
+
}, I[8] || (I[8] = [
|
|
4156
|
+
y("svg", {
|
|
3946
4157
|
width: "16",
|
|
3947
4158
|
height: "16",
|
|
3948
4159
|
viewBox: "0 0 16 16",
|
|
3949
4160
|
fill: "currentColor"
|
|
3950
4161
|
}, [
|
|
3951
|
-
|
|
4162
|
+
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" })
|
|
3952
4163
|
], -1)
|
|
3953
|
-
]), 8,
|
|
4164
|
+
]), 8, Qa)
|
|
3954
4165
|
]))), 128))
|
|
3955
4166
|
])
|
|
3956
4167
|
]),
|
|
3957
|
-
|
|
3958
|
-
|
|
4168
|
+
y("div", { class: "dialog-footer" }, [
|
|
4169
|
+
y("button", {
|
|
3959
4170
|
class: "btn btn-cancel",
|
|
3960
|
-
onClick:
|
|
4171
|
+
onClick: M
|
|
3961
4172
|
}, "取消"),
|
|
3962
|
-
|
|
4173
|
+
y("button", {
|
|
3963
4174
|
class: "btn btn-confirm",
|
|
3964
|
-
onClick:
|
|
4175
|
+
onClick: L
|
|
3965
4176
|
}, "确认")
|
|
3966
4177
|
]),
|
|
3967
|
-
l.value ? (
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4178
|
+
l.value ? (N(), Z("div", ja, [
|
|
4179
|
+
y("div", Ja, [
|
|
4180
|
+
I[9] || (I[9] = y("h4", null, "保存色卡", -1)),
|
|
4181
|
+
ke(y("input", {
|
|
3971
4182
|
type: "text",
|
|
3972
|
-
"onUpdate:modelValue":
|
|
4183
|
+
"onUpdate:modelValue": I[0] || (I[0] = (w) => c.value = w),
|
|
3973
4184
|
placeholder: "请输入色卡名称",
|
|
3974
4185
|
class: "preset-name-input",
|
|
3975
4186
|
onKeyup: [
|
|
3976
|
-
|
|
3977
|
-
|
|
4187
|
+
Wt(x, ["enter"]),
|
|
4188
|
+
Wt(v, ["esc"])
|
|
3978
4189
|
],
|
|
3979
4190
|
autofocus: ""
|
|
3980
4191
|
}, null, 544), [
|
|
3981
|
-
[
|
|
4192
|
+
[et, c.value]
|
|
3982
4193
|
]),
|
|
3983
|
-
|
|
3984
|
-
|
|
4194
|
+
y("div", { class: "save-dialog-buttons" }, [
|
|
4195
|
+
y("button", {
|
|
3985
4196
|
class: "btn btn-small btn-cancel",
|
|
3986
|
-
onClick:
|
|
4197
|
+
onClick: v
|
|
3987
4198
|
}, "取消"),
|
|
3988
|
-
|
|
4199
|
+
y("button", {
|
|
3989
4200
|
class: "btn btn-small btn-confirm",
|
|
3990
4201
|
onClick: x
|
|
3991
4202
|
}, "保存")
|
|
3992
4203
|
])
|
|
3993
4204
|
])
|
|
3994
|
-
])) :
|
|
3995
|
-
|
|
3996
|
-
default:
|
|
3997
|
-
|
|
4205
|
+
])) : be("", !0),
|
|
4206
|
+
zt(Bn, { name: "toast" }, {
|
|
4207
|
+
default: Gr(() => [
|
|
4208
|
+
u.value ? (N(), Z("div", {
|
|
3998
4209
|
key: 0,
|
|
3999
|
-
class:
|
|
4000
|
-
},
|
|
4210
|
+
class: pe(["toast", "toast-" + d.value])
|
|
4211
|
+
}, ce(h.value), 3)) : be("", !0)
|
|
4001
4212
|
]),
|
|
4002
4213
|
_: 1
|
|
4003
4214
|
})
|
|
4004
4215
|
]));
|
|
4005
4216
|
}
|
|
4006
|
-
}),
|
|
4217
|
+
}), qa = /* @__PURE__ */ ut($a, [["__scopeId", "data-v-b42a8bd9"]]), ei = { class: "color-value" }, ti = /* @__PURE__ */ $e({
|
|
4007
4218
|
__name: "color-bar",
|
|
4008
4219
|
props: {
|
|
4009
4220
|
modelValue: { default: () => [] },
|
|
@@ -4011,7 +4222,7 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4011
4222
|
},
|
|
4012
4223
|
emits: ["update:modelValue"],
|
|
4013
4224
|
setup(r) {
|
|
4014
|
-
const e =
|
|
4225
|
+
const e = Dn(r, "modelValue"), t = Ge({
|
|
4015
4226
|
editColor: [],
|
|
4016
4227
|
isEdit: !1
|
|
4017
4228
|
});
|
|
@@ -4021,33 +4232,33 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4021
4232
|
function o(i) {
|
|
4022
4233
|
e.value = i, t.isEdit = !1, t.editColor = [];
|
|
4023
4234
|
}
|
|
4024
|
-
return (i, s) => (
|
|
4025
|
-
|
|
4235
|
+
return (i, s) => (N(), Z(Ee, null, [
|
|
4236
|
+
y("div", {
|
|
4026
4237
|
class: "colorRamp",
|
|
4027
4238
|
onClick: n
|
|
4028
4239
|
}, [
|
|
4029
|
-
(
|
|
4030
|
-
|
|
4240
|
+
(N(!0), Z(Ee, null, Ze(e.value, (l) => (N(), Z("div", null, [
|
|
4241
|
+
y("div", {
|
|
4031
4242
|
class: "color",
|
|
4032
|
-
style:
|
|
4243
|
+
style: tt({ backgroundColor: l.color })
|
|
4033
4244
|
}, [
|
|
4034
|
-
|
|
4245
|
+
y("div", ei, ce(l.value), 1)
|
|
4035
4246
|
], 4)
|
|
4036
4247
|
]))), 256))
|
|
4037
4248
|
]),
|
|
4038
|
-
t.isEdit ? (
|
|
4249
|
+
t.isEdit ? (N(), Yr(qa, {
|
|
4039
4250
|
key: 0,
|
|
4040
4251
|
"model-value": t.editColor,
|
|
4041
4252
|
onCancel: n,
|
|
4042
4253
|
onConfirm: o
|
|
4043
|
-
}, null, 8, ["model-value"])) :
|
|
4254
|
+
}, null, 8, ["model-value"])) : be("", !0)
|
|
4044
4255
|
], 64));
|
|
4045
4256
|
}
|
|
4046
|
-
}),
|
|
4257
|
+
}), ri = /* @__PURE__ */ ut(ti, [["__scopeId", "data-v-0e80ba0d"]]), ni = /* @__PURE__ */ $e({
|
|
4047
4258
|
__name: "render",
|
|
4048
4259
|
setup(r, { expose: e }) {
|
|
4049
|
-
const t =
|
|
4050
|
-
}), n =
|
|
4260
|
+
const t = Nt(() => {
|
|
4261
|
+
}), n = Ge({
|
|
4051
4262
|
colors: [
|
|
4052
4263
|
{ value: 0, color: "#0000" },
|
|
4053
4264
|
{ value: 2, color: "#b9f297" },
|
|
@@ -4086,24 +4297,24 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4086
4297
|
function s() {
|
|
4087
4298
|
o && (o.colorRamp = n.colors);
|
|
4088
4299
|
}
|
|
4089
|
-
return
|
|
4300
|
+
return Bt(() => o == null ? void 0 : o.destroy()), e({ renderWeg: i }), (l, c) => (N(), Yr(ri, {
|
|
4090
4301
|
modelValue: n.colors,
|
|
4091
4302
|
"onUpdate:modelValue": [
|
|
4092
|
-
|
|
4303
|
+
c[0] || (c[0] = (u) => n.colors = u),
|
|
4093
4304
|
s
|
|
4094
4305
|
]
|
|
4095
4306
|
}, null, 8, ["modelValue"]));
|
|
4096
4307
|
}
|
|
4097
|
-
}),
|
|
4308
|
+
}), oi = ["title"], ai = {
|
|
4098
4309
|
key: 0,
|
|
4099
4310
|
class: "attribute-panel"
|
|
4100
|
-
},
|
|
4311
|
+
}, ii = { class: "panel-header" }, si = { class: "file-info" }, li = { class: "attribute-table" }, ci = { class: "field-name" }, ui = {
|
|
4101
4312
|
key: 0,
|
|
4102
4313
|
class: "edit-cell"
|
|
4103
|
-
},
|
|
4314
|
+
}, di = ["type", "onUpdate:modelValue", "onBlur", "onKeypress"], hi = ["onClick"], fi = { class: "type-cell" }, pi = { class: "status-cell" }, mi = { class: "action-cell" }, vi = ["onClick"], yi = ["onClick"], gi = { class: "add-field-section" }, bi = { class: "add-field-form" }, Ii = { class: "export-section" }, Ci = { class: "export-form" }, xi = {
|
|
4104
4315
|
__name: "tool",
|
|
4105
4316
|
setup(r) {
|
|
4106
|
-
const e =
|
|
4317
|
+
const e = Ge({
|
|
4107
4318
|
baseInfo: null,
|
|
4108
4319
|
attributes: {
|
|
4109
4320
|
dtype: null,
|
|
@@ -4119,71 +4330,71 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4119
4330
|
addType: "number",
|
|
4120
4331
|
fileName: ""
|
|
4121
4332
|
});
|
|
4122
|
-
let t =
|
|
4333
|
+
let t = Ge({
|
|
4123
4334
|
wegFile: null,
|
|
4124
4335
|
data: null,
|
|
4125
4336
|
directionData: null
|
|
4126
4337
|
});
|
|
4127
|
-
const n =
|
|
4338
|
+
const n = le(null), o = le(!1), i = le(!1);
|
|
4128
4339
|
function s() {
|
|
4129
4340
|
o.value = !o.value;
|
|
4130
4341
|
}
|
|
4131
4342
|
function l() {
|
|
4132
|
-
var
|
|
4133
|
-
const
|
|
4134
|
-
|
|
4343
|
+
var b;
|
|
4344
|
+
const C = (b = window.present) == null ? void 0 : b.wegCache;
|
|
4345
|
+
C && confirm("已存在缓存文件,是否加载?") && p(C);
|
|
4135
4346
|
}
|
|
4136
|
-
async function
|
|
4137
|
-
let
|
|
4138
|
-
p(
|
|
4347
|
+
async function c(C) {
|
|
4348
|
+
let b = await C.target.files[0].arrayBuffer(), B = await vr(b);
|
|
4349
|
+
p(B);
|
|
4139
4350
|
}
|
|
4140
|
-
async function
|
|
4141
|
-
var
|
|
4142
|
-
|
|
4143
|
-
const
|
|
4144
|
-
if (!
|
|
4145
|
-
const
|
|
4146
|
-
if (!
|
|
4351
|
+
async function u(C) {
|
|
4352
|
+
var L;
|
|
4353
|
+
C.preventDefault(), C.stopPropagation(), i.value = !1;
|
|
4354
|
+
const b = (L = C.dataTransfer) == null ? void 0 : L.files;
|
|
4355
|
+
if (!b || b.length === 0) return;
|
|
4356
|
+
const B = b[0];
|
|
4357
|
+
if (!B.name.endsWith(".weg") && !B.name.endsWith(".weg.gz")) {
|
|
4147
4358
|
alert("仅支持 .weg 和 .weg.gz 格式的文件");
|
|
4148
4359
|
return;
|
|
4149
4360
|
}
|
|
4150
4361
|
try {
|
|
4151
|
-
let
|
|
4152
|
-
p(
|
|
4153
|
-
} catch (
|
|
4154
|
-
console.error("文件解析失败:",
|
|
4362
|
+
let M = await B.arrayBuffer(), T = await vr(M);
|
|
4363
|
+
p(T);
|
|
4364
|
+
} catch (M) {
|
|
4365
|
+
console.error("文件解析失败:", M), alert("文件解析失败,请确认文件格式正确");
|
|
4155
4366
|
}
|
|
4156
4367
|
}
|
|
4157
|
-
function h(
|
|
4158
|
-
|
|
4368
|
+
function h(C) {
|
|
4369
|
+
C.preventDefault(), C.stopPropagation(), i.value = !0;
|
|
4159
4370
|
}
|
|
4160
|
-
function d(
|
|
4161
|
-
|
|
4371
|
+
function d(C) {
|
|
4372
|
+
C.preventDefault(), C.stopPropagation(), i.value = !1;
|
|
4162
4373
|
}
|
|
4163
|
-
function p(
|
|
4164
|
-
var
|
|
4165
|
-
(
|
|
4166
|
-
const
|
|
4167
|
-
for (const
|
|
4168
|
-
|
|
4169
|
-
value:
|
|
4374
|
+
function p(C) {
|
|
4375
|
+
var L;
|
|
4376
|
+
(L = n == null ? void 0 : n.value) == null || L.renderWeg(C);
|
|
4377
|
+
const b = C.data, B = C.directionData;
|
|
4378
|
+
for (const M in e.attributes)
|
|
4379
|
+
M !== "block" && (e.attributes[M] = {
|
|
4380
|
+
value: C[M],
|
|
4170
4381
|
status: "初始值",
|
|
4171
4382
|
modify: !1,
|
|
4172
|
-
type: typeof
|
|
4383
|
+
type: typeof C[M] == "number" ? "number" : "text"
|
|
4173
4384
|
});
|
|
4174
|
-
for (const
|
|
4175
|
-
|
|
4176
|
-
value:
|
|
4385
|
+
for (const M in C)
|
|
4386
|
+
M !== "block" && (e.attributes[M] = {
|
|
4387
|
+
value: C[M],
|
|
4177
4388
|
status: "初始值",
|
|
4178
4389
|
modify: !1,
|
|
4179
|
-
type: typeof
|
|
4390
|
+
type: typeof C[M] == "number" ? "number" : "text"
|
|
4180
4391
|
});
|
|
4181
|
-
e.loaded = !0, t.wegFile =
|
|
4392
|
+
e.loaded = !0, t.wegFile = C, t.data = b, t.directionData = B ?? null;
|
|
4182
4393
|
}
|
|
4183
|
-
function f(
|
|
4184
|
-
|
|
4394
|
+
function f(C, b) {
|
|
4395
|
+
C.modify = !1, C.value != t.wegFile[b] && (C.status = "已修改");
|
|
4185
4396
|
}
|
|
4186
|
-
function
|
|
4397
|
+
function m() {
|
|
4187
4398
|
e.addName && (e.attributes[e.addName] = {
|
|
4188
4399
|
value: "",
|
|
4189
4400
|
status: "初始值",
|
|
@@ -4191,8 +4402,8 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4191
4402
|
type: e.addType
|
|
4192
4403
|
});
|
|
4193
4404
|
}
|
|
4194
|
-
function
|
|
4195
|
-
switch (
|
|
4405
|
+
function v(C) {
|
|
4406
|
+
switch (C) {
|
|
4196
4407
|
case "已修改":
|
|
4197
4408
|
return "attribute-change";
|
|
4198
4409
|
case "已删除":
|
|
@@ -4201,147 +4412,147 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4201
4412
|
return "";
|
|
4202
4413
|
}
|
|
4203
4414
|
}
|
|
4204
|
-
function x(
|
|
4205
|
-
|
|
4415
|
+
function x(C, b) {
|
|
4416
|
+
C.value = t.wegFile[b] ?? "", C.type = typeof C.value == "string" ? "text" : "number", C.status = "初始值";
|
|
4206
4417
|
}
|
|
4207
|
-
async function
|
|
4208
|
-
const { data:
|
|
4209
|
-
for (const
|
|
4210
|
-
const
|
|
4211
|
-
|
|
4418
|
+
async function R() {
|
|
4419
|
+
const { data: C, directionData: b } = t, B = {};
|
|
4420
|
+
for (const D in e.attributes) {
|
|
4421
|
+
const Q = e.attributes[D];
|
|
4422
|
+
Q.status !== "已删除" && (B[D] = Q.value);
|
|
4212
4423
|
}
|
|
4213
|
-
const
|
|
4214
|
-
let
|
|
4215
|
-
|
|
4216
|
-
const
|
|
4217
|
-
|
|
4424
|
+
const L = JSON.stringify(B), T = new TextEncoder().encode(L).buffer, I = new Int32Array([T.byteLength]), w = C.buffer;
|
|
4425
|
+
let _;
|
|
4426
|
+
b ? _ = new Blob([I, T, w, b], { type: "application/octet-stream" }) : _ = new Blob([I, T, w], { type: "application/octet-stream" });
|
|
4427
|
+
const k = await Wn(_), G = URL.createObjectURL(k), F = document.createElement("a");
|
|
4428
|
+
F.href = G, F.download = (e.fileName ? e.fileName : "rebuild") + ".weg.gz", F.click(), URL.revokeObjectURL(G), alert("导出成功");
|
|
4218
4429
|
}
|
|
4219
|
-
return (
|
|
4220
|
-
var
|
|
4221
|
-
return
|
|
4222
|
-
|
|
4223
|
-
default:
|
|
4224
|
-
|
|
4430
|
+
return (C, b) => {
|
|
4431
|
+
var B;
|
|
4432
|
+
return N(), Z(Ee, null, [
|
|
4433
|
+
zt(Rn, { onLoad: l }, {
|
|
4434
|
+
default: Gr(() => [
|
|
4435
|
+
zt(ni, {
|
|
4225
4436
|
ref_key: "render",
|
|
4226
4437
|
ref: n
|
|
4227
4438
|
}, null, 512)
|
|
4228
4439
|
]),
|
|
4229
4440
|
_: 1
|
|
4230
4441
|
}),
|
|
4231
|
-
|
|
4232
|
-
class:
|
|
4442
|
+
y("div", {
|
|
4443
|
+
class: pe(["tool-container", { collapsed: o.value }])
|
|
4233
4444
|
}, [
|
|
4234
|
-
|
|
4445
|
+
y("button", {
|
|
4235
4446
|
class: "collapse-btn",
|
|
4236
4447
|
onClick: s,
|
|
4237
4448
|
title: o.value ? "展开" : "折叠"
|
|
4238
4449
|
}, [
|
|
4239
|
-
(
|
|
4450
|
+
(N(), Z("svg", {
|
|
4240
4451
|
width: "20",
|
|
4241
4452
|
height: "20",
|
|
4242
4453
|
viewBox: "0 0 24 24",
|
|
4243
4454
|
fill: "none",
|
|
4244
4455
|
stroke: "currentColor",
|
|
4245
4456
|
"stroke-width": "2",
|
|
4246
|
-
class:
|
|
4247
|
-
},
|
|
4248
|
-
|
|
4457
|
+
class: pe({ rotated: o.value })
|
|
4458
|
+
}, b[3] || (b[3] = [
|
|
4459
|
+
y("polyline", { points: "15 18 9 12 15 6" }, null, -1)
|
|
4249
4460
|
]), 2))
|
|
4250
|
-
], 8,
|
|
4251
|
-
|
|
4252
|
-
|
|
4461
|
+
], 8, oi),
|
|
4462
|
+
b[15] || (b[15] = y("div", { class: "tool-header" }, [
|
|
4463
|
+
y("h2", null, "WEG 文件工具")
|
|
4253
4464
|
], -1)),
|
|
4254
|
-
|
|
4255
|
-
class:
|
|
4256
|
-
onDrop:
|
|
4465
|
+
y("div", {
|
|
4466
|
+
class: pe(["file-upload-area", { "drag-over": i.value }]),
|
|
4467
|
+
onDrop: u,
|
|
4257
4468
|
onDragover: h,
|
|
4258
4469
|
onDragleave: d
|
|
4259
4470
|
}, [
|
|
4260
|
-
|
|
4471
|
+
y("input", {
|
|
4261
4472
|
type: "file",
|
|
4262
|
-
onInput:
|
|
4473
|
+
onInput: c,
|
|
4263
4474
|
id: "file-input",
|
|
4264
4475
|
class: "file-input",
|
|
4265
4476
|
accept: ".weg,.weg.gz"
|
|
4266
4477
|
}, null, 32),
|
|
4267
|
-
|
|
4478
|
+
b[4] || (b[4] = Nn('<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))
|
|
4268
4479
|
], 34),
|
|
4269
|
-
e.loaded ? (
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4480
|
+
e.loaded ? (N(), Z("div", ai, [
|
|
4481
|
+
y("div", ii, [
|
|
4482
|
+
b[5] || (b[5] = y("h3", null, "文件属性", -1)),
|
|
4483
|
+
y("span", si, ce(((B = Xt(t).wegFile) == null ? void 0 : B.filename) || "未命名"), 1)
|
|
4273
4484
|
]),
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4485
|
+
y("table", li, [
|
|
4486
|
+
b[9] || (b[9] = y("thead", null, [
|
|
4487
|
+
y("tr", null, [
|
|
4488
|
+
y("th", { width: "20%" }, "字段"),
|
|
4489
|
+
y("th", { width: "30%" }, "值"),
|
|
4490
|
+
y("th", { width: "15%" }, "类型"),
|
|
4491
|
+
y("th", { width: "15%" }, "状态"),
|
|
4492
|
+
y("th", { width: "20%" }, "操作")
|
|
4282
4493
|
])
|
|
4283
4494
|
], -1)),
|
|
4284
|
-
|
|
4285
|
-
(
|
|
4286
|
-
class:
|
|
4495
|
+
y("tbody", null, [
|
|
4496
|
+
(N(!0), Z(Ee, null, Ze(e.attributes, (L, M) => (N(), Z("tr", {
|
|
4497
|
+
class: pe(v(L.status))
|
|
4287
4498
|
}, [
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
type:
|
|
4293
|
-
"onUpdate:modelValue": (
|
|
4294
|
-
onBlur: (
|
|
4295
|
-
onKeypress:
|
|
4296
|
-
class:
|
|
4297
|
-
}, null, 42,
|
|
4499
|
+
y("td", ci, ce(M), 1),
|
|
4500
|
+
y("td", null, [
|
|
4501
|
+
L.modify ? (N(), Z("div", ui, [
|
|
4502
|
+
ke(y("input", {
|
|
4503
|
+
type: L.type === "text" ? "text" : "number",
|
|
4504
|
+
"onUpdate:modelValue": (T) => L.value = T,
|
|
4505
|
+
onBlur: (T) => f(L, M),
|
|
4506
|
+
onKeypress: Wt((T) => f(L, M), ["enter"]),
|
|
4507
|
+
class: pe(["edit-input", L.type === "text" ? "text-input" : "number-input"])
|
|
4508
|
+
}, null, 42, di), [
|
|
4298
4509
|
[
|
|
4299
|
-
|
|
4300
|
-
|
|
4510
|
+
Zn,
|
|
4511
|
+
L.value,
|
|
4301
4512
|
void 0,
|
|
4302
4513
|
{ trim: !0 }
|
|
4303
4514
|
]
|
|
4304
4515
|
])
|
|
4305
|
-
])) : (
|
|
4516
|
+
])) : (N(), Z("div", {
|
|
4306
4517
|
key: 1,
|
|
4307
4518
|
class: "value-cell",
|
|
4308
|
-
onClick: (
|
|
4519
|
+
onClick: (T) => L.modify = !0
|
|
4309
4520
|
}, [
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
], 8,
|
|
4521
|
+
qe(ce(L.value) + " ", 1),
|
|
4522
|
+
b[6] || (b[6] = y("span", { class: "edit-icon" }, "✏️", -1))
|
|
4523
|
+
], 8, hi))
|
|
4313
4524
|
]),
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
class:
|
|
4317
|
-
},
|
|
4525
|
+
y("td", fi, [
|
|
4526
|
+
y("span", {
|
|
4527
|
+
class: pe(["type-badge", L.type === "text" ? "type-string" : "type-number"])
|
|
4528
|
+
}, ce(L.type === "text" ? "string" : "number"), 3)
|
|
4318
4529
|
]),
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
class:
|
|
4322
|
-
},
|
|
4530
|
+
y("td", pi, [
|
|
4531
|
+
y("span", {
|
|
4532
|
+
class: pe(["status-badge", "status-" + L.status.replace("已", "")])
|
|
4533
|
+
}, ce(L.status), 3)
|
|
4323
4534
|
]),
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
onClick: (
|
|
4535
|
+
y("td", mi, [
|
|
4536
|
+
y("button", {
|
|
4537
|
+
onClick: (T) => L.status = "已删除",
|
|
4327
4538
|
class: "btn btn-delete",
|
|
4328
4539
|
title: "删除"
|
|
4329
|
-
},
|
|
4330
|
-
|
|
4540
|
+
}, b[7] || (b[7] = [
|
|
4541
|
+
y("svg", {
|
|
4331
4542
|
width: "14",
|
|
4332
4543
|
height: "14",
|
|
4333
4544
|
viewBox: "0 0 14 14",
|
|
4334
4545
|
fill: "currentColor"
|
|
4335
4546
|
}, [
|
|
4336
|
-
|
|
4547
|
+
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" })
|
|
4337
4548
|
], -1)
|
|
4338
|
-
]), 8,
|
|
4339
|
-
|
|
4340
|
-
onClick: (
|
|
4549
|
+
]), 8, vi),
|
|
4550
|
+
y("button", {
|
|
4551
|
+
onClick: (T) => x(L, M),
|
|
4341
4552
|
class: "btn btn-reset",
|
|
4342
4553
|
title: "重置"
|
|
4343
|
-
},
|
|
4344
|
-
|
|
4554
|
+
}, b[8] || (b[8] = [
|
|
4555
|
+
y("svg", {
|
|
4345
4556
|
width: "14",
|
|
4346
4557
|
height: "14",
|
|
4347
4558
|
viewBox: "0 0 24 24",
|
|
@@ -4351,44 +4562,44 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4351
4562
|
"stroke-linecap": "round",
|
|
4352
4563
|
"stroke-linejoin": "round"
|
|
4353
4564
|
}, [
|
|
4354
|
-
|
|
4355
|
-
|
|
4565
|
+
y("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
4566
|
+
y("path", { d: "M3 3v5h5" })
|
|
4356
4567
|
], -1)
|
|
4357
|
-
]), 8,
|
|
4568
|
+
]), 8, yi)
|
|
4358
4569
|
])
|
|
4359
4570
|
], 2))), 256))
|
|
4360
4571
|
])
|
|
4361
4572
|
]),
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
"onUpdate:modelValue":
|
|
4573
|
+
y("div", gi, [
|
|
4574
|
+
b[12] || (b[12] = y("h4", null, "添加新字段", -1)),
|
|
4575
|
+
y("div", bi, [
|
|
4576
|
+
ke(y("select", {
|
|
4577
|
+
"onUpdate:modelValue": b[0] || (b[0] = (L) => e.addType = L),
|
|
4367
4578
|
class: "type-select"
|
|
4368
|
-
},
|
|
4369
|
-
|
|
4370
|
-
|
|
4579
|
+
}, b[10] || (b[10] = [
|
|
4580
|
+
y("option", { value: "number" }, "数值型 (number)", -1),
|
|
4581
|
+
y("option", { value: "text" }, "文本型 (string)", -1)
|
|
4371
4582
|
]), 512), [
|
|
4372
|
-
[
|
|
4583
|
+
[Gn, e.addType]
|
|
4373
4584
|
]),
|
|
4374
|
-
|
|
4585
|
+
ke(y("input", {
|
|
4375
4586
|
type: "text",
|
|
4376
|
-
"onUpdate:modelValue":
|
|
4587
|
+
"onUpdate:modelValue": b[1] || (b[1] = (L) => e.addName = L),
|
|
4377
4588
|
placeholder: "请输入字段名称",
|
|
4378
4589
|
class: "field-name-input"
|
|
4379
4590
|
}, null, 512), [
|
|
4380
4591
|
[
|
|
4381
|
-
|
|
4592
|
+
et,
|
|
4382
4593
|
e.addName,
|
|
4383
4594
|
void 0,
|
|
4384
4595
|
{ trim: !0 }
|
|
4385
4596
|
]
|
|
4386
4597
|
]),
|
|
4387
|
-
|
|
4388
|
-
onClick:
|
|
4598
|
+
y("button", {
|
|
4599
|
+
onClick: m,
|
|
4389
4600
|
class: "btn btn-add"
|
|
4390
|
-
},
|
|
4391
|
-
|
|
4601
|
+
}, b[11] || (b[11] = [
|
|
4602
|
+
y("svg", {
|
|
4392
4603
|
width: "16",
|
|
4393
4604
|
height: "16",
|
|
4394
4605
|
viewBox: "0 0 24 24",
|
|
@@ -4398,44 +4609,44 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4398
4609
|
"stroke-linecap": "round",
|
|
4399
4610
|
"stroke-linejoin": "round"
|
|
4400
4611
|
}, [
|
|
4401
|
-
|
|
4612
|
+
y("line", {
|
|
4402
4613
|
x1: "12",
|
|
4403
4614
|
y1: "5",
|
|
4404
4615
|
x2: "12",
|
|
4405
4616
|
y2: "19"
|
|
4406
4617
|
}),
|
|
4407
|
-
|
|
4618
|
+
y("line", {
|
|
4408
4619
|
x1: "5",
|
|
4409
4620
|
y1: "12",
|
|
4410
4621
|
x2: "19",
|
|
4411
4622
|
y2: "12"
|
|
4412
4623
|
})
|
|
4413
4624
|
], -1),
|
|
4414
|
-
|
|
4625
|
+
qe(" 添加字段 ", -1)
|
|
4415
4626
|
]))
|
|
4416
4627
|
])
|
|
4417
4628
|
]),
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4629
|
+
y("div", Ii, [
|
|
4630
|
+
b[14] || (b[14] = y("h4", null, "导出文件", -1)),
|
|
4631
|
+
y("div", Ci, [
|
|
4632
|
+
ke(y("input", {
|
|
4422
4633
|
type: "text",
|
|
4423
|
-
"onUpdate:modelValue":
|
|
4634
|
+
"onUpdate:modelValue": b[2] || (b[2] = (L) => e.fileName = L),
|
|
4424
4635
|
placeholder: "文件名(不包含扩展名)",
|
|
4425
4636
|
class: "filename-input"
|
|
4426
4637
|
}, null, 512), [
|
|
4427
4638
|
[
|
|
4428
|
-
|
|
4639
|
+
et,
|
|
4429
4640
|
e.fileName,
|
|
4430
4641
|
void 0,
|
|
4431
4642
|
{ trim: !0 }
|
|
4432
4643
|
]
|
|
4433
4644
|
]),
|
|
4434
|
-
|
|
4435
|
-
onClick:
|
|
4645
|
+
y("button", {
|
|
4646
|
+
onClick: R,
|
|
4436
4647
|
class: "btn btn-export"
|
|
4437
|
-
},
|
|
4438
|
-
|
|
4648
|
+
}, b[13] || (b[13] = [
|
|
4649
|
+
y("svg", {
|
|
4439
4650
|
width: "16",
|
|
4440
4651
|
height: "16",
|
|
4441
4652
|
viewBox: "0 0 24 24",
|
|
@@ -4445,25 +4656,25 @@ const na = ["data-bluestar-bubble-id"], oa = /* @__PURE__ */ ot({
|
|
|
4445
4656
|
"stroke-linecap": "round",
|
|
4446
4657
|
"stroke-linejoin": "round"
|
|
4447
4658
|
}, [
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4659
|
+
y("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
4660
|
+
y("polyline", { points: "7 10 12 15 17 10" }),
|
|
4661
|
+
y("line", {
|
|
4451
4662
|
x1: "12",
|
|
4452
4663
|
y1: "15",
|
|
4453
4664
|
x2: "12",
|
|
4454
4665
|
y2: "3"
|
|
4455
4666
|
})
|
|
4456
4667
|
], -1),
|
|
4457
|
-
|
|
4668
|
+
qe(" 重新导出 ", -1)
|
|
4458
4669
|
]))
|
|
4459
4670
|
])
|
|
4460
4671
|
])
|
|
4461
|
-
])) :
|
|
4672
|
+
])) : be("", !0)
|
|
4462
4673
|
], 2)
|
|
4463
4674
|
], 64);
|
|
4464
4675
|
};
|
|
4465
4676
|
}
|
|
4466
|
-
},
|
|
4677
|
+
}, Ei = /* @__PURE__ */ ut(xi, [["__scopeId", "data-v-19a6b16d"]]), ki = Ei, Mi = ya, Vi = ga, Bi = xa, Di = Rn, Ai = `#version 300 es\r
|
|
4467
4678
|
\r
|
|
4468
4679
|
precision mediump float;\r
|
|
4469
4680
|
\r
|
|
@@ -4475,23 +4686,23 @@ void main() {\r
|
|
|
4475
4686
|
v_uv = a_uv;\r
|
|
4476
4687
|
gl_Position = vec4(a_position, 0.0f, 1.0f);\r
|
|
4477
4688
|
}`;
|
|
4478
|
-
var
|
|
4479
|
-
const
|
|
4689
|
+
var we, xe, U, Ne, ct;
|
|
4690
|
+
const Pe = class Pe {
|
|
4480
4691
|
constructor(e, t) {
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4692
|
+
A(this, we);
|
|
4693
|
+
A(this, xe);
|
|
4694
|
+
A(this, U);
|
|
4695
|
+
A(this, Ne);
|
|
4696
|
+
A(this, ct);
|
|
4697
|
+
E(this, U, Object.assign({}, t)), this.addProtocol(), E(this, ct, `${a(this, U).name}://{z}/{x}/{y}`), E(this, xe, new zn({ gl: e.map.painter.context.gl })), E(this, Ne, a(this, xe).gl.createTexture()), this.initWebGLTool(), E(this, we, e.map), a(this, we).addSource(`${t.name}__source`, {
|
|
4487
4698
|
type: "raster",
|
|
4488
4699
|
tiles: [
|
|
4489
|
-
a(this,
|
|
4700
|
+
a(this, ct)
|
|
4490
4701
|
],
|
|
4491
4702
|
tileSize: 256,
|
|
4492
4703
|
minzoom: 0,
|
|
4493
4704
|
maxzoom: 18
|
|
4494
|
-
}), a(this,
|
|
4705
|
+
}), a(this, we).addLayer({
|
|
4495
4706
|
id: `${t.name}__layer`,
|
|
4496
4707
|
type: "raster",
|
|
4497
4708
|
source: `${t.name}__source`,
|
|
@@ -4501,9 +4712,9 @@ const Ze = class Ze {
|
|
|
4501
4712
|
});
|
|
4502
4713
|
}
|
|
4503
4714
|
addProtocol() {
|
|
4504
|
-
if (!a(this,
|
|
4505
|
-
if (
|
|
4506
|
-
|
|
4715
|
+
if (!a(this, U).name) throw new Error("TileLayerRender: name is required");
|
|
4716
|
+
if (Pe.protocalRegister.has(a(this, U).name)) throw new Error(`TileLayerRender: ${a(this, U).name} is already registered`);
|
|
4717
|
+
Fn(a(this, U).name, async (e, t) => {
|
|
4507
4718
|
t.signal.addEventListener("abort", () => {
|
|
4508
4719
|
});
|
|
4509
4720
|
const n = e.url.match(/(\d+)\/(\d+)\/(\d+)$/);
|
|
@@ -4515,10 +4726,10 @@ const Ze = class Ze {
|
|
|
4515
4726
|
cacheControl: "public, max-age=2592000",
|
|
4516
4727
|
expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1e3).toUTCString()
|
|
4517
4728
|
};
|
|
4518
|
-
}),
|
|
4729
|
+
}), Pe.protocalRegister.add(a(this, U).name);
|
|
4519
4730
|
}
|
|
4520
|
-
initWebGLTool(e = a(this,
|
|
4521
|
-
e.createFrameBuffer("tileFrameBuffer", 256, 256), e.createProgram("tile",
|
|
4731
|
+
initWebGLTool(e = a(this, xe)) {
|
|
4732
|
+
e.createFrameBuffer("tileFrameBuffer", 256, 256), e.createProgram("tile", Ai, a(this, U).fragmentShader), e.createProgramVertexArray("tile"), e.bindProgramVertexArray("tile");
|
|
4522
4733
|
const t = e.setProgramAttribute({
|
|
4523
4734
|
programName: "tile",
|
|
4524
4735
|
name: "a_position",
|
|
@@ -4557,7 +4768,7 @@ const Ze = class Ze {
|
|
|
4557
4768
|
}), e.bindProgramVertexArray("tile", null);
|
|
4558
4769
|
}
|
|
4559
4770
|
destroy() {
|
|
4560
|
-
|
|
4771
|
+
Pn(a(this, U).name), a(this, xe).destroy(), a(this, xe).gl.deleteTexture(a(this, Ne)), 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`);
|
|
4561
4772
|
}
|
|
4562
4773
|
/** 从 tianditu CDN 加载原始瓦片图片 */
|
|
4563
4774
|
loadTile(e, t, n) {
|
|
@@ -4565,42 +4776,43 @@ const Ze = class Ze {
|
|
|
4565
4776
|
const s = new Image();
|
|
4566
4777
|
s.onload = () => o(s), s.onerror = i, s.crossOrigin = "Anonymous";
|
|
4567
4778
|
const l = ~~(Math.random() * 7);
|
|
4568
|
-
s.src = a(this,
|
|
4779
|
+
s.src = a(this, U).tileURL.replace("{r}", l.toString()).replace("{z}", n.toString()).replace("{x}", e.toString()).replace("{y}", t.toString());
|
|
4569
4780
|
});
|
|
4570
4781
|
}
|
|
4571
4782
|
/** 使用 WebGL 着色器处理瓦片图片 */
|
|
4572
4783
|
async applyTileFilter(e) {
|
|
4573
|
-
const t = a(this,
|
|
4574
|
-
t.createTexture({ data: e, flipY: !1 }, a(this,
|
|
4784
|
+
const t = a(this, xe);
|
|
4785
|
+
t.createTexture({ data: e, flipY: !1 }, a(this, Ne)), t.setProgramUniform({
|
|
4575
4786
|
programName: "tile",
|
|
4576
4787
|
name: "u_texture",
|
|
4577
4788
|
type: "texture2D",
|
|
4578
|
-
value: a(this,
|
|
4789
|
+
value: a(this, Ne)
|
|
4579
4790
|
}), 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);
|
|
4580
4791
|
const n = new Uint8ClampedArray(256 * 256 * 4);
|
|
4581
4792
|
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));
|
|
4582
4793
|
}
|
|
4583
4794
|
};
|
|
4584
|
-
|
|
4585
|
-
let
|
|
4795
|
+
we = new WeakMap(), xe = new WeakMap(), U = new WeakMap(), Ne = new WeakMap(), ct = new WeakMap(), g(Pe, "protocalRegister", /* @__PURE__ */ new Set());
|
|
4796
|
+
let wr = Pe;
|
|
4586
4797
|
export {
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4798
|
+
pa as BlueStar,
|
|
4799
|
+
Mi as Bubble,
|
|
4800
|
+
Vi as BubbleManager,
|
|
4801
|
+
Bi as BubbleOverlay,
|
|
4802
|
+
ao as GridSource,
|
|
4803
|
+
Go as HeatmapLayer,
|
|
4804
|
+
fa as ImageRender,
|
|
4805
|
+
ia as IsolineLayer,
|
|
4806
|
+
Di as Map,
|
|
4807
|
+
ta as ParticleLayer,
|
|
4808
|
+
Rr as RGBWegFileToWegImage,
|
|
4809
|
+
Xo as TextLayer,
|
|
4810
|
+
lr as TileLayer,
|
|
4811
|
+
wr as TileLayerRender,
|
|
4812
|
+
ki as Tool,
|
|
4813
|
+
Qo as VectorLayer,
|
|
4814
|
+
da as WegRenderer,
|
|
4815
|
+
So as XMap,
|
|
4816
|
+
_i as mapController,
|
|
4817
|
+
Nt as onMapLoaded
|
|
4606
4818
|
};
|