@skzz/components-gis 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/assets/twinPreviewWorker-DvpSZYqE.js +3 -0
  2. package/dist/assets/twinTextureMipWorker-BWoFEUdX.js +3 -0
  3. package/dist/color-DVYdxZow.js +359 -0
  4. package/dist/esm-BXiGX6xE.js +86 -0
  5. package/dist/index.css +1 -1
  6. package/dist/index.d.ts +72 -6
  7. package/dist/index.es.js +1164 -9665
  8. package/dist/index.umd.js +209 -5
  9. package/dist/interpolation-Ctw2-y9G.js +211 -0
  10. package/dist/layerStack-CbiVJONn.js +181 -0
  11. package/dist/pako.esm-D6zcBi67.js +1455 -0
  12. package/dist/query-DgSNPfJM.js +239 -0
  13. package/dist/queryPoint-BOi_hkig.js +189 -0
  14. package/dist/tw2Parser-Dxs5xGvB.js +115 -0
  15. package/dist/zz-3dtiles-BzDYB-tW.js +75 -0
  16. package/dist/zz-gltf-BDHxqQjs.js +70 -0
  17. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsBounds.d.ts +19 -0
  18. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsCacheUtils.d.ts +53 -0
  19. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsGeometry.d.ts +27 -0
  20. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsGeometryWorker.d.ts +1 -0
  21. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsPreviewBudget.d.ts +78 -0
  22. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsRenderer.d.ts +281 -16
  23. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsViewState.d.ts +20 -0
  24. package/dist/zz-layer/zz-layer-zzts/zztsRasterCacheUtils.d.ts +35 -0
  25. package/dist/zz-layer/zz-layer-zzts/zztsRasterPreviewPolling.d.ts +10 -0
  26. package/dist/zz-layer/zz-layer-zzts3dv2/entityGridV2.d.ts +277 -0
  27. package/dist/zz-layer/zz-layer-zzts3dv2/index.vue.d.ts +1 -0
  28. package/dist/zz-layer/zz-layer-zzts3dv2/tw2Parser.d.ts +7 -0
  29. package/dist/zz-layer/zz-layer-zzts3dv2/twinAdaptiveMesh.d.ts +3 -0
  30. package/dist/zz-layer/zz-layer-zzts3dv2/twinCoarseLod.d.ts +4 -0
  31. package/dist/zz-layer/zz-layer-zzts3dv2/twinEnvironmentLighting.d.ts +16 -0
  32. package/dist/zz-layer/zz-layer-zzts3dv2/twinImagePixels.d.ts +6 -0
  33. package/dist/zz-layer/zz-layer-zzts3dv2/twinPagedIndex.d.ts +8 -0
  34. package/dist/zz-layer/zz-layer-zzts3dv2/twinParsePool.d.ts +10 -0
  35. package/dist/zz-layer/zz-layer-zzts3dv2/twinPreviewWorker.d.ts +1 -0
  36. package/dist/zz-layer/zz-layer-zzts3dv2/twinRegionalIndex.d.ts +23 -0
  37. package/dist/zz-layer/zz-layer-zzts3dv2/twinResourceBatch.d.ts +34 -0
  38. package/dist/zz-layer/zz-layer-zzts3dv2/twinTextureAppearance.d.ts +89 -0
  39. package/dist/zz-layer/zz-layer-zzts3dv2/twinTextureMipWorker.d.ts +1 -0
  40. package/dist/zz-layer/zz-layer-zzts3dv2/twinVisualRuntime.d.ts +107 -0
  41. package/dist/zz-layer-geojson-CtTpn_f9.js +867 -0
  42. package/dist/zz-layer-mvt-R1-GwSIW.js +609 -0
  43. package/dist/zz-layer-shp-zzts-Dr3Gxeba.js +1881 -0
  44. package/dist/zz-layer-zzts3d-CsIWse3P.js +835 -0
  45. package/dist/zz-layer-zzts3d-grid-CTHFZBpo.js +314 -0
  46. package/dist/zz-layer-zzts3d-las-D3w01aGe.js +561 -0
  47. package/dist/zz-layer-zzts3d-point-BjaTPTqj.js +752 -0
  48. package/dist/zz-layer-zzts3dtype-BRl3mCk9.js +493 -0
  49. package/dist/zz-layer-zzts3dv2-DFXCOaMe.js +4019 -0
  50. package/dist/zz-terrain-excavation-A2NXSQ5P.js +502 -0
  51. package/dist/zz-viewer/index.vue.d.ts +2 -2
  52. package/dist/zzts3dLayerSignature-DzrPeJTd.js +44 -0
  53. package/package.json +5 -4
@@ -0,0 +1,609 @@
1
+ import { a as e, r as t } from "./layerStack-CbiVJONn.js";
2
+ import { r as n } from "./zz-layer-geojson-CtTpn_f9.js";
3
+ import { computed as r, createBlock as i, createCommentVNode as a, inject as o, onMounted as s, onUnmounted as c, openBlock as l, ref as u, resolveComponent as d, watch as f } from "vue";
4
+ import { VectorTileset as p } from "@liumaorong/cesium-vectortile-gl-plus";
5
+ //#region src/utils/buildMvtWfsLabelUrl.ts
6
+ function m(e, t, n, r) {
7
+ let i = String(e || "").replace(/\/$/, ""), a = encodeURIComponent(String(t || "")), o = encodeURIComponent(String(n || ""));
8
+ return !i || !a || !o ? "" : `${i}/v1/wfs/layer/wfsInfo?dictCode=${a}&serviceName=${o}${r == null ? "" : `&_label=${r}`}`;
9
+ }
10
+ //#endregion
11
+ //#region src/zz-layer/zz-layer-mvt/index.vue
12
+ var h = "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf", g = {
13
+ __name: "index",
14
+ props: {
15
+ provider: {
16
+ type: Object,
17
+ default: () => ({})
18
+ },
19
+ options: {
20
+ type: Object,
21
+ default: () => ({})
22
+ },
23
+ stackIndex: {
24
+ type: Number,
25
+ default: -1
26
+ },
27
+ subStackIndex: {
28
+ type: Number,
29
+ default: 0
30
+ },
31
+ groupKey: {
32
+ type: String,
33
+ default: ""
34
+ }
35
+ },
36
+ emits: ["loaded"],
37
+ setup(g, { emit: _ }) {
38
+ let v = o("cesiumViewer"), y = u(null), b = u(!1), x = g, S = _, C = {
39
+ url: "",
40
+ layer: "",
41
+ sourceLayer: "",
42
+ minzoom: 1,
43
+ maxzoom: 14,
44
+ scheme: "xyz",
45
+ token: "",
46
+ workerUrl: "",
47
+ maximumActiveTasks: 4,
48
+ dictCode: "",
49
+ wfsBasePath: ""
50
+ }, w = {
51
+ styleByProperty: {},
52
+ fillColor: "#1968df",
53
+ fillOpacity: .85,
54
+ opacity: 1,
55
+ fillOutlineColor: "#47cf11",
56
+ lineColor: "#c30cbf",
57
+ lineWidth: 1,
58
+ visibility: "visible",
59
+ minzoom: "1",
60
+ maxzoom: "14",
61
+ glyphs: "",
62
+ note: {},
63
+ hiddenValues: [],
64
+ labelOverlay: {}
65
+ }, T = {
66
+ 微软雅黑: "Microsoft YaHei Regular",
67
+ "Microsoft YaHei": "Microsoft YaHei Regular",
68
+ 宋体: "SimSun Regular",
69
+ SimSun: "SimSun Regular",
70
+ 黑体: "SimHei Regular",
71
+ SimHei: "SimHei Regular",
72
+ 楷体: "KaiTi Regular",
73
+ KaiTi: "KaiTi Regular",
74
+ Arial: "Arial Regular",
75
+ "Times New Roman": "Times New Roman Regular"
76
+ }, E = (e) => {
77
+ let t = String(e || "").trim();
78
+ return T[t] || t || "Microsoft YaHei Regular";
79
+ }, D = (e, t = {}) => String(e.glyphs || t.glyphs || h).trim(), O = (e, t) => {
80
+ let n = [
81
+ "coalesce",
82
+ ["to-string", ["get", e]],
83
+ ""
84
+ ], r = t?.wrap === !0 || t?.wrap === "true" || t?.wrap === 1, i = Number(t?.maxChars);
85
+ if (!r || !Number.isFinite(i) || i <= 0) return n;
86
+ let a = [];
87
+ for (let e = 0; e < 80; e += i) e > 0 && a.push("\n"), a.push([
88
+ "slice",
89
+ n,
90
+ e,
91
+ e + i
92
+ ]);
93
+ return ["concat", ...a];
94
+ }, k = ["-", [
95
+ "coalesce",
96
+ ["to-number", ["get", "Shape_Area"]],
97
+ ["to-number", ["get", "shape_area"]],
98
+ ["to-number", ["get", "SHAPE_Area"]],
99
+ ["to-number", ["get", "AREA"]],
100
+ ["to-number", ["get", "area"]],
101
+ 0
102
+ ]], A = (e, t, n = {}, r = "default") => {
103
+ let i = r === "polygon";
104
+ return {
105
+ "text-field": O(e, t),
106
+ "text-size": Number(t.fontSize ?? 14),
107
+ "text-font": [E(t.fontFamily)],
108
+ "text-allow-overlap": !i,
109
+ "text-ignore-placement": !i,
110
+ "text-optional": !0,
111
+ "text-line-height": 1.15,
112
+ "text-anchor": "bottom",
113
+ "text-offset": [0, -.7],
114
+ "symbol-placement": "point",
115
+ ...i ? {
116
+ "symbol-sort-key": k,
117
+ "text-padding": 2
118
+ } : {},
119
+ ...n
120
+ };
121
+ }, j = (e) => String(e || "mvt").replace(/[^a-zA-Z0-9_-]/g, "_"), M = (e) => {
122
+ let t = Number(e);
123
+ return Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 1;
124
+ }, N = (e) => {
125
+ let t = `${j(e)}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
126
+ return {
127
+ source: `${t}-source`,
128
+ circle: `${t}-circle`,
129
+ line: `${t}-line`,
130
+ fill: `${t}-fill`,
131
+ label: `${t}-label`
132
+ };
133
+ }, P = r(() => ({
134
+ ...C,
135
+ ...x.provider
136
+ })), F = r(() => ({
137
+ ...w,
138
+ ...x.options
139
+ })), I = r(() => n(P.value)), L = r(() => JSON.stringify(F.value)), R = r(() => {
140
+ let e = P.value, t = F.value;
141
+ return !!(e.url && e.layer && e.sourceLayer && t.styleByProperty);
142
+ }), z = u(Date.now()), B = r(() => F.value.note || {}), V = (e = {}) => {
143
+ let t = e.colorList || {};
144
+ return t.point || t.line || t.polygon ? t : e.point || e.line || e.polygon ? e : t;
145
+ }, H = r(() => !!V(F.value.styleByProperty || {}).polygon), U = r(() => !!(typeof B.value.fieldName == "string" && B.value.fieldName.trim()) && H.value), W = r(() => {
146
+ let e = F.value.labelOverlay || {};
147
+ if (e.enabled === !1) return "";
148
+ if (e.wfsUrl) return String(e.wfsUrl);
149
+ let t = P.value, n = t.wfsBasePath || "";
150
+ return !t.dictCode || !t.layer || !n ? "" : m(n, t.dictCode, t.layer, z.value);
151
+ }), G = r(() => U.value && !!W.value), K = () => {
152
+ if (!U.value || G.value) return !1;
153
+ let e = P.value;
154
+ return e.dictCode && e.layer && !(e.wfsBasePath || F.value.labelOverlay?.wfsUrl) && console.warn("[zz-layer-mvt] 面注记缺少 dictCode/wfsBasePath,回退 MapLibre 落点"), !0;
155
+ }, q = (e) => {
156
+ if (e == null) return "";
157
+ let t = String(e).trim(), n = Number(t);
158
+ return !Number.isNaN(n) && t !== "" ? String(n) : t;
159
+ }, J = (e = {}) => {
160
+ if (e.point) {
161
+ let t = e.point || {};
162
+ return {
163
+ fill: t.fill || t.color || "#FF0000",
164
+ borderColor: t.stroke?.outlineColor || t.borderColor || "#FFFFFF",
165
+ borderWidth: Number(t.stroke?.outlineWidth ?? t.borderWidth ?? 1),
166
+ strokeVisible: t.stroke?.visible !== !1,
167
+ stroke: {
168
+ type: t.stroke?.type || "solid",
169
+ color: t.stroke?.color || t.color || t.fill || "#FF0000",
170
+ radius: Number(t.stroke.radius ?? 5),
171
+ outlineColor: t.stroke?.outlineColor || t.borderColor || "#FFFFFF",
172
+ outlineWidth: Number(t.stroke?.outlineWidth ?? t.borderWidth ?? 1),
173
+ dashLength: Number(t.stroke?.dashLength ?? 0),
174
+ gapLength: Number(t.stroke?.gapLength ?? 0),
175
+ borderColor: t.stroke?.borderColor || t.borderColor || "#FFFFFF",
176
+ borderWidth: Number(t.stroke?.borderWidth ?? t.borderWidth ?? 1)
177
+ }
178
+ };
179
+ } else if (e.line) {
180
+ let t = e.line || {};
181
+ return {
182
+ strokeVisible: t.stroke?.visible !== !1,
183
+ stroke: {
184
+ type: t.stroke?.type || t.type || "solid",
185
+ color: t.stroke?.color || t.color || "#FFFF00",
186
+ outlineColor: t.stroke?.outlineColor || t.outlineColor || "#FFFF00",
187
+ outlineWidth: Number(t.stroke?.outlineWidth ?? t.outlineWidth ?? t.width ?? 1),
188
+ dashLength: Number(t.stroke?.dashLength ?? t.dashLength ?? 0),
189
+ gapLength: Number(t.stroke?.gapLength ?? t.gapLength ?? 0),
190
+ borderColor: t.stroke?.borderColor || t.borderColor || "#000000",
191
+ borderWidth: Number(t.stroke?.borderWidth ?? t.borderWidth ?? 0)
192
+ }
193
+ };
194
+ } else if (e.polygon) {
195
+ let t = e.polygon || {};
196
+ return {
197
+ fill: t.fill || t.color || "rgba(255, 255, 0, 0.3)",
198
+ outlineColor: t.stroke?.outlineColor || t.outlineColor || "#FFFF00",
199
+ outlineWidth: Number(t.stroke?.outlineWidth ?? t.outlineWidth ?? 2),
200
+ strokeVisible: t.stroke?.visible !== !1,
201
+ stroke: {
202
+ type: t.stroke?.type || "solid",
203
+ color: t.stroke?.color || t.color || "#FFFF00",
204
+ outlineColor: t.stroke?.outlineColor || t.outlineColor || "#FFFF00",
205
+ outlineWidth: Number(t.stroke?.outlineWidth ?? t.outlineWidth ?? 2),
206
+ dashLength: Number(t.stroke?.dashLength ?? 0),
207
+ gapLength: Number(t.stroke?.gapLength ?? 0),
208
+ borderColor: t.stroke?.borderColor || t.outlineColor || "#FFFF00",
209
+ borderWidth: Number(t.stroke?.borderWidth ?? t.outlineWidth ?? 2)
210
+ }
211
+ };
212
+ }
213
+ }, Y = () => {
214
+ if (!R.value) return null;
215
+ let e = P.value, t = F.value, n = e.sourceLayer || e.layer, r = N(e.layer || n), i = e.url ? [e.url] : [], a = t.styleByProperty || {}, o = a.type || "", s = a.fieldName || "", c = Array.isArray(a.colorListArray) ? a.colorListArray : [], l = a.colorList || {}, u = l.point || l.line || l.polygon ? l : a.point || a.line || a.polygon ? a : l, d = t.note || {}, f = M(t.opacity);
216
+ console.log("[zz-layer-mvt] buildStyle", {
217
+ sourceLayer: n,
218
+ styleIds: r,
219
+ type: o,
220
+ fieldName: s,
221
+ colorCount: c.length,
222
+ firstColorItem: c[0] || null,
223
+ noteField: d.fieldName || "",
224
+ noteFontFamily: d.fontFamily || "",
225
+ noteGlyphs: t.glyphs || ""
226
+ });
227
+ let p = J(u);
228
+ if (!p) return console.warn("[zz-layer-mvt] colorList missing point/line/polygon style", u), null;
229
+ let m = typeof d.fieldName == "string" ? d.fieldName.trim() : "", h = !!m, g = h ? D(t, d) : "", _ = h ? A(m, d) : null, v = {
230
+ "text-color": d.fontColor || "#000",
231
+ "text-halo-color": "rgba(255,255,255,0.85)",
232
+ "text-halo-width": 1,
233
+ "text-opacity": f
234
+ }, y = () => {
235
+ let e = {
236
+ version: 8,
237
+ name: "MVT Layer"
238
+ };
239
+ return h && g && (e.glyphs = g), e;
240
+ }, b = new Set((Array.isArray(t.hiddenValues) ? t.hiddenValues : []).map(String)), x = "rgba(0,0,0,0)", S = a.strictClassifiedStyle === !0 && ["uniqueShp", "gradedColor"].includes(o), C = (e) => {
241
+ let t = q(e?.value);
242
+ return b.has(t) || b.has(String(e?.value ?? ""));
243
+ }, w = (e) => {
244
+ let t = `${e?.valueMin}..${e?.valueMax}`, n = `${Number(e?.valueMin)}..${Number(e?.valueMax)}`;
245
+ return b.has(t) || b.has(n);
246
+ }, T = (e) => b.has("__default__") ? x : e, E = (e) => S ? x : T(e), O = (e, t) => e.color || (S ? x : t), k = String(a?.colorType || "continuous") === "continuous", j = (e, t) => {
247
+ if (!k || e.length < 2 || e.some((e) => w(e))) return null;
248
+ let n = [
249
+ "interpolate",
250
+ ["linear"],
251
+ ["to-number", ["get", s]]
252
+ ], r = -Infinity, i = 0, a = (e, t) => {
253
+ !Number.isFinite(e) || e <= r || (n.push(e, t), r = e, i += 1);
254
+ };
255
+ for (let n of e) a(Number(n.valueMin), O(n, t));
256
+ let o = e[e.length - 1];
257
+ return a(Number(o.valueMax), O(o, t)), i >= 2 ? n : null;
258
+ }, I = (() => {
259
+ if (!u.point && !u.line && !u.polygon) return "#1968df";
260
+ if (u.point) {
261
+ if (o === "gradedColor") {
262
+ if (c.length === 0) return E(p.fill);
263
+ let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = j(e, p.fill);
264
+ if (t) return t;
265
+ let n = ["case"];
266
+ for (let t of e) {
267
+ let e = Number(t.valueMin), r = Number(t.valueMax), i = w(t) ? x : O(t, p.fill);
268
+ n.push([
269
+ "all",
270
+ [
271
+ ">=",
272
+ ["to-number", ["get", s]],
273
+ e
274
+ ],
275
+ [
276
+ "<",
277
+ ["to-number", ["get", s]],
278
+ r
279
+ ]
280
+ ], i);
281
+ }
282
+ return n.push(E(p.fill)), n;
283
+ }
284
+ if (o === "uniqueShp") {
285
+ if (c.length === 0) return E(p.fill);
286
+ let e = ["match", ["to-string", ["get", s]]];
287
+ for (let t of c) e.push(q(t.value), C(t) ? x : O(t, p.fill));
288
+ return e.push(E(p.fill)), e;
289
+ }
290
+ return p.fill;
291
+ }
292
+ if (u.line) {
293
+ if (o === "gradedColor") {
294
+ if (c.length === 0) return E(p.stroke.outlineColor);
295
+ let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = j(e, p.stroke.outlineColor);
296
+ if (t) return t;
297
+ let n = ["case"];
298
+ for (let t of e) {
299
+ let e = Number(t.valueMin), r = Number(t.valueMax), i = w(t) ? x : O(t, p.stroke.outlineColor);
300
+ n.push([
301
+ "all",
302
+ [
303
+ ">=",
304
+ ["to-number", ["get", s]],
305
+ e
306
+ ],
307
+ [
308
+ "<",
309
+ ["to-number", ["get", s]],
310
+ r
311
+ ]
312
+ ], i);
313
+ }
314
+ return n.push(E(p.stroke.outlineColor)), n;
315
+ }
316
+ if (o === "uniqueShp") {
317
+ if (c.length === 0) return E(p.stroke.outlineColor);
318
+ let e = ["match", ["to-string", ["get", s]]];
319
+ for (let t of c) e.push(q(t.value), C(t) ? x : O(t, p.stroke.outlineColor));
320
+ return e.push(E(p.stroke.outlineColor)), e;
321
+ }
322
+ return p.stroke.outlineColor;
323
+ }
324
+ if (u.polygon) {
325
+ if (o === "gradedColor") {
326
+ if (c.length === 0) return E(p.fill);
327
+ let e = [...c].filter((e) => e && e.valueMin !== void 0 && e.valueMax !== void 0).sort((e, t) => Number(e.valueMin) - Number(t.valueMin)), t = j(e, p.fill);
328
+ if (t) return t;
329
+ let n = ["case"];
330
+ for (let t of e) {
331
+ let e = Number(t.valueMin), r = Number(t.valueMax), i = w(t) ? x : O(t, p.fill);
332
+ n.push([
333
+ "all",
334
+ [
335
+ ">=",
336
+ ["to-number", ["get", s]],
337
+ e
338
+ ],
339
+ [
340
+ "<",
341
+ ["to-number", ["get", s]],
342
+ r
343
+ ]
344
+ ], i);
345
+ }
346
+ return n.push(E(p.fill)), n;
347
+ }
348
+ if (o === "uniqueShp") {
349
+ if (c.length === 0) return E(p.fill);
350
+ let e = ["match", ["to-string", ["get", s]]];
351
+ for (let t of c) e.push(q(t.value), C(t) ? x : O(t, p.fill));
352
+ return e.push(E(p.fill)), e;
353
+ }
354
+ return p.fill;
355
+ }
356
+ })(), L = S ? [
357
+ "case",
358
+ [
359
+ "==",
360
+ I,
361
+ x
362
+ ],
363
+ 0,
364
+ f
365
+ ] : f, z = S ? [
366
+ "case",
367
+ [
368
+ "==",
369
+ I,
370
+ x
371
+ ],
372
+ 0,
373
+ M(t.fillOpacity)
374
+ ] : M(t.fillOpacity), B = p?.strokeVisible !== !1, V = t.legendFilter || null, H = (e) => !V || !e ? e : {
375
+ ...e,
376
+ filter: V
377
+ }, U = S ? [
378
+ "case",
379
+ [
380
+ "==",
381
+ I,
382
+ x
383
+ ],
384
+ x,
385
+ p.stroke.outlineColor
386
+ ] : p.stroke.outlineColor;
387
+ if (u.point) return console.log("进入pointpointpoint"), {
388
+ ...y(),
389
+ sources: { [r.source]: {
390
+ type: "vector",
391
+ tiles: i,
392
+ minzoom: Number(t.minzoom ?? 1),
393
+ maxzoom: Number(t.maxzoom ?? 14),
394
+ scheme: e.scheme === "tms" ? "tms" : "xyz"
395
+ } },
396
+ layers: [H({
397
+ id: r.circle,
398
+ type: "circle",
399
+ source: r.source,
400
+ "source-layer": n,
401
+ layout: { visibility: t.visibility || "visible" },
402
+ paint: {
403
+ "circle-color": I,
404
+ "circle-radius": p.stroke.radius,
405
+ "circle-opacity": L,
406
+ "circle-stroke-color": B ? U : x,
407
+ "circle-stroke-opacity": B ? L : 0,
408
+ "circle-stroke-width": B ? p.stroke.outlineWidth : 0
409
+ }
410
+ }), ...h ? [H({
411
+ id: r.label,
412
+ type: "symbol",
413
+ source: r.source,
414
+ "source-layer": n,
415
+ layout: _,
416
+ paint: v
417
+ })] : []]
418
+ };
419
+ if (u.line) return console.log(t.minzoom, t.maxzoom, "option.maxzoomoption.maxzoom"), {
420
+ ...y(),
421
+ sources: { "mvt:source": {
422
+ type: "vector",
423
+ tiles: i,
424
+ minzoom: Number(t.minzoom ?? 1),
425
+ maxzoom: Number(t.maxzoom ?? 14),
426
+ scheme: e.scheme === "tms" ? "tms" : "xyz"
427
+ } },
428
+ layers: [H({
429
+ id: "mvt-line",
430
+ type: "line",
431
+ source: "mvt:source",
432
+ "source-layer": n,
433
+ layout: { visibility: t.visibility },
434
+ paint: {
435
+ "line-color": I,
436
+ "line-opacity": L,
437
+ "line-width": p.stroke.outlineWidth ?? t.lineWidth,
438
+ "line-dasharray": p.stroke.type === "dashed" ? [2, 2] : [1, 0]
439
+ }
440
+ }), ...h ? [H({
441
+ id: r.label,
442
+ type: "symbol",
443
+ source: "mvt:source",
444
+ "source-layer": n,
445
+ layout: A(m, d, { "text-offset": [0, -1.8] }),
446
+ paint: v
447
+ })] : []]
448
+ };
449
+ if (u.polygon) {
450
+ let r = B ? U : x;
451
+ return {
452
+ ...y(),
453
+ sources: { "mvt:source": {
454
+ type: "vector",
455
+ tiles: i,
456
+ minzoom: Number(t.minzoom ?? 1),
457
+ maxzoom: Number(t.maxzoom ?? 14),
458
+ scheme: e.scheme === "tms" ? "tms" : "xyz"
459
+ } },
460
+ layers: [
461
+ H({
462
+ id: "mvt-fill",
463
+ type: "fill",
464
+ source: "mvt:source",
465
+ "source-layer": n,
466
+ layout: { visibility: t.visibility },
467
+ paint: {
468
+ "fill-color": I,
469
+ "fill-opacity": z,
470
+ "fill-outline-color": r
471
+ }
472
+ }),
473
+ H({
474
+ id: "mvt-line",
475
+ type: "line",
476
+ source: "mvt:source",
477
+ "source-layer": n,
478
+ layout: { visibility: t.visibility },
479
+ paint: {
480
+ "line-color": r,
481
+ "line-opacity": B ? L : 0,
482
+ "line-width": B ? p.stroke.outlineWidth ?? t.lineWidth : 0,
483
+ "line-dasharray": p.stroke.type === "dashed" ? [2, 2] : [1, 0]
484
+ }
485
+ }),
486
+ ...K() ? [H({
487
+ id: "mvt-label",
488
+ type: "symbol",
489
+ source: "mvt:source",
490
+ "source-layer": n,
491
+ layout: A(m, d, { "text-offset": [0, -1.8] }, "polygon"),
492
+ paint: v
493
+ })] : []
494
+ ]
495
+ };
496
+ }
497
+ }, ee = () => {
498
+ let e = y.value;
499
+ S("loaded", e), (v?.value?.container || window)?.dispatchEvent(new CustomEvent("loaded", { detail: e }));
500
+ }, te = (e) => {
501
+ console.error("[zz-layer-mvt] vector tile error:", e), (v?.value?.container || window)?.dispatchEvent(new CustomEvent("error", { detail: e }));
502
+ }, X = () => {
503
+ try {
504
+ v?.value?.scene?.requestRender?.();
505
+ } catch (e) {
506
+ console.warn("[zz-layer-mvt] request render failed:", e);
507
+ }
508
+ }, Z = () => {
509
+ let e = v?.value;
510
+ if (e && y.value) {
511
+ try {
512
+ e.scene.primitives.remove(y.value);
513
+ } catch (e) {
514
+ console.warn("[zz-layer-mvt] remove tileset failed:", e);
515
+ }
516
+ try {
517
+ y.value.destroy?.();
518
+ } catch (e) {
519
+ console.warn("[zz-layer-mvt] destroy tileset failed:", e);
520
+ }
521
+ y.value = null, b.value = !1;
522
+ }
523
+ }, ne = async () => {
524
+ if (!v?.value) return;
525
+ let e = P.value;
526
+ if (!R.value || !e.url || !e.sourceLayer || !e.layer) {
527
+ Z();
528
+ return;
529
+ }
530
+ Z();
531
+ let n = Y();
532
+ if (!n) {
533
+ Z();
534
+ return;
535
+ }
536
+ let r = e.workerUrl || void 0;
537
+ try {
538
+ let i = new p({
539
+ style: n,
540
+ workerUrl: r,
541
+ maximumActiveTasks: Number(e.maximumActiveTasks ?? 4)
542
+ });
543
+ if (i.readyEvent?.addEventListener(() => {
544
+ b.value = !0, X(), ee();
545
+ }), e.token) try {
546
+ i.token = e.token;
547
+ } catch (e) {
548
+ console.warn("[zz-layer-mvt] set token failed:", e);
549
+ }
550
+ t(v.value, i, x.stackIndex, 0, {
551
+ layerType: "mvt",
552
+ groupKey: x.groupKey || e.layer || String(x.stackIndex),
553
+ subStackIndex: x.subStackIndex
554
+ }), X(), y.value = i;
555
+ } catch (e) {
556
+ te(e);
557
+ }
558
+ }, Q = null, $ = () => {
559
+ Q && clearTimeout(Q), Q = setTimeout(() => {
560
+ Q = null, ne();
561
+ }, 0);
562
+ };
563
+ return f(I, (e, t) => {
564
+ !e || e === t || $();
565
+ }), f(L, (e, t) => {
566
+ !e || e === t || (z.value = Date.now(), $());
567
+ }), f(() => F.value.hiddenValues, () => {
568
+ z.value = Date.now();
569
+ }, { deep: !0 }), f(() => [
570
+ x.stackIndex,
571
+ x.subStackIndex,
572
+ x.groupKey
573
+ ], () => {
574
+ y.value && v.value && x.stackIndex >= 0 && e(v.value, y.value, x.stackIndex, {
575
+ layerType: "mvt",
576
+ groupKey: x.groupKey || P.value.layer || String(x.stackIndex),
577
+ subStackIndex: x.subStackIndex
578
+ });
579
+ }), f(v, (e) => {
580
+ e && $();
581
+ }), s(() => {
582
+ $();
583
+ }), c(() => {
584
+ Q &&= (clearTimeout(Q), null), Z();
585
+ }), (e, t) => {
586
+ let n = d("zz-layer-geojson");
587
+ return G.value && b.value ? (l(), i(n, {
588
+ key: `mvt-wfs-label-${z.value}`,
589
+ geojson: W.value,
590
+ token: P.value.token,
591
+ note: B.value,
592
+ "note-only": !0,
593
+ "style-by-property": F.value.styleByProperty,
594
+ "hidden-values": F.value.hiddenValues || [],
595
+ "clamp-to-ground": !0,
596
+ "fit-to-layer": !1,
597
+ "layer-z-index": 1e3
598
+ }, null, 8, [
599
+ "geojson",
600
+ "token",
601
+ "note",
602
+ "style-by-property",
603
+ "hidden-values"
604
+ ])) : a("", !0);
605
+ };
606
+ }
607
+ };
608
+ //#endregion
609
+ export { g as default };