@soonspacejs/plugin-tiles 2.15.15 → 2.15.17

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.esm.js CHANGED
@@ -1,25 +1,25 @@
1
- import I from "soonspacejs";
2
- import { TilesRenderer as T } from "um-3d-tiles-renderer";
3
- import { GLTFLoader as de } from "three/examples/jsm/loaders/GLTFLoader.js";
4
- import { MathUtils as f, MeshBasicMaterial as he, Color as L, PerspectiveCamera as V, Matrix4 as b, Vector3 as Oe, Box3 as Me, Sphere as ue, MeshStandardMaterial as Se, ShaderMaterial as Z } from "three";
5
- import { TilesFadePlugin as B, UpdateOnChangePlugin as H, QuantizedMeshPlugin as J, ImageOverlayPlugin as ce, XYZTilesOverlay as pe, ReorientationPlugin as j, StyledGeoJSONOverlay as K, CesiumIonOverlay as we, TMSTilesOverlay as Ce, UrlTemplateTilesOverlay as be, WMSTilesOverlay as Te, WMTSCapabilitiesLoader as Pe, WMTSTilesOverlay as Ee, CesiumIonAuthPlugin as ge } from "um-3d-tiles-renderer/plugins";
6
- import { CesiumGroundTextPrimitive as k, CesiumGroundPolylinePrimitive as R, CesiumGroundPolygonPrimitive as ee, CesiumGroundCirclePrimitive as te, CesiumGroundPointPrimitive as re, initializeApproximateTerrainHeights as ke, updateTerrainLogDepthUniforms as xe, CesiumGlobeDepth as Re, CESIUM_GROUND_NON_PICKABLE_LAYER as Ie } from "cesium-to-three/ground";
7
- import { createFineArrow as W, createCurvedArrow as fe, createSwallowtailAttackArrow as ye, createAttackArrow as me, createAssaultDirectionArrow as ve } from "cesium-to-three/arrow";
8
- class Ne {
1
+ import L, { BaseMesh as Le } from "soonspacejs";
2
+ import { TilesRenderer as E } from "um-3d-tiles-renderer";
3
+ import { GLTFLoader as be } from "three/examples/jsm/loaders/GLTFLoader.js";
4
+ import { MathUtils as p, MeshBasicMaterial as Ce, Color as W, Box3 as te, Sphere as G, Vector3 as a, Matrix4 as g, Quaternion as xe, TextureLoader as Ge, Raycaster as Be, PerspectiveCamera as ce, MeshStandardMaterial as Ue, ShaderMaterial as he } from "three";
5
+ import { TilesFadePlugin as re, UpdateOnChangePlugin as ie, QuantizedMeshPlugin as Q, ImageOverlayPlugin as ke, XYZTilesOverlay as Te, ReorientationPlugin as se, StyledGeoJSONOverlay as de, CesiumIonOverlay as We, TMSTilesOverlay as ze, UrlTemplateTilesOverlay as Je, WMSTilesOverlay as $e, WMTSCapabilitiesLoader as je, WMTSTilesOverlay as He, CesiumIonAuthPlugin as Pe } from "um-3d-tiles-renderer/plugins";
6
+ import { CesiumGroundTextPrimitive as N, CesiumGroundPolylinePrimitive as D, CesiumGroundPointPrimitive as F, CesiumGroundPolygonPrimitive as ue, CesiumGroundCirclePrimitive as ge, initializeApproximateTerrainHeights as Qe, updateTerrainLogDepthUniforms as Ye, CesiumGlobeDepth as Xe, CESIUM_GROUND_NON_PICKABLE_LAYER as Ve } from "cesium-to-three/ground";
7
+ import { createFineArrow as Y, createCurvedArrow as Ee, createSwallowtailAttackArrow as Ie, createAttackArrow as Re, createAssaultDirectionArrow as Ne } from "cesium-to-three/arrow";
8
+ class qe {
9
9
  constructor(e) {
10
10
  this.parser = e, this.name = "KHR_texture_basisu_patch";
11
11
  }
12
12
  loadTexture(e) {
13
- const t = this.parser, r = t.json, n = r.textures[e].source, a = r.images[n];
14
- if (!a || a.mimeType !== "image/ktx2")
13
+ const t = this.parser, r = t.json, n = r.textures[e].source, o = r.images[n];
14
+ if (!o || o.mimeType !== "image/ktx2")
15
15
  return null;
16
- const o = t.options.ktx2Loader;
17
- if (!o)
18
- throw new Error(`${I.utils.consoleSspTitle}请使用 setModelKtx2DecoderPath 设置 ktx2 解压库路径`);
19
- return t.loadTextureImage(e, n, o);
16
+ const l = t.options.ktx2Loader;
17
+ if (!l)
18
+ throw new Error(`${L.utils.consoleSspTitle}请使用 setModelKtx2DecoderPath 设置 ktx2 解压库路径`);
19
+ return t.loadTextureImage(e, n, l);
20
20
  }
21
21
  }
22
- class bt {
22
+ class pr {
23
23
  constructor(e) {
24
24
  this.ssp = e;
25
25
  const { controls: t, viewport: r } = e;
@@ -46,21 +46,21 @@ class bt {
46
46
  downloadQueue = null;
47
47
  async loadTiles(e) {
48
48
  if (this.tilesMap.has(e)) {
49
- I.utils.warn(`${e} already loaded`);
49
+ L.utils.warn(`${e} already loaded`);
50
50
  return;
51
51
  }
52
- const { ssp: t, ssp: { viewport: r } } = this, i = new T(e);
52
+ const { ssp: t, ssp: { viewport: r } } = this, i = new E(e);
53
53
  this.lruCache === null ? this.lruCache = i.lruCache : i.lruCache = this.lruCache, this.parseQueue === null ? this.parseQueue = i.parseQueue : i.parseQueue = this.parseQueue, this.downloadQueue === null ? this.downloadQueue = i.downloadQueue : i.downloadQueue = this.downloadQueue;
54
- const n = new de(i.manager);
55
- n.register((h) => new Ne(h));
56
- const { dracoLoader: a, ktx2Loader: o, meshoptDecoder: d } = t.manager.store.modelManager.gltfLoader;
57
- a && n.setDRACOLoader(a), o && n.setKTX2Loader(o), d && n.setMeshoptDecoder(d), i.manager.addHandler(/\.gltf$/, n), this.tilesMap.set(e, i), i.setCamera(this._tilesCamera), i.setResolutionFromRenderer(this._tilesCamera, r.renderer), i.lruCache.maxSize = 600, i.lruCache.minSize = 300, i.lruCache.unloadPercent = 0.8, t.addObject(i.group);
58
- const l = () => {
54
+ const n = new be(i.manager);
55
+ n.register((d) => new qe(d));
56
+ const { dracoLoader: o, ktx2Loader: l, meshoptDecoder: h } = t.manager.store.modelManager.gltfLoader;
57
+ o && n.setDRACOLoader(o), l && n.setKTX2Loader(l), h && n.setMeshoptDecoder(h), i.manager.addHandler(/\.gltf$/, n), this.tilesMap.set(e, i), i.setCamera(this._tilesCamera), i.setResolutionFromRenderer(this._tilesCamera, r.renderer), i.lruCache.maxSize = 600, i.lruCache.minSize = 300, i.lruCache.unloadPercent = 0.8, t.addObject(i.group);
58
+ const c = () => {
59
59
  this.cameraTransitionStart || (this.needsUpdate = !0, t.render());
60
60
  };
61
- return i.addEventListener("load-model", l), new Promise((h) => {
61
+ return i.addEventListener("load-model", c), new Promise((d) => {
62
62
  i.addEventListener("load-tile-set", () => {
63
- l(), h(i);
63
+ c(), d(i);
64
64
  });
65
65
  });
66
66
  }
@@ -69,31 +69,31 @@ class bt {
69
69
  return t ? (t.dispose(), this.tilesMap.delete(e), this.ssp.removeObject(t.group), !0) : !1;
70
70
  }
71
71
  }
72
- let Ae = class {
72
+ let Ze = class {
73
73
  priority = -999;
74
74
  processTileModel(e) {
75
75
  e.traverse((t) => {
76
- t.material && (t.material = new he());
76
+ t.material && (t.material = new Ce());
77
77
  });
78
78
  }
79
79
  };
80
- const Le = "https://sooncps.xwbuilders.com/api/ugis-dataprocess/v1/terrain/NhBLlMx3/";
81
- class Pt {
80
+ const Ke = "https://sooncps.xwbuilders.com/api/ugis-dataprocess/v1/terrain/NhBLlMx3/";
81
+ class yr {
82
82
  constructor(e) {
83
- this.ssp = e, this.tiles = new T(Le), this.tiles.fetchData = async (t, r) => {
83
+ this.ssp = e, this.tiles = new E(Ke), this.tiles.fetchData = async (t, r) => {
84
84
  if (/layer\.json$/.test(t)) {
85
85
  const i = await fetch(t, r).then((n) => n.json());
86
86
  return i.metadataAvailability = -1, new Response(JSON.stringify(i));
87
87
  }
88
88
  return fetch(t, r);
89
- }, this.tilesFadePlugin = new B({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new H(), this.quantizedPlugin = new J({}), this.customMaterialPlugin = new Ae(), this.imageOverlayPlugin = new ce({
89
+ }, this.tilesFadePlugin = new re({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new ie(), this.quantizedPlugin = new Q({}), this.customMaterialPlugin = new Ze(), this.imageOverlayPlugin = new ke({
90
90
  renderer: e.viewport.renderer,
91
91
  overlays: [
92
- new pe({
92
+ new Te({
93
93
  url: "https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
94
94
  })
95
95
  ]
96
- }), this.reorientationPlugin = new j({
96
+ }), this.reorientationPlugin = new se({
97
97
  lon: 120,
98
98
  lat: 30,
99
99
  height: 0.1
@@ -124,10 +124,10 @@ class Pt {
124
124
  }
125
125
  invalidate(e, t, r) {
126
126
  const i = () => {
127
- const a = f.degToRad(t), o = f.degToRad(e);
127
+ const o = p.degToRad(t), l = p.degToRad(e);
128
128
  this.reorientationPlugin.transformLatLonHeightToOrigin(
129
- a,
130
129
  o,
130
+ l,
131
131
  r
132
132
  ), this.ssp.render(), n();
133
133
  }, n = () => {
@@ -141,7 +141,7 @@ class Pt {
141
141
  ), this.loedTilesSets.clear(), this.tiles.removeEventListener("needs-render", this.render), this.tiles.removeEventListener("needs-update", this.render), this.tiles.dispose();
142
142
  }
143
143
  }
144
- class De {
144
+ class et {
145
145
  // 使用较低的 priority 确保在 ImageOverlayPlugin 之后执行
146
146
  // ImageOverlayPlugin 默认 priority 是 -1
147
147
  priority = -999;
@@ -152,7 +152,7 @@ class De {
152
152
  */
153
153
  processTileModel(e) {
154
154
  e.traverse((t) => {
155
- t.material && (t.material = new he());
155
+ t.material && (t.material = new Ce());
156
156
  });
157
157
  }
158
158
  /**
@@ -184,8 +184,8 @@ class De {
184
184
  e.needsUpdate = !0;
185
185
  }
186
186
  }
187
- var u = /* @__PURE__ */ ((s) => (s.GEOJSON = "geojson", s.CESIUM_ION = "cesiumIon", s.TMS = "tms", s.XYZ = "xyz", s.WMS = "wms", s.WMTS = "wmts", s.URL_TEMPLATE = "urlTemplate", s.PLOT = "plot", s))(u || {}), M = /* @__PURE__ */ ((s) => (s.QUANTIZED_MESH = "quantizedMesh", s.CESIUM_ION = "cesiumIon", s))(M || {});
188
- class N {
187
+ var u = /* @__PURE__ */ ((s) => (s.GEOJSON = "geojson", s.CESIUM_ION = "cesiumIon", s.TMS = "tms", s.XYZ = "xyz", s.WMS = "wms", s.WMTS = "wmts", s.URL_TEMPLATE = "urlTemplate", s.PLOT = "plot", s))(u || {}), x = /* @__PURE__ */ ((s) => (s.QUANTIZED_MESH = "quantizedMesh", s.CESIUM_ION = "cesiumIon", s))(x || {});
188
+ class B {
189
189
  constructor(e, t) {
190
190
  this.imageOverlayPlugin = e, this.resourceManager = t;
191
191
  }
@@ -209,8 +209,8 @@ class N {
209
209
  defaultStyle: this._buildGeoJSONDefaultStyle(e, r),
210
210
  ...this._getGeoJSONModeFlags(r)
211
211
  };
212
- e.color !== void 0 && (i.color = new L(e.color));
213
- const n = new K(i);
212
+ e.color !== void 0 && (i.color = new W(e.color));
213
+ const n = new de(i);
214
214
  return t.addOverlay(n, e.order), this._instances.set(e.id, {
215
215
  id: e.id,
216
216
  type: e.type,
@@ -231,53 +231,53 @@ class N {
231
231
  updateGeoJSONDefaultStyle(e, t) {
232
232
  const r = this._instances.get(e);
233
233
  if (!r || r.type !== u.GEOJSON) return !1;
234
- const i = r.instance, n = r.options, a = {
234
+ const i = r.instance, n = r.options, o = {
235
235
  ...n.defaultStyle || {},
236
236
  ...t
237
- }, o = {
237
+ }, l = {
238
238
  ...n,
239
- defaultStyle: a
239
+ defaultStyle: o
240
240
  };
241
- return i.defaultStyle = this._buildGeoJSONDefaultStyle(o, o.mode ?? "overlay"), this._updateOverlayOptions(e, { defaultStyle: a }), !0;
241
+ return i.defaultStyle = this._buildGeoJSONDefaultStyle(l, l.mode ?? "overlay"), this._updateOverlayOptions(e, { defaultStyle: o }), !0;
242
242
  }
243
243
  updateGeoJSONStrokeStyle(e, t) {
244
244
  const r = this._instances.get(e);
245
245
  if (!r || r.type !== u.GEOJSON) return !1;
246
- const i = r.instance, n = r.options, a = {
246
+ const i = r.instance, n = r.options, o = {
247
247
  ...n.defaultStyle || {},
248
248
  strokeStyle: t
249
- }, o = {
249
+ }, l = {
250
250
  ...n,
251
251
  strokeStyle: t,
252
- defaultStyle: a
252
+ defaultStyle: o
253
253
  };
254
- return i.defaultStyle = this._buildGeoJSONDefaultStyle(o, o.mode ?? "overlay"), this._updateOverlayOptions(e, { strokeStyle: t, defaultStyle: a }), !0;
254
+ return i.defaultStyle = this._buildGeoJSONDefaultStyle(l, l.mode ?? "overlay"), this._updateOverlayOptions(e, { strokeStyle: t, defaultStyle: o }), !0;
255
255
  }
256
256
  updateGeoJSONStrokeWidth(e, t) {
257
257
  const r = this._instances.get(e);
258
258
  if (!r || r.type !== u.GEOJSON) return !1;
259
- const i = r.instance, n = r.options, a = {
259
+ const i = r.instance, n = r.options, o = {
260
260
  ...n.defaultStyle || {},
261
261
  strokeWidth: t
262
- }, o = {
262
+ }, l = {
263
263
  ...n,
264
264
  strokeWidth: t,
265
- defaultStyle: a
265
+ defaultStyle: o
266
266
  };
267
- return i.defaultStyle = this._buildGeoJSONDefaultStyle(o, o.mode ?? "overlay"), this._updateOverlayOptions(e, { strokeWidth: t, defaultStyle: a }), !0;
267
+ return i.defaultStyle = this._buildGeoJSONDefaultStyle(l, l.mode ?? "overlay"), this._updateOverlayOptions(e, { strokeWidth: t, defaultStyle: o }), !0;
268
268
  }
269
269
  updateGeoJSONFillStyle(e, t) {
270
270
  const r = this._instances.get(e);
271
271
  if (!r || r.type !== u.GEOJSON) return !1;
272
- const i = r.instance, n = r.options, a = {
272
+ const i = r.instance, n = r.options, o = {
273
273
  ...n.defaultStyle || {},
274
274
  fillStyle: t
275
- }, o = {
275
+ }, l = {
276
276
  ...n,
277
277
  fillStyle: t,
278
- defaultStyle: a
278
+ defaultStyle: o
279
279
  };
280
- return i.defaultStyle = this._buildGeoJSONDefaultStyle(o, o.mode ?? "overlay"), this._updateOverlayOptions(e, { fillStyle: t, defaultStyle: a }), !0;
280
+ return i.defaultStyle = this._buildGeoJSONDefaultStyle(l, l.mode ?? "overlay"), this._updateOverlayOptions(e, { fillStyle: t, defaultStyle: o }), !0;
281
281
  }
282
282
  updateGeoJSONMode(e, t) {
283
283
  const r = this._instances.get(e);
@@ -285,8 +285,8 @@ class N {
285
285
  const i = r.instance, n = {
286
286
  ...r.options,
287
287
  mode: t
288
- }, a = this._getGeoJSONModeFlags(t);
289
- return i.alphaInvert = a.alphaInvert, i.alphaMask = a.alphaMask, i.defaultStyle = this._buildGeoJSONDefaultStyle(n, t), i.requestUpdate?.(), this._updateOverlayOptions(e, { mode: t }), !0;
288
+ }, o = this._getGeoJSONModeFlags(t);
289
+ return i.alphaInvert = o.alphaInvert, i.alphaMask = o.alphaMask, i.defaultStyle = this._buildGeoJSONDefaultStyle(n, t), i.requestUpdate?.(), this._updateOverlayOptions(e, { mode: t }), !0;
290
290
  }
291
291
  setGeoJSON(e, t) {
292
292
  const r = this._instances.get(e);
@@ -301,8 +301,8 @@ class N {
301
301
  setMergedGeoJSON(e, t, r) {
302
302
  const i = this._instances.get(e);
303
303
  if (!i || i.type !== u.GEOJSON) return null;
304
- const a = i.instance.setMergedGeoJSON(t, r);
305
- return this._updateOverlayOptions(e, { geojson: a }), a;
304
+ const o = i.instance.setMergedGeoJSON(t, r);
305
+ return this._updateOverlayOptions(e, { geojson: o }), o;
306
306
  }
307
307
  getGeoJSONFeatureById(e, t) {
308
308
  const r = this._instances.get(e);
@@ -328,7 +328,7 @@ class N {
328
328
  addCesiumIonOverlay(e) {
329
329
  const t = this._getImageOverlayPluginForAdd(e.id);
330
330
  if (!t) return null;
331
- const r = new we({
331
+ const r = new We({
332
332
  assetId: e.assetId,
333
333
  apiToken: e.apiToken,
334
334
  autoRefreshToken: e.autoRefreshToken ?? !0,
@@ -350,7 +350,7 @@ class N {
350
350
  addTMSOverlay(e) {
351
351
  const t = this._getImageOverlayPluginForAdd(e.id);
352
352
  if (!t) return null;
353
- const r = new Ce({
353
+ const r = new ze({
354
354
  url: e.url,
355
355
  color: typeof e.color == "number" ? e.color : 16777215,
356
356
  opacity: e.opacity ?? 1
@@ -370,7 +370,7 @@ class N {
370
370
  addXYZOverlay(e) {
371
371
  const t = this._getImageOverlayPluginForAdd(e.id);
372
372
  if (!t) return null;
373
- const r = new pe({
373
+ const r = new Te({
374
374
  url: e.url,
375
375
  color: typeof e.color == "number" ? e.color : 16777215,
376
376
  opacity: e.opacity ?? 1
@@ -421,7 +421,7 @@ class N {
421
421
  addUrlTemplateOverlay(e) {
422
422
  const t = this._getImageOverlayPluginForAdd(e.id);
423
423
  if (!t) return null;
424
- const r = new be({
424
+ const r = new Je({
425
425
  url: e.url,
426
426
  subdomains: e.subdomains,
427
427
  levels: e.levels,
@@ -453,14 +453,14 @@ class N {
453
453
  crs: e.crs || "EPSG:4326",
454
454
  format: e.format || "image/png",
455
455
  tileDimension: e.tileDimension || 256
456
- }, i = new Te({
456
+ }, i = new $e({
457
457
  url: e.url,
458
458
  layer: r.layer,
459
459
  crs: r.crs,
460
460
  format: r.format,
461
461
  tileDimension: r.tileDimension,
462
462
  styles: r.styles,
463
- color: new L(typeof e.color == "number" ? e.color : 16777215),
463
+ color: new W(typeof e.color == "number" ? e.color : 16777215),
464
464
  opacity: e.opacity ?? 1
465
465
  });
466
466
  return t.addOverlay(i, e.order), this._instances.set(e.id, {
@@ -478,31 +478,31 @@ class N {
478
478
  async addWMTSOverlay(e) {
479
479
  const t = this._getImageOverlayPluginForAdd(e.id);
480
480
  if (!t) return null;
481
- const r = await new Pe().loadAsync(e.url), i = ["EPSG:4326", "EPSG:3857"];
481
+ const r = await new je().loadAsync(e.url), i = ["EPSG:4326", "EPSG:3857"];
482
482
  let n = e.layer || "";
483
- r.layers.find((o) => o.identifier === n) || (n = r.layers.find(
484
- (o) => o?.tileMatrixSets?.some((d) => i.includes(d.supportedCRS))
483
+ r.layers.find((l) => l.identifier === n) || (n = r.layers.find(
484
+ (l) => l?.tileMatrixSets?.some((h) => i.includes(h.supportedCRS))
485
485
  )?.identifier || r.layers[0].identifier);
486
- const a = new Ee({
486
+ const o = new He({
487
487
  capabilities: r,
488
488
  layer: n,
489
489
  dimensions: e.dimensions || null,
490
490
  style: e.style || void 0,
491
491
  tileMatrixSet: e.tileMatrixSet || null,
492
492
  planar: !1,
493
- color: new L(typeof e.color == "number" ? e.color : 16777215),
493
+ color: new W(typeof e.color == "number" ? e.color : 16777215),
494
494
  opacity: e.opacity ?? 1
495
495
  });
496
- return t.addOverlay(a, e.order), this._instances.set(e.id, {
496
+ return t.addOverlay(o, e.order), this._instances.set(e.id, {
497
497
  id: e.id,
498
498
  type: e.type,
499
- instance: a,
499
+ instance: o,
500
500
  options: { ...e }
501
501
  }), this.resourceManager?.addOverlay({
502
502
  id: e.id,
503
503
  type: e.type,
504
504
  options: e
505
- }), a;
505
+ }), o;
506
506
  }
507
507
  // =============== 通用方法 ===============
508
508
  /**
@@ -668,7 +668,7 @@ class N {
668
668
  };
669
669
  }
670
670
  _getGeoJSONUtilityOverlay() {
671
- return this._geoJSONUtilityOverlay || (this._geoJSONUtilityOverlay = new K({})), this._geoJSONUtilityOverlay;
671
+ return this._geoJSONUtilityOverlay || (this._geoJSONUtilityOverlay = new de({})), this._geoJSONUtilityOverlay;
672
672
  }
673
673
  _updateOverlayOptions(e, t) {
674
674
  const r = this._instances.get(e);
@@ -678,7 +678,7 @@ class N {
678
678
  }), this.resourceManager?.updateOverlay(e, t);
679
679
  }
680
680
  _getImageOverlayPluginForAdd(e) {
681
- return this.imageOverlayPlugin ? this._instances.has(e) ? (console.warn(`OverlayManager: Overlay "${e}" already exists`), null) : this._instances.size >= N.MAX_OVERLAY_INSTANCES ? (console.error(`OverlayManager: Cannot add overlay "${e}" because the maximum number of overlays is ${N.MAX_OVERLAY_INSTANCES}`), null) : this.imageOverlayPlugin : null;
681
+ return this.imageOverlayPlugin ? this._instances.has(e) ? (console.warn(`OverlayManager: Overlay "${e}" already exists`), null) : this._instances.size >= B.MAX_OVERLAY_INSTANCES ? (console.error(`OverlayManager: Cannot add overlay "${e}" because the maximum number of overlays is ${B.MAX_OVERLAY_INSTANCES}`), null) : this.imageOverlayPlugin : null;
682
682
  }
683
683
  /**
684
684
  * 获取本地影像数量(不依赖 ResourceManager)
@@ -704,7 +704,7 @@ class N {
704
704
  this.disposeInstances(), this.resourceManager?.clear();
705
705
  }
706
706
  }
707
- class Ge {
707
+ class tt {
708
708
  /** Overlay 资源配置 */
709
709
  _overlays = /* @__PURE__ */ new Map();
710
710
  // =============== Overlay 资源管理 ===============
@@ -794,7 +794,7 @@ class Ge {
794
794
  e.overlays && (this._overlays.clear(), e.overlays.forEach((t) => this._overlays.set(t.id, { ...t })));
795
795
  }
796
796
  }
797
- class Fe {
797
+ class rt {
798
798
  /** 地形配置映射表 */
799
799
  _terrains = /* @__PURE__ */ new Map();
800
800
  /** 当前激活的地形 ID */
@@ -883,10 +883,7 @@ class Fe {
883
883
  this.clear();
884
884
  }
885
885
  }
886
- let Ue = 1;
887
- class O {
888
- /** 自增字符串 id('1' / '2' / '3' ...) */
889
- id;
886
+ class C extends Le {
890
887
  /**
891
888
  * 类别。基类构造为空串,子类用 `readonly category = 'xxx' as const` 覆写。
892
889
  * 桥接器据此 switch 分支。
@@ -897,17 +894,48 @@ class O {
897
894
  * 收窄类型提示。
898
895
  */
899
896
  options;
897
+ /** 当前几何对应的场景包围盒缓存。 */
898
+ boundingBox = null;
899
+ /** 当前几何对应的场景包围球缓存。 */
900
+ boundingSphere = null;
901
+ /** 缓存对应的 options 快照键,兼容业务侧对 points 的就地修改。 */
902
+ _boundingBoxCacheKey = "";
903
+ /** 由掌握地形坐标变换的 TerrainTilesRenderer 注入。 */
904
+ _boundingBoxResolver = null;
900
905
  constructor(e) {
901
- this.id = String(Ue++), this.category = "", this.options = { ...e }, this.options.points && (this.options.points = this.options.points.map(
902
- (t) => [t[0], t[1]]
906
+ const { rotation: t, ...r } = e;
907
+ super(r), this.category = "", this.options = { ...e }, this.options.points && (this.options.points = this.options.points.map(
908
+ (i) => [i[0], i[1]]
903
909
  ));
904
910
  }
911
+ /**
912
+ * 注入场景包围盒计算器。模型自身只有经纬度,不负责猜测地形坐标变换。
913
+ */
914
+ setBoundingBoxResolver(e) {
915
+ this._boundingBoxResolver = e, this.invalidateBoundingBox();
916
+ }
917
+ /** 清除包围盒缓存;地形重定向或数据改变后调用。 */
918
+ invalidateBoundingBox() {
919
+ this.boundingBox = null, this.boundingSphere = null, this._boundingBoxCacheKey = "";
920
+ }
921
+ /** 按 Three.js Object3D 包围盒协议更新 boundingBox。 */
922
+ computeBoundingBox() {
923
+ const e = JSON.stringify(this.options);
924
+ if (this.boundingBox && this._boundingBoxCacheKey === e)
925
+ return;
926
+ const t = this._boundingBoxResolver?.(this);
927
+ this.boundingBox = t?.clone() ?? new te(), this.boundingSphere = null, this._boundingBoxCacheKey = e;
928
+ }
929
+ /** 按 Three.js Object3D 包围体协议更新 boundingSphere。 */
930
+ computeBoundingSphere() {
931
+ this.computeBoundingBox(), !this.boundingSphere && (this.boundingSphere = this.boundingBox?.getBoundingSphere(new G()) ?? new G());
932
+ }
905
933
  /**
906
934
  * 不可变整表替换:用展开 + patch 重建 options。
907
935
  * 子类覆写此方法仅为收窄 patch 的类型提示,方法体相同。
908
936
  */
909
937
  update(e) {
910
- this.options = { ...this.options, ...e };
938
+ this.options = { ...this.options, ...e }, this.invalidateBoundingBox();
911
939
  }
912
940
  /**
913
941
  * 浅快照:options 是新对象(展开一层),但 options.points 与内部共享引用。
@@ -945,7 +973,7 @@ class O {
945
973
  return this.options.points || [];
946
974
  }
947
975
  }
948
- class Je extends O {
976
+ class it extends C {
949
977
  category = "point";
950
978
  constructor(e) {
951
979
  super(e);
@@ -964,7 +992,7 @@ class Je extends O {
964
992
  return this.getCenterPoints();
965
993
  }
966
994
  }
967
- class We extends O {
995
+ class st extends C {
968
996
  category = "line";
969
997
  constructor(e) {
970
998
  super(e);
@@ -974,7 +1002,7 @@ class We extends O {
974
1002
  this.options = { ...this.options, ...e };
975
1003
  }
976
1004
  }
977
- class $e extends O {
1005
+ class nt extends C {
978
1006
  category = "polygon";
979
1007
  constructor(e) {
980
1008
  super(e);
@@ -984,7 +1012,7 @@ class $e extends O {
984
1012
  this.options = { ...this.options, ...e };
985
1013
  }
986
1014
  }
987
- class ze extends O {
1015
+ class ot extends C {
988
1016
  category = "rectangle";
989
1017
  constructor(e) {
990
1018
  super(e);
@@ -994,8 +1022,8 @@ class ze extends O {
994
1022
  this.options = { ...this.options, ...e };
995
1023
  }
996
1024
  }
997
- const Be = f.DEG2RAD, ie = 111320;
998
- class He extends O {
1025
+ const at = p.DEG2RAD, pe = 111320;
1026
+ class lt extends C {
999
1027
  category = "sector";
1000
1028
  constructor(e) {
1001
1029
  super(e);
@@ -1008,14 +1036,14 @@ class He extends O {
1008
1036
  getExtentPoints() {
1009
1037
  const e = this.options.points;
1010
1038
  if (!e || e.length === 0) return [];
1011
- const t = e[0][0], r = e[0][1], i = this.options.radius || 0, n = i / (ie * Math.cos(r * Be)), a = i / ie;
1039
+ const t = e[0][0], r = e[0][1], i = this.options.radius || 0, n = i / (pe * Math.cos(r * at)), o = i / pe;
1012
1040
  return [
1013
- [t - n, r - a],
1014
- [t + n, r + a]
1041
+ [t - n, r - o],
1042
+ [t + n, r + o]
1015
1043
  ];
1016
1044
  }
1017
1045
  }
1018
- class je extends O {
1046
+ class ct extends C {
1019
1047
  category = "arrow";
1020
1048
  /** generateCoords() 填充的闭合多边形顶点;初始为空 */
1021
1049
  generatedCoords = [];
@@ -1043,22 +1071,22 @@ class je extends O {
1043
1071
  return this.generatedCoords = [], this.generatedCoords;
1044
1072
  switch (this.options.arrowType) {
1045
1073
  case "fine":
1046
- this.generatedCoords = W(e[0], e[1]);
1074
+ this.generatedCoords = Y(e[0], e[1]);
1047
1075
  break;
1048
1076
  case "assaultDirection":
1049
- this.generatedCoords = ve(e[0], e[1]);
1077
+ this.generatedCoords = Ne(e[0], e[1]);
1050
1078
  break;
1051
1079
  case "attack":
1052
- this.generatedCoords = me(e);
1080
+ this.generatedCoords = Re(e);
1053
1081
  break;
1054
1082
  case "swallowtailAttack":
1055
- this.generatedCoords = ye(e);
1083
+ this.generatedCoords = Ie(e);
1056
1084
  break;
1057
1085
  case "curved":
1058
- this.generatedCoords = fe(e);
1086
+ this.generatedCoords = Ee(e);
1059
1087
  break;
1060
1088
  default:
1061
- this.generatedCoords = W(e[0], e[e.length - 1]);
1089
+ this.generatedCoords = Y(e[0], e[e.length - 1]);
1062
1090
  break;
1063
1091
  }
1064
1092
  return this.generatedCoords;
@@ -1085,7 +1113,7 @@ class je extends O {
1085
1113
  };
1086
1114
  }
1087
1115
  }
1088
- class Qe extends O {
1116
+ class ht extends C {
1089
1117
  category = "text";
1090
1118
  constructor(e) {
1091
1119
  super(e);
@@ -1104,8 +1132,8 @@ class Qe extends O {
1104
1132
  return this.getCenterPoints();
1105
1133
  }
1106
1134
  }
1107
- const Ye = f.DEG2RAD, se = 111320;
1108
- class Xe extends O {
1135
+ const dt = p.DEG2RAD, fe = 111320;
1136
+ class ut extends C {
1109
1137
  category = "circle";
1110
1138
  constructor(e) {
1111
1139
  super(e);
@@ -1118,52 +1146,614 @@ class Xe extends O {
1118
1146
  getExtentPoints() {
1119
1147
  const e = this.options.points;
1120
1148
  if (!e || e.length === 0) return [];
1121
- const t = e[0][0], r = e[0][1], i = this.options.radius || 0, n = i / (se * Math.cos(r * Ye)), a = i / se;
1149
+ const t = e[0][0], r = e[0][1], i = this.options.radius || 0, n = i / (fe * Math.cos(r * dt)), o = i / fe;
1122
1150
  return [
1123
- [t - n, r - a],
1124
- [t + n, r + a]
1151
+ [t - n, r - o],
1152
+ [t + n, r + o]
1125
1153
  ];
1126
1154
  }
1127
1155
  }
1128
- const qe = 3, Ve = 1e3;
1129
- function Ze(s) {
1156
+ const gt = 3, pt = 1e3;
1157
+ function ft(s) {
1130
1158
  return Number.isFinite(s) ? Math.max(Math.round(s), 0) : 0;
1131
1159
  }
1132
- function Ke(s) {
1133
- const e = Ze(s), t = Ve + e * qe;
1160
+ function yt(s) {
1161
+ const e = ft(s), t = pt + e * gt;
1134
1162
  if (!Number.isSafeInteger(t))
1135
1163
  throw new Error("Plot renderOrder exceeded JavaScript safe integer range.");
1136
1164
  return t;
1137
1165
  }
1138
- const $ = {
1139
- OutdoorFireHydrant: "outdoor-hydrant.svg",
1140
- UndergroundHydrant: "outdoor-hydrant-underground.svg",
1141
- AboveGroundHydrant: "outdoor-hydrant-above-ground.svg",
1142
- MunicipalFireHydrants: "municipal-hydrant.svg",
1143
- FireWaterReservoir: "fire-water-pool.svg",
1144
- NaturalWater: "natural-water-source.svg",
1145
- HospitalResourcePoint: "hospital-resource.svg",
1146
- PublicSecurityResourcePoint: "police-resource.svg",
1147
- SupportMaterialPoint: "emergency-supplies.svg",
1148
- FireStation: "fire-station.svg",
1149
- LinkageUnit: "coordination-unit.svg"
1150
- }, Et = Object.freeze(
1151
- Object.keys($)
1152
- ), et = "/node_modules/cesium-to-three/dist/icon/";
1153
- function tt(s) {
1166
+ new a(1, 1, 0);
1167
+ new a();
1168
+ new a();
1169
+ new a();
1170
+ new a();
1171
+ new a();
1172
+ new a();
1173
+ new a();
1174
+ new a();
1175
+ new a();
1176
+ new a();
1177
+ new a();
1178
+ new a();
1179
+ new a();
1180
+ new g();
1181
+ new a();
1182
+ new a();
1183
+ new a();
1184
+ new a();
1185
+ new a();
1186
+ new a();
1187
+ new a();
1188
+ new a();
1189
+ Object.freeze(new a(0, 0, 1));
1190
+ new a();
1191
+ new a();
1192
+ new a();
1193
+ new a();
1194
+ new a();
1195
+ new a();
1196
+ new a();
1197
+ new a();
1198
+ new xe();
1199
+ new Array(9);
1200
+ new a();
1201
+ new a();
1202
+ new a();
1203
+ new a();
1204
+ new a();
1205
+ new a();
1206
+ new a();
1207
+ new a();
1208
+ new a();
1209
+ new a();
1210
+ new a();
1211
+ new a();
1212
+ new a();
1213
+ new a();
1214
+ new a();
1215
+ new a();
1216
+ new g();
1217
+ new a();
1218
+ new a();
1219
+ new a();
1220
+ new Ge();
1221
+ new a();
1222
+ new a();
1223
+ new a();
1224
+ new a();
1225
+ new a();
1226
+ new a();
1227
+ new a();
1228
+ new a();
1229
+ new a();
1230
+ new a();
1231
+ new a();
1232
+ new a();
1233
+ new a();
1234
+ new a();
1235
+ new a();
1236
+ new a();
1237
+ new a();
1238
+ new a();
1239
+ new a();
1240
+ new a();
1241
+ new a();
1242
+ new a();
1243
+ new a();
1244
+ new a();
1245
+ new a();
1246
+ new a();
1247
+ new a();
1248
+ new xe();
1249
+ new a();
1250
+ new a();
1251
+ new a();
1252
+ new a();
1253
+ new a();
1254
+ new a();
1255
+ new a();
1256
+ new a();
1257
+ new a();
1258
+ new a();
1259
+ new a();
1260
+ new a();
1261
+ new a();
1262
+ new a();
1263
+ new a();
1264
+ new a();
1265
+ new a();
1266
+ new a();
1267
+ new a();
1268
+ new a();
1269
+ new a();
1270
+ new a();
1271
+ new a();
1272
+ new a();
1273
+ new a();
1274
+ new a();
1275
+ new a();
1276
+ new a();
1277
+ new g();
1278
+ new g();
1279
+ new a();
1280
+ new a();
1281
+ new a();
1282
+ new a();
1283
+ new a();
1284
+ new a();
1285
+ new a();
1286
+ new g();
1287
+ new g();
1288
+ new a();
1289
+ new a();
1290
+ new a();
1291
+ new g();
1292
+ new g();
1293
+ new a();
1294
+ new a();
1295
+ new a();
1296
+ new a();
1297
+ new g();
1298
+ new g();
1299
+ new a();
1300
+ new a();
1301
+ new a();
1302
+ new a();
1303
+ new a();
1304
+ new a();
1305
+ new a();
1306
+ new a();
1307
+ new a();
1308
+ new a();
1309
+ new a();
1310
+ new g();
1311
+ new a();
1312
+ new a();
1313
+ new a();
1314
+ new a();
1315
+ new a();
1316
+ new a();
1317
+ new a();
1318
+ new a();
1319
+ new a();
1320
+ new a();
1321
+ new a();
1322
+ new a();
1323
+ new a();
1324
+ new a();
1325
+ new g();
1326
+ new g();
1327
+ new a();
1328
+ new a();
1329
+ new a();
1330
+ new g();
1331
+ new g();
1332
+ new a();
1333
+ new a();
1334
+ new g();
1335
+ new g();
1336
+ new a();
1337
+ new a();
1338
+ new a();
1339
+ new a();
1340
+ new a();
1341
+ class b {
1342
+ constructor(e, t) {
1343
+ this.next = null, this.key = e, this.data = t, this.left = null, this.right = null;
1344
+ }
1345
+ }
1346
+ function mt(s, e) {
1347
+ return s > e ? 1 : s < e ? -1 : 0;
1348
+ }
1349
+ function O(s, e, t) {
1350
+ const r = new b(null, null);
1351
+ let i = r, n = r;
1352
+ for (; ; ) {
1353
+ const o = t(s, e.key);
1354
+ if (o < 0) {
1355
+ if (e.left === null) break;
1356
+ if (t(s, e.left.key) < 0) {
1357
+ const l = e.left;
1358
+ if (e.left = l.right, l.right = e, e = l, e.left === null) break;
1359
+ }
1360
+ n.left = e, n = e, e = e.left;
1361
+ } else if (o > 0) {
1362
+ if (e.right === null) break;
1363
+ if (t(s, e.right.key) > 0) {
1364
+ const l = e.right;
1365
+ if (e.right = l.left, l.left = e, e = l, e.right === null) break;
1366
+ }
1367
+ i.right = e, i = e, e = e.right;
1368
+ } else break;
1369
+ }
1370
+ return i.right = e.left, n.left = e.right, e.left = r.right, e.right = r.left, e;
1371
+ }
1372
+ function z(s, e, t, r) {
1373
+ const i = new b(s, e);
1374
+ if (t === null)
1375
+ return i.left = i.right = null, i;
1376
+ t = O(s, t, r);
1377
+ const n = r(s, t.key);
1378
+ return n < 0 ? (i.left = t.left, i.right = t, t.left = null) : n >= 0 && (i.right = t.right, i.left = t, t.right = null), i;
1379
+ }
1380
+ function ye(s, e, t) {
1381
+ let r = null, i = null;
1382
+ if (e) {
1383
+ e = O(s, e, t);
1384
+ const n = t(e.key, s);
1385
+ n === 0 ? (r = e.left, i = e.right) : n < 0 ? (i = e.right, e.right = null, r = e) : (r = e.left, e.left = null, i = e);
1386
+ }
1387
+ return { left: r, right: i };
1388
+ }
1389
+ function vt(s, e, t) {
1390
+ return e === null ? s : (s === null || (e = O(s.key, e, t), e.left = s), e);
1391
+ }
1392
+ function X(s, e, t, r, i) {
1393
+ if (s) {
1394
+ r(`${e}${t ? "└── " : "├── "}${i(s)}
1395
+ `);
1396
+ const n = e + (t ? " " : "│ ");
1397
+ s.left && X(s.left, n, !1, r, i), s.right && X(s.right, n, !0, r, i);
1398
+ }
1399
+ }
1400
+ class wt {
1401
+ constructor(e = mt) {
1402
+ this._root = null, this._size = 0, this._comparator = e;
1403
+ }
1404
+ /**
1405
+ * Inserts a key, allows duplicates
1406
+ */
1407
+ insert(e, t) {
1408
+ return this._size++, this._root = z(e, t, this._root, this._comparator);
1409
+ }
1410
+ /**
1411
+ * Adds a key, if it is not present in the tree
1412
+ */
1413
+ add(e, t) {
1414
+ const r = new b(e, t);
1415
+ this._root === null && (r.left = r.right = null, this._size++, this._root = r);
1416
+ const i = this._comparator, n = O(e, this._root, i), o = i(e, n.key);
1417
+ return o === 0 ? this._root = n : (o < 0 ? (r.left = n.left, r.right = n, n.left = null) : o > 0 && (r.right = n.right, r.left = n, n.right = null), this._size++, this._root = r), this._root;
1418
+ }
1419
+ /**
1420
+ * @param {Key} key
1421
+ * @return {Node|null}
1422
+ */
1423
+ remove(e) {
1424
+ this._root = this._remove(e, this._root, this._comparator);
1425
+ }
1426
+ /**
1427
+ * Deletes i from the tree if it's there
1428
+ */
1429
+ _remove(e, t, r) {
1430
+ let i;
1431
+ return t === null ? null : (t = O(e, t, r), r(e, t.key) === 0 ? (t.left === null ? i = t.right : (i = O(e, t.left, r), i.right = t.right), this._size--, i) : t);
1432
+ }
1433
+ /**
1434
+ * Removes and returns the node with smallest key
1435
+ */
1436
+ pop() {
1437
+ let e = this._root;
1438
+ if (e) {
1439
+ for (; e.left; ) e = e.left;
1440
+ return this._root = O(e.key, this._root, this._comparator), this._root = this._remove(e.key, this._root, this._comparator), { key: e.key, data: e.data };
1441
+ }
1442
+ return null;
1443
+ }
1444
+ /**
1445
+ * Find without splaying
1446
+ */
1447
+ findStatic(e) {
1448
+ let t = this._root;
1449
+ const r = this._comparator;
1450
+ for (; t; ) {
1451
+ const i = r(e, t.key);
1452
+ if (i === 0) return t;
1453
+ i < 0 ? t = t.left : t = t.right;
1454
+ }
1455
+ return null;
1456
+ }
1457
+ find(e) {
1458
+ return this._root && (this._root = O(e, this._root, this._comparator), this._comparator(e, this._root.key) !== 0) ? null : this._root;
1459
+ }
1460
+ contains(e) {
1461
+ let t = this._root;
1462
+ const r = this._comparator;
1463
+ for (; t; ) {
1464
+ const i = r(e, t.key);
1465
+ if (i === 0) return !0;
1466
+ i < 0 ? t = t.left : t = t.right;
1467
+ }
1468
+ return !1;
1469
+ }
1470
+ forEach(e, t) {
1471
+ let r = this._root;
1472
+ const i = [];
1473
+ let n = !1;
1474
+ for (; !n; )
1475
+ r !== null ? (i.push(r), r = r.left) : i.length !== 0 ? (r = i.pop(), e.call(t, r), r = r.right) : n = !0;
1476
+ return this;
1477
+ }
1478
+ /**
1479
+ * Walk key range from `low` to `high`. Stops if `fn` returns a value.
1480
+ */
1481
+ range(e, t, r, i) {
1482
+ const n = [], o = this._comparator;
1483
+ let l = this._root, h;
1484
+ for (; n.length !== 0 || l; )
1485
+ if (l)
1486
+ n.push(l), l = l.left;
1487
+ else {
1488
+ if (l = n.pop(), h = o(l.key, t), h > 0)
1489
+ break;
1490
+ if (o(l.key, e) >= 0 && r.call(i, l))
1491
+ return this;
1492
+ l = l.right;
1493
+ }
1494
+ return this;
1495
+ }
1496
+ /**
1497
+ * Returns array of keys
1498
+ */
1499
+ keys() {
1500
+ const e = [];
1501
+ return this.forEach(({ key: t }) => {
1502
+ e.push(t);
1503
+ }), e;
1504
+ }
1505
+ /**
1506
+ * Returns array of all the data in the nodes
1507
+ */
1508
+ values() {
1509
+ const e = [];
1510
+ return this.forEach(({ data: t }) => {
1511
+ e.push(t);
1512
+ }), e;
1513
+ }
1514
+ min() {
1515
+ return this._root ? this.minNode(this._root).key : null;
1516
+ }
1517
+ max() {
1518
+ return this._root ? this.maxNode(this._root).key : null;
1519
+ }
1520
+ minNode(e = this._root) {
1521
+ if (e) for (; e.left; ) e = e.left;
1522
+ return e;
1523
+ }
1524
+ maxNode(e = this._root) {
1525
+ if (e) for (; e.right; ) e = e.right;
1526
+ return e;
1527
+ }
1528
+ /**
1529
+ * Returns node at given index
1530
+ */
1531
+ at(e) {
1532
+ let t = this._root, r = !1, i = 0;
1533
+ const n = [];
1534
+ for (; !r; )
1535
+ if (t)
1536
+ n.push(t), t = t.left;
1537
+ else if (n.length > 0) {
1538
+ if (t = n.pop(), i === e) return t;
1539
+ i++, t = t.right;
1540
+ } else r = !0;
1541
+ return null;
1542
+ }
1543
+ next(e) {
1544
+ let t = this._root, r = null;
1545
+ if (e.right) {
1546
+ for (r = e.right; r.left; ) r = r.left;
1547
+ return r;
1548
+ }
1549
+ const i = this._comparator;
1550
+ for (; t; ) {
1551
+ const n = i(e.key, t.key);
1552
+ if (n === 0) break;
1553
+ n < 0 ? (r = t, t = t.left) : t = t.right;
1554
+ }
1555
+ return r;
1556
+ }
1557
+ prev(e) {
1558
+ let t = this._root, r = null;
1559
+ if (e.left !== null) {
1560
+ for (r = e.left; r.right; ) r = r.right;
1561
+ return r;
1562
+ }
1563
+ const i = this._comparator;
1564
+ for (; t; ) {
1565
+ const n = i(e.key, t.key);
1566
+ if (n === 0) break;
1567
+ n < 0 ? t = t.left : (r = t, t = t.right);
1568
+ }
1569
+ return r;
1570
+ }
1571
+ clear() {
1572
+ return this._root = null, this._size = 0, this;
1573
+ }
1574
+ toList() {
1575
+ return Mt(this._root);
1576
+ }
1577
+ /**
1578
+ * Bulk-load items. Both array have to be same size
1579
+ */
1580
+ load(e, t = [], r = !1) {
1581
+ let i = e.length;
1582
+ const n = this._comparator;
1583
+ if (r && Z(e, t, 0, i - 1, n), this._root === null)
1584
+ this._root = V(e, t, 0, i), this._size = i;
1585
+ else {
1586
+ const o = Ot(
1587
+ this.toList(),
1588
+ _t(e, t),
1589
+ n
1590
+ );
1591
+ i = this._size + i, this._root = q({ head: o }, 0, i);
1592
+ }
1593
+ return this;
1594
+ }
1595
+ isEmpty() {
1596
+ return this._root === null;
1597
+ }
1598
+ get size() {
1599
+ return this._size;
1600
+ }
1601
+ get root() {
1602
+ return this._root;
1603
+ }
1604
+ toString(e = (t) => String(t.key)) {
1605
+ const t = [];
1606
+ return X(this._root, "", !0, (r) => t.push(r), e), t.join("");
1607
+ }
1608
+ update(e, t, r) {
1609
+ const i = this._comparator;
1610
+ let { left: n, right: o } = ye(e, this._root, i);
1611
+ i(e, t) < 0 ? o = z(t, r, o, i) : n = z(t, r, n, i), this._root = vt(n, o, i);
1612
+ }
1613
+ split(e) {
1614
+ return ye(e, this._root, this._comparator);
1615
+ }
1616
+ *[Symbol.iterator]() {
1617
+ let e = this._root;
1618
+ const t = [];
1619
+ let r = !1;
1620
+ for (; !r; )
1621
+ e !== null ? (t.push(e), e = e.left) : t.length !== 0 ? (e = t.pop(), yield e, e = e.right) : r = !0;
1622
+ }
1623
+ }
1624
+ function V(s, e, t, r) {
1625
+ const i = r - t;
1626
+ if (i > 0) {
1627
+ const n = t + Math.floor(i / 2), o = s[n], l = e[n], h = new b(o, l);
1628
+ return h.left = V(s, e, t, n), h.right = V(s, e, n + 1, r), h;
1629
+ }
1630
+ return null;
1631
+ }
1632
+ function _t(s, e) {
1633
+ const t = new b(null, null);
1634
+ let r = t;
1635
+ for (let i = 0; i < s.length; i++)
1636
+ r = r.next = new b(s[i], e[i]);
1637
+ return r.next = null, t.next;
1638
+ }
1639
+ function Mt(s) {
1640
+ let e = s;
1641
+ const t = [];
1642
+ let r = !1;
1643
+ const i = new b(null, null);
1644
+ let n = i;
1645
+ for (; !r; )
1646
+ e ? (t.push(e), e = e.left) : t.length > 0 ? (e = n = n.next = t.pop(), e = e.right) : r = !0;
1647
+ return n.next = null, i.next;
1648
+ }
1649
+ function q(s, e, t) {
1650
+ const r = t - e;
1651
+ if (r > 0) {
1652
+ const i = e + Math.floor(r / 2), n = q(s, e, i), o = s.head;
1653
+ return o.left = n, s.head = s.head.next, o.right = q(s, i + 1, t), o;
1654
+ }
1655
+ return null;
1656
+ }
1657
+ function Ot(s, e, t) {
1658
+ const r = new b(null, null);
1659
+ let i = r, n = s, o = e;
1660
+ for (; n !== null && o !== null; )
1661
+ t(n.key, o.key) < 0 ? (i.next = n, n = n.next) : (i.next = o, o = o.next), i = i.next;
1662
+ return n !== null ? i.next = n : o !== null && (i.next = o), r.next;
1663
+ }
1664
+ function Z(s, e, t, r, i) {
1665
+ if (t >= r) return;
1666
+ const n = s[t + r >> 1];
1667
+ let o = t - 1, l = r + 1;
1668
+ for (; ; ) {
1669
+ do
1670
+ o++;
1671
+ while (i(s[o], n) < 0);
1672
+ do
1673
+ l--;
1674
+ while (i(s[l], n) > 0);
1675
+ if (o >= l) break;
1676
+ let h = s[o];
1677
+ s[o] = s[l], s[l] = h, h = e[o], e[o] = e[l], e[l] = h;
1678
+ }
1679
+ Z(s, e, t, l, i), Z(s, e, l + 1, r, i);
1680
+ }
1681
+ let S = Number.EPSILON;
1682
+ S === void 0 && (S = Math.pow(2, -52));
1683
+ const St = S * S, me = (s, e) => {
1684
+ if (-S < s && s < S && -S < e && e < S)
1685
+ return 0;
1686
+ const t = s - e;
1687
+ return t * t < St * s * e ? 0 : s < e ? -1 : 1;
1688
+ };
1689
+ class bt {
1690
+ constructor() {
1691
+ this.reset();
1692
+ }
1693
+ reset() {
1694
+ this.xRounder = new ve(), this.yRounder = new ve();
1695
+ }
1696
+ round(e, t) {
1697
+ return {
1698
+ x: this.xRounder.round(e),
1699
+ y: this.yRounder.round(t)
1700
+ };
1701
+ }
1702
+ }
1703
+ class ve {
1704
+ constructor() {
1705
+ this.tree = new wt(), this.round(0);
1706
+ }
1707
+ // Note: this can rounds input values backwards or forwards.
1708
+ // You might ask, why not restrict this to just rounding
1709
+ // forwards? Wouldn't that allow left endpoints to always
1710
+ // remain left endpoints during splitting (never change to
1711
+ // right). No - it wouldn't, because we snap intersections
1712
+ // to endpoints (to establish independence from the segment
1713
+ // angle for t-intersections).
1714
+ round(e) {
1715
+ const t = this.tree.add(e), r = this.tree.prev(t);
1716
+ if (r !== null && me(t.key, r.key) === 0)
1717
+ return this.tree.remove(e), r.key;
1718
+ const i = this.tree.next(t);
1719
+ return i !== null && me(t.key, i.key) === 0 ? (this.tree.remove(e), i.key) : e;
1720
+ }
1721
+ }
1722
+ new bt();
1723
+ typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE;
1724
+ typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS;
1725
+ p.DEG2RAD;
1726
+ p.DEG2RAD;
1727
+ const Ct = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e联动单位%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:联动;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-linkage'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20fill='none'%3e%3cpath%20d='M50%2050L22%2024M50%2050l28-26M50%2050L20%2076M50%2050l30%2026'/%3e%3ccircle%20cx='50'%20cy='50'%20r='13'%20fill='currentColor'/%3e%3ccircle%20cx='22'%20cy='24'%20r='10'/%3e%3ccircle%20cx='78'%20cy='24'%20r='10'/%3e%3ccircle%20cx='20'%20cy='76'%20r='10'/%3e%3ccircle%20cx='80'%20cy='76'%20r='10'/%3e%3c/g%3e%3cpath%20d='M44%2050l4%204%209-10'%20fill='none'%20stroke='%23F8FAFC'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23B67CFF'%3e%3cuse%20href='%23icon-linkage'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", xt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e保障物资点%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:物资;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-supplies'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M18%2035l32-16%2032%2016v44L50%2092%2018%2079zM18%2035l32%2017%2032-17M50%2052v40'/%3e%3cpath%20d='M34%2027l32%2017'/%3e%3c/g%3e%3cpath%20d='M41%2058h18v8h-18zM46%2053h8v18h-8z'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FFAD33'%3e%3cuse%20href='%23icon-supplies'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", kt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e消防站%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:消防站;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-fire-station'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M13%2088h74M20%2088V39l30-22%2030%2022v49M31%2088V60h38v28M41%2088V70h18v18'/%3e%3cpath%20d='M20%2041h60'/%3e%3c/g%3e%3cpath%20d='M50%2029c-9%2010-12%2016-9%2022%202%204%205%206%209%206s8-2%2010-6c3-6%200-12-10-22z'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FF6B2C'%3e%3cuse%20href='%23icon-fire-station'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Tt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e消防水池%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:水源;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-fire-pool'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M16%2039h68v43H16zM25%2055c6-5%2012-5%2018%200s12%205%2018%200%2012-5%2018%200M25%2068c6-5%2012-5%2018%200s12%205%2018%200%2012-5%2018%200'/%3e%3cpath%20d='M67%2021v28M77%2021v28M67%2029h10M67%2039h10'/%3e%3c/g%3e%3cpath%20d='M28%2025h25l-6%207H28z'%20fill='currentColor'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%2338BDF8'%3e%3cuse%20href='%23icon-fire-pool'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Pt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e医院资源点%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:医疗;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-hospital'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M18%2087V29h64v58M10%2087h80M29%2087V72h14v15M57%2087V72h14v15'/%3e%3cpath%20d='M50%2038v22M39%2049h22'%20stroke='%23F8FAFC'%20stroke-width='9'/%3e%3c/g%3e%3cpath%20d='M27%2022h46v12H27z'%20fill='currentColor'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%2322D3EE'%3e%3cuse%20href='%23icon-hospital'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Et = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e市政消火栓%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:消防;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-hydrant-municipal'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M10%2086h80M18%2086V48h18v38M64%2086V35h20v51M21%2057h4M29%2057h4M21%2068h4M29%2068h4M69%2046h4M77%2046h4M69%2058h4M77%2058h4'%20opacity='0.7'/%3e%3cpath%20d='M42%2086V60h18v26M39%2060h24l-4-11H43zM46%2049v-7h10v7'/%3e%3cpath%20d='M42%2067h-8v12h8M60%2067h8v12h-8'/%3e%3c/g%3e%3ccircle%20cx='51'%20cy='72'%20r='5'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FF4D3D'%3e%3cuse%20href='%23icon-hydrant-municipal'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", It = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e天然水源%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:水源;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-natural-water'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M14%2050l20-24%2014%2016%2011-12%2027%2029'/%3e%3cpath%20d='M15%2064c8-6%2015-6%2023%200s15%206%2023%200%2015-6%2024%200M15%2078c8-6%2015-6%2023%200s15%206%2023%200%2015-6%2024%200'/%3e%3c/g%3e%3ccircle%20cx='72'%20cy='23'%20r='8'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%2338BDF8'%3e%3cuse%20href='%23icon-natural-water'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Rt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e室外消火栓(地上式)%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:消防;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-hydrant-ground'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='7'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M12%2084h76M38%2084V45h24v39M38%2057H24v16h14M62%2057h14v16H62'/%3e%3cpath%20d='M33%2045h34l-5-16H38zM44%2029v-8h12v8'/%3e%3ccircle%20cx='24'%20cy='65'%20r='5'%20fill='currentColor'/%3e%3ccircle%20cx='76'%20cy='65'%20r='5'%20fill='currentColor'/%3e%3c/g%3e%3cpath%20d='M50%2055l7%2012H43z'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FF4D3D'%3e%3cuse%20href='%23icon-hydrant-ground'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Nt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e室外消火栓(地下式)%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:消防;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-hydrant-underground'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M12%2040h76'/%3e%3cellipse%20cx='50'%20cy='39'%20rx='22'%20ry='9'%20fill='currentColor'/%3e%3cpath%20d='M35%2045v30h30V45M42%2075v12M58%2075v12M31%2087h38'/%3e%3cpath%20d='M43%2054h14M50%2047v18'%20stroke='%23F8FAFC'/%3e%3c/g%3e%3cpath%20d='M25%2028l-7-8M75%2028l7-8'%20stroke='currentColor'%20stroke-width='5'%20stroke-linecap='round'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FF4D3D'%3e%3cuse%20href='%23icon-hydrant-underground'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", At = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e室外消火栓%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:消防;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-hydrant-general'%20viewBox='0%200%20100%20100'%3e%3cg%20stroke='currentColor'%20stroke-width='7'%20stroke-linecap='round'%20stroke-linejoin='round'%20fill='none'%3e%3cpath%20d='M35%2087h30M39%2087V48h22v39M39%2056H25v17h14M61%2056h14v17H61'/%3e%3cpath%20d='M34%2048h32l-5-15H39zM44%2033v-9h12v9'/%3e%3ccircle%20cx='25'%20cy='64'%20r='5'%20fill='currentColor'/%3e%3ccircle%20cx='75'%20cy='64'%20r='5'%20fill='currentColor'/%3e%3c/g%3e%3cpath%20d='M50%2058c-7%209-10%2014-10%2019a10%2010%200%200%200%2020%200c0-5-3-10-10-19z'%20fill='%23F8FAFC'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%23FF4D3D'%3e%3cuse%20href='%23icon-hydrant-general'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", Ft = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20role='img'%20aria-labelledby='title%20desc'%3e%3ctitle%20id='title'%3e公安资源点%3c/title%3e%3cdesc%20id='desc'%3eGIS%20点位图标;类别:公安;样式:classified%3c/desc%3e%3cdefs%3e%3csymbol%20id='icon-police'%20viewBox='0%200%20100%20100'%3e%3cpath%20d='M50%2014l32%2011v23c0%2021-13%2034-32%2041-19-7-32-20-32-41V25z'%20fill='none'%20stroke='currentColor'%20stroke-width='7'%20stroke-linejoin='round'/%3e%3cpath%20d='M50%2030l5.5%2011.2%2012.4%201.8-9%208.8%202.1%2012.4L50%2058.4l-11%205.8%202.1-12.4-9-8.8%2012.4-1.8z'%20fill='%23F8FAFC'/%3e%3cpath%20d='M35%2073h30'%20stroke='currentColor'%20stroke-width='6'%20stroke-linecap='round'/%3e%3c/symbol%3e%3c/defs%3e%3cg%20color='%235B7CFF'%3e%3cuse%20href='%23icon-police'%20x='16'%20y='16'%20width='96'%20height='96'/%3e%3c/g%3e%3c/svg%3e", K = {
1728
+ OutdoorFireHydrant: At,
1729
+ UndergroundHydrant: Nt,
1730
+ AboveGroundHydrant: Rt,
1731
+ MunicipalFireHydrants: Et,
1732
+ FireWaterReservoir: Tt,
1733
+ NaturalWater: It,
1734
+ HospitalResourcePoint: Pt,
1735
+ PublicSecurityResourcePoint: Ft,
1736
+ SupportMaterialPoint: xt,
1737
+ FireStation: kt,
1738
+ LinkageUnit: Ct
1739
+ }, mr = Object.freeze(
1740
+ Object.keys(K)
1741
+ );
1742
+ function Dt(s) {
1154
1743
  const e = s?.trim();
1155
1744
  return !e || !Object.prototype.hasOwnProperty.call(
1156
- $,
1745
+ K,
1157
1746
  e
1158
- ) ? null : et + $[e];
1747
+ ) ? null : K[e];
1159
1748
  }
1160
- function rt(s) {
1161
- return s.imageUrl?.trim() || tt(s.ontologyId);
1749
+ function Lt(s) {
1750
+ return s.imageUrl?.trim() || Dt(s.ontologyId);
1162
1751
  }
1163
- function ne(s) {
1164
- return s instanceof R || s instanceof k ? s.group : s.classification.group;
1752
+ new g();
1753
+ function we(s) {
1754
+ return s instanceof D || s instanceof N ? s.group : s.classification.group;
1165
1755
  }
1166
- function it(s) {
1756
+ function Gt(s) {
1167
1757
  const e = s.options, t = JSON.stringify(e.points ?? []);
1168
1758
  switch (s.category) {
1169
1759
  case "circle":
@@ -1182,27 +1772,27 @@ function it(s) {
1182
1772
  return `${s.category}|${t}`;
1183
1773
  }
1184
1774
  }
1185
- function ae(s, e = "solid") {
1775
+ function _e(s, e = "solid") {
1186
1776
  return s === "unfilledArrow" ? "open" : s === "filledArrow" ? "solid" : e;
1187
1777
  }
1188
- function st(s) {
1778
+ function Bt(s) {
1189
1779
  if (s.showArrow === !1) return "none";
1190
1780
  const e = s.startArrowStyle !== void 0 && s.startArrowStyle !== null, t = s.endArrowStyle !== void 0 && s.endArrowStyle !== null;
1191
1781
  return e && t ? "both" : t ? "right" : e ? "left" : "none";
1192
1782
  }
1193
- function oe(s) {
1194
- const e = st(s), t = ae(s.startArrowStyle), r = ae(s.endArrowStyle);
1783
+ function Me(s) {
1784
+ const e = Bt(s), t = _e(s.startArrowStyle), r = _e(s.endArrowStyle);
1195
1785
  return {
1196
1786
  arrowMode: e,
1197
1787
  startArrowStyle: t,
1198
1788
  endArrowStyle: r
1199
1789
  };
1200
1790
  }
1201
- function nt(s, e) {
1791
+ function Ut(s, e) {
1202
1792
  const t = s.options;
1203
1793
  return `${t.strokeColor}|${t.strokeWidth}|${t.strokeOpacity}|${t.fillColor}|${t.fillOpacity}|${e}|${t.fontColor ?? ""}|${t.fontSize ?? ""}`;
1204
1794
  }
1205
- class at {
1795
+ class Wt {
1206
1796
  /** 标绘 id → 渲染记录 */
1207
1797
  _entries = /* @__PURE__ */ new Map();
1208
1798
  /** 由 GroundDecalManager 写入的标绘集合(引用共享) */
@@ -1211,10 +1801,13 @@ class at {
1211
1801
  _opacity = 1;
1212
1802
  /** 挂载场景 */
1213
1803
  _scene;
1804
+ /** 图片资源异步就绪后请求宿主刷新;按 URL 去重监听 */
1805
+ _requestRender;
1806
+ _watchedImageUrls = /* @__PURE__ */ new Set();
1214
1807
  /** 已释放标记 */
1215
1808
  _disposed = !1;
1216
1809
  constructor(e) {
1217
- this._scene = e.scene;
1810
+ this._scene = e.scene, this._requestRender = e.requestRender;
1218
1811
  }
1219
1812
  // ── 协议 ──
1220
1813
  /** 接收 GroundDecalManager 交付的 Map */
@@ -1246,26 +1839,26 @@ class at {
1246
1839
  this._shapes.has(t) || (this._scene.remove(r.group), r.primitive.dispose(), this._entries.delete(t));
1247
1840
  let e = 0;
1248
1841
  for (const [t, r] of this._shapes) {
1249
- const i = Ke(e);
1842
+ const i = yt(e);
1250
1843
  e += 1;
1251
- const n = this._entries.get(t), a = it(r), o = nt(r, this._opacity);
1252
- if (n !== void 0 && n.signature === a && (this._supportsStyleHotUpdate(n.primitive) || n.styleSignature === o)) {
1253
- this._refreshLightweight(n, i), n.styleSignature = o;
1844
+ const n = this._entries.get(t), o = Gt(r), l = Ut(r, this._opacity);
1845
+ if (n !== void 0 && n.signature === o && (this._supportsStyleHotUpdate(n) || n.styleSignature === l)) {
1846
+ this._refreshLightweight(n, i), n.styleSignature = l;
1254
1847
  continue;
1255
1848
  }
1256
1849
  n !== void 0 && (this._scene.remove(n.group), n.primitive.dispose(), this._entries.delete(t));
1257
- const d = this._buildPrimitive(r, i);
1258
- if (d === null) continue;
1259
- const l = ne(d);
1260
- l.visible = r.options.visible !== !1, this._scene.add(l);
1261
- const h = {
1850
+ const h = this._buildPrimitive(r, i);
1851
+ if (h === null) continue;
1852
+ const c = we(h);
1853
+ c.visible = r.options.visible !== !1, this._scene.add(c);
1854
+ const d = {
1262
1855
  plot: r,
1263
- primitive: d,
1264
- group: l,
1265
- signature: a,
1266
- styleSignature: o
1856
+ primitive: h,
1857
+ group: c,
1858
+ signature: o,
1859
+ styleSignature: l
1267
1860
  };
1268
- this._entries.set(t, h), d instanceof k && this._refreshLightweight(h, i);
1861
+ this._entries.set(t, d), h instanceof N && this._refreshLightweight(d, i);
1269
1862
  }
1270
1863
  }
1271
1864
  /**
@@ -1287,10 +1880,11 @@ class at {
1287
1880
  // ── 内部:轻量刷新 / 样式热更新支持判定 ──
1288
1881
  /**
1289
1882
  * 当前图元是否支持样式热更新(颜色 / 描边等)。
1290
- * 折线(setColor / setWidth)与文字(setText)支持;面类不支持,需重建。
1883
+ * 折线(setColor / setWidth)、文字(setText)和图片点透明度支持;面类不支持,需重建。
1291
1884
  */
1292
1885
  _supportsStyleHotUpdate(e) {
1293
- return e instanceof R || e instanceof k;
1886
+ const { primitive: t, plot: r } = e;
1887
+ return t instanceof D || t instanceof N || t instanceof F && r.options.pointStyle === "image";
1294
1888
  }
1295
1889
  /**
1296
1890
  * 几何未变时的轻量刷新:
@@ -1299,21 +1893,25 @@ class at {
1299
1893
  * - 文字:setText(内容 + 颜色 + 不透明度)/ setVisible(不重建图元)。
1300
1894
  */
1301
1895
  _refreshLightweight(e, t) {
1302
- if (e.group.visible = e.plot.options.visible !== !1, e.primitive.setRenderOrder?.(t), e.primitive instanceof R) {
1896
+ if (e.group.visible = e.plot.options.visible !== !1, e.primitive.setRenderOrder?.(t), e.primitive instanceof D) {
1303
1897
  const r = e.plot.options, {
1304
1898
  startArrowStyle: i,
1305
1899
  endArrowStyle: n
1306
- } = oe(r);
1900
+ } = Me(r);
1307
1901
  e.primitive.setColor(
1308
1902
  r.strokeColor,
1309
1903
  (r.strokeOpacity ?? 100) * this._opacity
1310
1904
  );
1311
- const a = typeof r.strokeWidth == "number" && r.strokeWidth > 0 ? r.strokeWidth : 5;
1312
- e.primitive.setWidth(a), e.primitive.setArrowStyles(i, n);
1313
- const o = Math.max(a * 4, 1), d = Math.max(a * 3, 0.8);
1314
- e.primitive.setArrowSizeMeters(o, d), e.primitive.setVisible(r.visible !== !1);
1905
+ const o = typeof r.strokeWidth == "number" && r.strokeWidth > 0 ? r.strokeWidth : 5;
1906
+ e.primitive.setWidth(o), e.primitive.setArrowStyles(i, n);
1907
+ const l = Math.max(o * 4, 1), h = Math.max(o * 3, 0.8);
1908
+ e.primitive.setArrowSizeMeters(l, h), e.primitive.setVisible(r.visible !== !1);
1315
1909
  }
1316
- if (e.primitive instanceof k) {
1910
+ if (e.primitive instanceof F) {
1911
+ const r = e.plot.options;
1912
+ r.pointStyle === "image" && e.primitive.setImageOpacity((r.fillOpacity ?? 100) * this._opacity);
1913
+ }
1914
+ if (e.primitive instanceof N) {
1317
1915
  const r = e.plot.options;
1318
1916
  e.primitive.setText({
1319
1917
  content: r.content,
@@ -1337,7 +1935,7 @@ class at {
1337
1935
  offsetEastMeters: r.offsetX,
1338
1936
  offsetNorthMeters: r.offsetY,
1339
1937
  metersPerPixel: r.scale
1340
- }), e.primitive.setVisible(r.visible !== !1), e.group = ne(e.primitive), e.group.visible = r.visible !== !1;
1938
+ }), e.primitive.setVisible(r.visible !== !1), e.group = we(e.primitive), e.group.visible = r.visible !== !1;
1341
1939
  }
1342
1940
  }
1343
1941
  // ── 内部:按 category 构建图元 ──
@@ -1348,165 +1946,184 @@ class at {
1348
1946
  * @returns 渲染图元;未知类型 / 退化情况返回 null。
1349
1947
  */
1350
1948
  _buildPrimitive(e, t) {
1351
- const r = e.options, i = r.points ?? [], n = this._opacity, a = (r.strokeOpacity ?? 100) * n, o = (r.fillOpacity ?? 100) * n, d = r.visible !== !1;
1949
+ const r = e.options, i = r.points ?? [], n = this._opacity, o = (r.strokeOpacity ?? 100) * n, l = (r.fillOpacity ?? 100) * n, h = r.visible !== !1;
1352
1950
  switch (e.category) {
1353
1951
  case "point": {
1354
1952
  if (i.length === 0) return null;
1355
- const l = r;
1356
- if (l.pointStyle === "image") {
1357
- const h = rt(l);
1358
- return h ? new re({
1953
+ const c = r;
1954
+ if (c.pointStyle === "image") {
1955
+ const d = Lt(c);
1956
+ return d ? (this._watchImageTexture(d), new F({
1359
1957
  position: i[0],
1360
1958
  shape: "image",
1361
- imageUrl: h,
1362
- imageWidth: l.imageWidth,
1363
- imageHeight: l.imageHeight,
1364
- rotation: l.rotation ?? 0,
1365
- strokeColor: l.strokeColor,
1366
- strokeWidth: l.strokeWidth ?? 0,
1367
- strokeOpacity: a,
1368
- fillColor: l.fillColor,
1369
- fillOpacity: o,
1370
- visible: d,
1959
+ imageUrl: d,
1960
+ imageWidth: c.imageWidth,
1961
+ imageHeight: c.imageHeight,
1962
+ rotation: c.rotation ?? 0,
1963
+ strokeColor: c.strokeColor,
1964
+ strokeWidth: c.strokeWidth ?? 0,
1965
+ strokeOpacity: o,
1966
+ fillColor: c.fillColor,
1967
+ fillOpacity: l,
1968
+ visible: h,
1371
1969
  renderOrder: t
1372
- }) : (console.warn(`[soonspacejs] Unknown point image ontology id: ${l.ontologyId ?? ""}`), null);
1970
+ })) : (console.warn(`[soonspacejs] Unknown point image ontology id: ${c.ontologyId ?? ""}`), null);
1373
1971
  }
1374
- return new re({
1972
+ return new F({
1375
1973
  position: i[0],
1376
- shape: l.pointStyle ?? "circle",
1377
- size: l.size ?? 100,
1378
- strokeColor: l.strokeColor,
1379
- strokeWidth: l.strokeWidth ?? 0,
1380
- strokeOpacity: a,
1381
- fillColor: l.fillColor,
1382
- fillOpacity: o,
1383
- visible: d,
1974
+ shape: c.pointStyle ?? "circle",
1975
+ size: c.size ?? 100,
1976
+ strokeColor: c.strokeColor,
1977
+ strokeWidth: c.strokeWidth ?? 0,
1978
+ strokeOpacity: o,
1979
+ fillColor: c.fillColor,
1980
+ fillOpacity: l,
1981
+ visible: h,
1384
1982
  renderOrder: t
1385
1983
  });
1386
1984
  }
1387
1985
  case "circle": {
1388
1986
  if (i.length === 0) return null;
1389
- const l = r;
1390
- return new te({
1987
+ const c = r;
1988
+ return new ge({
1391
1989
  center: i[0],
1392
- radius: l.radius ?? 100,
1393
- strokeColor: l.strokeColor,
1394
- strokeWidth: l.strokeWidth ?? 0,
1395
- strokeOpacity: a,
1396
- fillColor: l.fillColor,
1397
- fillOpacity: o,
1398
- visible: d,
1990
+ radius: c.radius ?? 100,
1991
+ strokeColor: c.strokeColor,
1992
+ strokeWidth: c.strokeWidth ?? 0,
1993
+ strokeOpacity: o,
1994
+ fillColor: c.fillColor,
1995
+ fillOpacity: l,
1996
+ visible: h,
1399
1997
  renderOrder: t
1400
1998
  });
1401
1999
  }
1402
2000
  case "sector": {
1403
2001
  if (i.length === 0) return null;
1404
- const l = r;
1405
- return new te({
2002
+ const c = r;
2003
+ return new ge({
1406
2004
  center: i[0],
1407
- radius: l.radius ?? 100,
1408
- strokeColor: l.strokeColor,
1409
- strokeWidth: l.strokeWidth ?? 0,
1410
- strokeOpacity: a,
1411
- fillColor: l.fillColor,
1412
- fillOpacity: o,
1413
- visible: d,
1414
- sectorStartDegrees: l.startAngle ?? 0,
1415
- sectorAngleDegrees: l.sectorAngle ?? 360,
2005
+ radius: c.radius ?? 100,
2006
+ strokeColor: c.strokeColor,
2007
+ strokeWidth: c.strokeWidth ?? 0,
2008
+ strokeOpacity: o,
2009
+ fillColor: c.fillColor,
2010
+ fillOpacity: l,
2011
+ visible: h,
2012
+ sectorStartDegrees: c.startAngle ?? 0,
2013
+ sectorAngleDegrees: c.sectorAngle ?? 360,
1416
2014
  renderOrder: t
1417
2015
  });
1418
2016
  }
1419
2017
  case "polygon":
1420
2018
  case "rectangle":
1421
- return i.length < 3 ? null : new ee({
2019
+ return i.length < 3 ? null : new ue({
1422
2020
  points: i,
1423
2021
  strokeColor: r.strokeColor,
1424
2022
  strokeWidth: r.strokeWidth ?? 0,
1425
- strokeOpacity: a,
2023
+ strokeOpacity: o,
1426
2024
  fillColor: r.fillColor,
1427
- fillOpacity: o,
1428
- visible: d,
2025
+ fillOpacity: l,
2026
+ visible: h,
1429
2027
  renderOrder: t
1430
2028
  });
1431
2029
  case "arrow": {
1432
- const l = e.generateCoords();
1433
- if (l.length < 3) return null;
1434
- const h = r;
1435
- return new ee({
1436
- points: l,
1437
- strokeColor: h.strokeColor,
1438
- strokeWidth: h.strokeWidth ?? 0,
1439
- strokeOpacity: a,
1440
- fillColor: h.fillColor,
1441
- fillOpacity: o,
1442
- visible: d,
2030
+ const c = e.generateCoords();
2031
+ if (c.length < 3) return null;
2032
+ const d = r;
2033
+ return new ue({
2034
+ points: c,
2035
+ strokeColor: d.strokeColor,
2036
+ strokeWidth: d.strokeWidth ?? 0,
2037
+ strokeOpacity: o,
2038
+ fillColor: d.fillColor,
2039
+ fillOpacity: l,
2040
+ visible: h,
1443
2041
  renderOrder: t
1444
2042
  });
1445
2043
  }
1446
2044
  case "line": {
1447
2045
  if (i.length < 2) return null;
1448
- const l = r, {
1449
- arrowMode: h,
1450
- startArrowStyle: c,
1451
- endArrowStyle: y
1452
- } = oe(l), _ = l.strokeStyle === "dashed", p = _ ? 60 : void 0, g = _ ? 40 : void 0, m = typeof l.strokeWidth == "number" && l.strokeWidth > 0 ? l.strokeWidth : 5, S = Math.max(m * 4, 1), w = Math.max(m * 3, 0.8);
1453
- return new R({
2046
+ const c = r, {
2047
+ arrowMode: d,
2048
+ startArrowStyle: f,
2049
+ endArrowStyle: v
2050
+ } = Me(c), M = c.strokeStyle === "dashed", y = M ? 60 : void 0, m = M ? 40 : void 0, w = typeof c.strokeWidth == "number" && c.strokeWidth > 0 ? c.strokeWidth : 5, k = Math.max(w * 4, 1), T = Math.max(w * 3, 0.8);
2051
+ return new D({
1454
2052
  points: i,
1455
- strokeColor: l.strokeColor,
1456
- strokeOpacity: a,
2053
+ strokeColor: c.strokeColor,
2054
+ strokeOpacity: o,
1457
2055
  widthMode: "world",
1458
- widthMeters: m,
1459
- visible: d,
1460
- arrowMode: h,
1461
- arrowStyle: c,
1462
- startArrowStyle: c,
1463
- endArrowStyle: y,
2056
+ widthMeters: w,
2057
+ visible: h,
2058
+ arrowMode: d,
2059
+ arrowStyle: f,
2060
+ startArrowStyle: f,
2061
+ endArrowStyle: v,
1464
2062
  arrowWidthMode: "world",
1465
- arrowLengthMeters: S,
1466
- arrowWidthMeters: w,
1467
- dashLengthMeters: p,
1468
- gapLengthMeters: g,
2063
+ arrowLengthMeters: k,
2064
+ arrowWidthMeters: T,
2065
+ dashLengthMeters: y,
2066
+ gapLengthMeters: m,
1469
2067
  renderOrder: t
1470
2068
  });
1471
2069
  }
1472
2070
  case "text": {
1473
2071
  if (i.length === 0) return null;
1474
- const l = r;
1475
- return new k({
2072
+ const c = r;
2073
+ return new N({
1476
2074
  points: [i[0]],
1477
- content: l.content,
1478
- fontColor: l.fontColor,
1479
- fontSize: l.fontSize,
1480
- fillColor: l.fillColor,
1481
- fillOpacity: o,
1482
- strokeColor: l.strokeColor,
1483
- strokeOpacity: a,
1484
- strokeWidth: l.strokeWidth ?? 0,
1485
- textAlign: l.textAlign,
1486
- verticalAlign: l.verticalAlign,
1487
- anchorX: l.anchorX,
1488
- anchorY: l.anchorY,
1489
- layoutDirection: l.layoutDirection,
1490
- rotation: l.rotation,
1491
- boxWidth: l.boxWidth,
1492
- boxHeight: l.boxHeight,
1493
- padding: l.padding,
1494
- showBorder: l.showBorder,
1495
- visible: d,
2075
+ content: c.content,
2076
+ fontColor: c.fontColor,
2077
+ fontSize: c.fontSize,
2078
+ fillColor: c.fillColor,
2079
+ fillOpacity: l,
2080
+ strokeColor: c.strokeColor,
2081
+ strokeOpacity: o,
2082
+ strokeWidth: c.strokeWidth ?? 0,
2083
+ textAlign: c.textAlign,
2084
+ verticalAlign: c.verticalAlign,
2085
+ anchorX: c.anchorX,
2086
+ anchorY: c.anchorY,
2087
+ layoutDirection: c.layoutDirection,
2088
+ rotation: c.rotation,
2089
+ boxWidth: c.boxWidth,
2090
+ boxHeight: c.boxHeight,
2091
+ padding: c.padding,
2092
+ showBorder: c.showBorder,
2093
+ visible: h,
1496
2094
  renderOrder: t,
1497
2095
  // offsetX / offsetY → ENU 米偏移
1498
- offsetEastMeters: l.offsetX,
1499
- offsetNorthMeters: l.offsetY,
2096
+ offsetEastMeters: c.offsetX,
2097
+ offsetNorthMeters: c.offsetY,
1500
2098
  // scale → metersPerPixel(无 scale 时不传,默认 1.0)
1501
- metersPerPixel: l.scale
2099
+ metersPerPixel: c.scale
1502
2100
  });
1503
2101
  }
1504
2102
  default:
1505
2103
  return null;
1506
2104
  }
1507
2105
  }
2106
+ /**
2107
+ * 贴地图元依赖异步 TextureLoader,而 SoonSpace 默认按需渲染;
2108
+ * 图片解码完成后若没有新的渲染请求,纹理会等到相机交互才首次显示。
2109
+ * 用原生 Image 监听资源就绪并通知宿主,按 URL 去重避免重复监听。
2110
+ */
2111
+ _watchImageTexture(e) {
2112
+ const t = e.trim();
2113
+ if (t.length === 0 || this._watchedImageUrls.has(t) || typeof Image > "u") return;
2114
+ this._watchedImageUrls.add(t);
2115
+ const r = new Image();
2116
+ r.crossOrigin = "anonymous";
2117
+ let i = !1;
2118
+ const n = () => {
2119
+ i || (i = !0, this._watchedImageUrls.delete(t), r.onload = null, r.onerror = null, !this._disposed && (this._requestRender?.(), requestAnimationFrame(() => {
2120
+ this._disposed || this._requestRender?.();
2121
+ })));
2122
+ };
2123
+ r.onload = n, r.onerror = n, r.src = t, r.complete && queueMicrotask(n);
2124
+ }
1508
2125
  }
1509
- class ot {
2126
+ class zt {
1510
2127
  /** 标绘 id → 实例;与桥接器的 shapes 共用同一引用 */
1511
2128
  _items = /* @__PURE__ */ new Map();
1512
2129
  /** 标绘管理器 id(对外常量,保持与参考项目一致) */
@@ -1519,8 +2136,13 @@ class ot {
1519
2136
  _overlayAttached = !1;
1520
2137
  /** 合并同一帧内多次 _markDirty,值为 requestAnimationFrame 句柄 */
1521
2138
  _redrawTimer = null;
2139
+ /** 由 TerrainTilesRenderer 提供的场景包围盒计算器。 */
2140
+ _boundingBoxResolver;
1522
2141
  constructor(e) {
1523
- this.ssp = e.ssp, this._bridge = new at({ scene: e.ssp.viewport.scene });
2142
+ this.ssp = e.ssp, this._boundingBoxResolver = e.boundingBoxResolver, this._bridge = new Wt({
2143
+ scene: e.ssp.viewport.scene,
2144
+ requestRender: () => this.ssp.render()
2145
+ });
1524
2146
  }
1525
2147
  /** 暴露内部桥接器,业务若需自定义场景接入可选择性使用 */
1526
2148
  get bridge() {
@@ -1541,11 +2163,11 @@ class ot {
1541
2163
  setPlotSDFPlugin(e) {
1542
2164
  this._overlayAttached = !1, this._items.size > 0 && this._markDirty();
1543
2165
  }
1544
- // ── 图形创建:返回字符串 id ──
2166
+ // ── 图形创建:返回 Three.js 数字 id ──
1545
2167
  /**
1546
2168
  * 添加标绘:由 options.type 决定实例化哪一类 GisPlot*。
1547
2169
  *
1548
- * @returns 新建标绘的自增字符串 id。
2170
+ * @returns 新建标绘继承自 Object3D 的数字 id。
1549
2171
  * @throws 当 options.type 未知时抛错。
1550
2172
  */
1551
2173
  addPlot(e) {
@@ -1553,58 +2175,71 @@ class ot {
1553
2175
  switch (e.type) {
1554
2176
  case "point": {
1555
2177
  const { type: r, ...i } = e;
1556
- t = new Je(i);
2178
+ t = new it(i);
1557
2179
  break;
1558
2180
  }
1559
2181
  case "line": {
1560
2182
  const { type: r, ...i } = e;
1561
- t = new We(i);
2183
+ t = new st(i);
1562
2184
  break;
1563
2185
  }
1564
2186
  case "polygon": {
1565
2187
  const { type: r, ...i } = e;
1566
- t = new $e(i);
2188
+ t = new nt(i);
1567
2189
  break;
1568
2190
  }
1569
2191
  case "rectangle": {
1570
2192
  const { type: r, ...i } = e;
1571
- t = new ze(i);
2193
+ t = new ot(i);
1572
2194
  break;
1573
2195
  }
1574
2196
  case "circle": {
1575
2197
  const { type: r, ...i } = e;
1576
- t = new Xe(i);
2198
+ t = new ut(i);
1577
2199
  break;
1578
2200
  }
1579
2201
  case "sector": {
1580
2202
  const { type: r, ...i } = e;
1581
- t = new He(i);
2203
+ t = new lt(i);
1582
2204
  break;
1583
2205
  }
1584
2206
  case "text": {
1585
2207
  const { type: r, ...i } = e;
1586
- t = new Qe(i);
2208
+ t = new ht(i);
1587
2209
  break;
1588
2210
  }
1589
2211
  case "arrow": {
1590
2212
  const { type: r, ...i } = e;
1591
- t = new je(i);
2213
+ t = new ct(i);
1592
2214
  break;
1593
2215
  }
1594
2216
  default:
1595
2217
  throw new Error("GroundDecalManager.addPlot: unknown type");
1596
2218
  }
1597
- return this._items.set(t.id, t), this._markDirty(), t.id;
2219
+ return this._boundingBoxResolver && t.setBoundingBoxResolver(this._boundingBoxResolver), this._items.set(t.id, t), this.ssp.addObject(t), this._markDirty(), t.id;
1598
2220
  }
1599
2221
  /** 按 id 移除标绘;存在并删除成功时触发重绘 */
1600
2222
  remove(e) {
1601
- this._items.delete(e) && this._markDirty();
2223
+ const t = this._items.get(e);
2224
+ t && (this._items.delete(e), this.ssp.removeObject(t), this._markDirty());
1602
2225
  }
1603
2226
  /** 清空全部标绘 */
1604
2227
  clear() {
1605
- this._items.clear(), this._markDirty();
2228
+ this._items.forEach((e) => this.ssp.removeObject(e)), this._items.clear(), this._markDirty();
1606
2229
  }
1607
2230
  // ── 查询与修改 ──
2231
+ /**
2232
+ * 返回所有标绘项的 [id, GisPlotBase] 数组(浅拷贝,避免外部修改 _items)。
2233
+ * 业务可用来遍历所有标绘项,或在渲染循环中做自定义处理。
2234
+ * 注意:返回的 GisPlotBase 实例仍是原对象,修改其 options 会影响 _items。
2235
+ */
2236
+ getAllItems() {
2237
+ return Array.from(this._items.entries().map(([e, t]) => t));
2238
+ }
2239
+ /** 地形重定向或切换后清除全部标绘的场景包围盒缓存。 */
2240
+ invalidateBoundingBoxes() {
2241
+ this._items.forEach((e) => e.invalidateBoundingBox());
2242
+ }
1608
2243
  /**
1609
2244
  * 读取标绘浅快照(options 为新对象,points 仍共享引用;箭头附带 generatedCoords)。
1610
2245
  *
@@ -1706,11 +2341,12 @@ class ot {
1706
2341
  */
1707
2342
  findNearestCoord(e, t, r) {
1708
2343
  const i = this._items.get(e);
1709
- if (!i || !i.options.points || i.options.points.length === 0) return -1;
1710
- let n = 0, a = 1 / 0;
1711
- for (let o = 0; o < i.options.points.length; o++) {
1712
- const d = i.options.points[o][0] - t, l = i.options.points[o][1] - r, h = d * d + l * l;
1713
- h < a && (a = h, n = o);
2344
+ if (!i || !i.options.points || i.options.points.length === 0)
2345
+ return -1;
2346
+ let n = 0, o = 1 / 0;
2347
+ for (let l = 0; l < i.options.points.length; l++) {
2348
+ const h = i.options.points[l][0] - t, c = i.options.points[l][1] - r, d = h * h + c * c;
2349
+ d < o && (o = d, n = l);
1714
2350
  }
1715
2351
  return n;
1716
2352
  }
@@ -1733,7 +2369,7 @@ class ot {
1733
2369
  };
1734
2370
  /** 释放桥接器内部全部图元与场景挂载 */
1735
2371
  dispose() {
1736
- this._bridge.dispose();
2372
+ this._items.forEach((e) => this.ssp.removeObject(e)), this._items.clear(), this._bridge.dispose();
1737
2373
  }
1738
2374
  /**
1739
2375
  * 标记下一帧重绘;同帧多次调用只调度一次。
@@ -1745,22 +2381,90 @@ class ot {
1745
2381
  }));
1746
2382
  }
1747
2383
  }
1748
- const lt = "https://sooncps.xwbuilders.com/api/ugis-dataprocess/v1/terrain/NhBLlMx3/", dt = "https://c.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png";
1749
- class kt {
2384
+ const Oe = 5e4, Jt = 10, $t = 10, jt = 10, Ht = 12, Qt = "文本内容";
2385
+ function Yt(s, e) {
2386
+ const { group: t, ellipsoid: r } = s.tiles, i = p.degToRad(e[1]), n = p.degToRad(e[0]), o = new a();
2387
+ r.getCartographicToPosition(
2388
+ i,
2389
+ n,
2390
+ Oe,
2391
+ o
2392
+ );
2393
+ const l = new a();
2394
+ r.getCartographicToNormal(i, n, l);
2395
+ const h = o.applyMatrix4(t.matrixWorld), c = l.transformDirection(t.matrixWorld).negate().normalize();
2396
+ return new Be(
2397
+ h,
2398
+ c,
2399
+ 0,
2400
+ Oe * 2
2401
+ ).intersectObject(t, !0)[0]?.point.clone() ?? null;
2402
+ }
2403
+ function Ae(s, e) {
2404
+ const t = [];
2405
+ s.tiles.group.updateMatrixWorld(!0);
2406
+ for (const r of e) {
2407
+ const i = Yt(s, r);
2408
+ i && t.push(i);
2409
+ }
2410
+ return t;
2411
+ }
2412
+ function Fe(s, e, t) {
2413
+ if (t.length === 0) return null;
2414
+ const r = new te();
2415
+ if (t.forEach((i) => r.expandByPoint(i)), (s === "circle" || s === "sector") && typeof e.radius == "number" && r.expandByScalar(e.radius), s === "text") {
2416
+ const i = e.fontSize ?? Ht, n = Math.max(
2417
+ (e.content ?? Qt).length,
2418
+ 1
2419
+ ), o = e.scale ?? 1;
2420
+ r.expandByScalar(i * n * o / 2);
2421
+ }
2422
+ if (s === "point") {
2423
+ const i = e.pointStyle === "image" ? Math.max(
2424
+ e.imageWidth ?? $t,
2425
+ e.imageHeight ?? jt
2426
+ ) : e.size ?? Jt;
2427
+ r.expandByScalar(i / 2);
2428
+ }
2429
+ return r.isEmpty() ? null : r;
2430
+ }
2431
+ function Xt(s, e) {
2432
+ const t = e.options, r = e.category === "arrow" ? e.generateCoords() : t.points, i = Ae(
2433
+ s,
2434
+ Array.isArray(r) ? r : []
2435
+ );
2436
+ return Fe(e.category, t, i);
2437
+ }
2438
+ function Vt(s, e, t = 200) {
2439
+ const r = s.groundDecalManager?.getItem(e);
2440
+ if (!r) return !1;
2441
+ const i = r.options, n = r.type === "arrow" && "generatedCoords" in r && r.generatedCoords.length > 0 ? r.generatedCoords : i.points, o = Ae(
2442
+ s,
2443
+ Array.isArray(n) ? n : []
2444
+ ), l = Fe(r.type, i, o);
2445
+ return l ? (globalThis.setTimeout(() => {
2446
+ s.ssp.flyToObj(l, "frontTop");
2447
+ }, Math.max(0, t)), !0) : !1;
2448
+ }
2449
+ const qt = "https://sooncps.xwbuilders.com/api/ugis-dataprocess/v1/terrain/NhBLlMx3/", Zt = "https://c.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png";
2450
+ class vr {
1750
2451
  constructor(e, t = {}) {
1751
2452
  this.ssp = e, this.options = t;
1752
- const r = t.baseUrl || lt;
1753
- if (this.resourceManager = new Ge(), this.terrainManager = new Fe(), t.imageryUrl !== !1) {
1754
- const i = t.imageryUrl || dt;
2453
+ const r = t.baseUrl || qt;
2454
+ if (this.resourceManager = new tt(), this.terrainManager = new rt(), t.imageryUrl !== !1) {
2455
+ const i = t.imageryUrl || Zt;
1755
2456
  this.resourceManager.addOverlay({
1756
2457
  id: this.defaultImageryId,
1757
2458
  type: u.XYZ,
1758
2459
  options: { id: this.defaultImageryId, url: i, type: u.XYZ }
1759
2460
  });
1760
2461
  }
1761
- this.groundDecalManager = new ot({ ssp: this.ssp }), ke(), this._alphaClipMode = t.alphaClipMode ?? "alphaTest", this._currentTerrainConfig = {
2462
+ this.groundDecalManager = new zt({
2463
+ ssp: this.ssp,
2464
+ boundingBoxResolver: (i) => Xt(this, i)
2465
+ }), Qe(), this._alphaClipMode = t.alphaClipMode ?? "alphaTest", this._currentTerrainConfig = {
1762
2466
  id: this.defaultTerrainId,
1763
- type: M.QUANTIZED_MESH,
2467
+ type: x.QUANTIZED_MESH,
1764
2468
  url: r
1765
2469
  }, this.terrainManager.add(this._currentTerrainConfig), this.terrainManager.setCurrentId(this._currentTerrainConfig.id), this.tiles = this._initTilesRenderer(this._currentTerrainConfig), this._initPlugins(this.tiles, this._currentTerrainConfig);
1766
2470
  }
@@ -1779,9 +2483,9 @@ class kt {
1779
2483
  * 供 cesium-to-three 标绘图元的 RTE 着色器使用。标绘几何烘焙在绝对 ECEF,只有用
1780
2484
  * ECEF 相机投影才能与「重定向后地形」对齐,同时保持 reorientation 开启(地形不抖)。
1781
2485
  */
1782
- _plotVirtualCamera = new V();
1783
- _reorientInverse = new b();
1784
- _virtualScale = new Oe();
2486
+ _plotVirtualCamera = new ce();
2487
+ _reorientInverse = new g();
2488
+ _virtualScale = new a();
1785
2489
  /** 资源管理器(存储配置) */
1786
2490
  resourceManager;
1787
2491
  /** 地形管理器(记录地形列表) */
@@ -1802,7 +2506,7 @@ class kt {
1802
2506
  * 是否使用 Cesium Ion 地形
1803
2507
  */
1804
2508
  get isCesiumIon() {
1805
- return this._currentTerrainConfig.type === M.CESIUM_ION;
2509
+ return this._currentTerrainConfig.type === x.CESIUM_ION;
1806
2510
  }
1807
2511
  /**
1808
2512
  * 获取当前地形配置
@@ -1848,9 +2552,9 @@ class kt {
1848
2552
  this._alphaClipMode = e, this.customMaterialPlugin && (this.customMaterialPlugin.alphaClipMode = e), this._updateAlphaClipMode(), this.render();
1849
2553
  }
1850
2554
  _initTilesRenderer(e) {
1851
- return e.type === M.CESIUM_ION ? new T() : (
2555
+ return e.type === x.CESIUM_ION ? new E() : (
1852
2556
  // Cesium Ion 由插件设置 URL
1853
- new T(e.url)
2557
+ new E(e.url)
1854
2558
  );
1855
2559
  }
1856
2560
  /**
@@ -1858,35 +2562,35 @@ class kt {
1858
2562
  * @param config 地形配置
1859
2563
  */
1860
2564
  _initPlugins(e, t) {
1861
- if (this.tilesFadePlugin = new B({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new H(), e.registerPlugin(this.tilesFadePlugin), e.registerPlugin(this.updateOnChangePlugin), t.type === M.CESIUM_ION ? e.registerPlugin(
1862
- new ge({
2565
+ if (this.tilesFadePlugin = new re({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new ie(), e.registerPlugin(this.tilesFadePlugin), e.registerPlugin(this.updateOnChangePlugin), t.type === x.CESIUM_ION ? e.registerPlugin(
2566
+ new Pe({
1863
2567
  apiToken: t.apiToken,
1864
2568
  assetId: t.assetId || "1",
1865
2569
  autoRefreshToken: t.autoRefreshToken ?? !0,
1866
2570
  assetTypeHandler: (r, i) => {
1867
2571
  r === "TERRAIN" && i.getPluginByName("QUANTIZED_MESH_PLUGIN") === null && i.registerPlugin(
1868
- new J({ useRecommendedSettings: !0 })
2572
+ new Q({ useRecommendedSettings: !0 })
1869
2573
  );
1870
2574
  }
1871
2575
  })
1872
2576
  ) : (e.registerPlugin(
1873
- new J({ useRecommendedSettings: !0 })
2577
+ new Q({ useRecommendedSettings: !0 })
1874
2578
  ), e.fetchData = async (r) => {
1875
2579
  const i = { method: "GET", mode: "cors" };
1876
2580
  if (/layer\.json$/.test(r)) {
1877
- const n = await fetch(r, i).then((a) => a.json());
2581
+ const n = await fetch(r, i).then((o) => o.json());
1878
2582
  return n.metadataAvailability = -1, new Response(JSON.stringify(n));
1879
2583
  }
1880
2584
  return fetch(r, i);
1881
- }), this.options.useCustomMaterial !== !1 && (this.customMaterialPlugin = new De(), this.customMaterialPlugin.alphaClipMode = this._alphaClipMode, e.registerPlugin(this.customMaterialPlugin)), this.imageOverlayPlugin = new ce({
2585
+ }), this.options.useCustomMaterial !== !1 && (this.customMaterialPlugin = new et(), this.customMaterialPlugin.alphaClipMode = this._alphaClipMode, e.registerPlugin(this.customMaterialPlugin)), this.imageOverlayPlugin = new ke({
1882
2586
  renderer: this.ssp.viewport.renderer,
1883
2587
  overlays: []
1884
- }), e.registerPlugin(this.imageOverlayPlugin), this._ensureGlobeDepth(), this.overlayManager = new N(
2588
+ }), e.registerPlugin(this.imageOverlayPlugin), this._ensureGlobeDepth(), this.overlayManager = new B(
1885
2589
  this.imageOverlayPlugin,
1886
2590
  this.resourceManager
1887
2591
  ), this.overlayManager.restoreFromResourceManager(), this.options.reorientation !== !1) {
1888
2592
  const r = this.options.reorientation || { lon: 120, lat: 30 };
1889
- this.reorientationPlugin = new j({
2593
+ this.reorientationPlugin = new se({
1890
2594
  lon: r.lon,
1891
2595
  lat: r.lat,
1892
2596
  height: r.height ?? 0.1
@@ -1940,12 +2644,23 @@ class kt {
1940
2644
  * })
1941
2645
  */
1942
2646
  setTerrain(e, t = void 0) {
1943
- if (t && (this.options = { ...this.options, ...t }), this.terrainManager.has(e.id) || this.terrainManager.add(e), this.terrainManager.setCurrentId(e.id), this.terrainManager.currentId === e.id) {
2647
+ if (this.groundDecalManager?.invalidateBoundingBoxes(), t && (this.options = { ...this.options, ...t }), this.terrainManager.has(e.id) || this.terrainManager.add(e), this.terrainManager.setCurrentId(e.id), this.terrainManager.currentId === e.id) {
1944
2648
  const r = this.terrainManager.getCurrent();
1945
- e.type === M.QUANTIZED_MESH && r?.type === M.QUANTIZED_MESH && (r.url = e.url);
2649
+ e.type === x.QUANTIZED_MESH && r?.type === x.QUANTIZED_MESH && (r.url = e.url);
1946
2650
  }
1947
2651
  this._disposeTilesRenderer(), this._currentTerrainConfig = e, this.tiles = this._initTilesRenderer(e), this._initPlugins(this.tiles, e), this._enabled && this.ssp.addObject(this.tiles.group), this.render();
1948
2652
  }
2653
+ // =============== 标绘快捷方法 ===============
2654
+ /**
2655
+ * 根据 groundDecalManager.addPlot 返回的 id 飞向标绘。
2656
+ *
2657
+ * @param plotId 标绘 id。
2658
+ * @param delay 延迟执行时间(毫秒),默认 200ms。
2659
+ * @returns true 表示已安排飞向;false 表示标绘或当前地形坐标不可用。
2660
+ */
2661
+ flyToPlotById(e, t = 200) {
2662
+ return Vt(this, e, t);
2663
+ }
1949
2664
  // =============== Overlay 快捷方法 ===============
1950
2665
  /**
1951
2666
  * 添加 Overlay
@@ -2112,15 +2827,15 @@ class kt {
2112
2827
  };
2113
2828
  beforeRenderHandler = () => {
2114
2829
  const { camera: e, renderer: t, scene: r } = this.ssp.viewport;
2115
- if (e.updateMatrixWorld(), this.tiles.setCamera(e), this.tiles.setResolutionFromRenderer(e, t), this.tiles.update(), this.groundDecalManager && e instanceof V) {
2116
- const i = this._ensureGlobeDepth(), n = t.domElement.width, a = t.domElement.height;
2117
- (i.target.width !== n || i.target.height !== a) && i.resize(n, a), xe(e.near, e.far), i.render(t, e, r, this.tiles.group);
2118
- const o = this._buildPlotVirtualCamera(e);
2830
+ if (e.updateMatrixWorld(), this.tiles.setCamera(e), this.tiles.setResolutionFromRenderer(e, t), this.tiles.update(), this.groundDecalManager && e instanceof ce) {
2831
+ const i = this._ensureGlobeDepth(), n = t.domElement.width, o = t.domElement.height;
2832
+ (i.target.width !== n || i.target.height !== o) && i.resize(n, o), Ye(e.near, e.far), i.render(t, e, r, this.tiles.group);
2833
+ const l = this._buildPlotVirtualCamera(e);
2119
2834
  this.groundDecalManager.update({
2120
2835
  depthTexture: i.target.texture,
2121
2836
  width: n,
2122
- height: a,
2123
- camera: o,
2837
+ height: o,
2838
+ camera: l,
2124
2839
  pixelRatio: t.getPixelRatio()
2125
2840
  });
2126
2841
  }
@@ -2151,7 +2866,7 @@ class kt {
2151
2866
  _ensureGlobeDepth() {
2152
2867
  if (!this._globeDepth) {
2153
2868
  const { renderer: e } = this.ssp.viewport;
2154
- this._globeDepth = new Re(
2869
+ this._globeDepth = new Xe(
2155
2870
  e.domElement.width,
2156
2871
  e.domElement.height
2157
2872
  );
@@ -2159,13 +2874,13 @@ class kt {
2159
2874
  return this._globeDepth;
2160
2875
  }
2161
2876
  enable() {
2162
- this._enabled = !0, this.ssp.viewport.camera.layers.enable(Ie), this.ssp.addObject(this.tiles.group), this.ssp.signals.beforeRender.add(this.beforeRenderHandler);
2877
+ this._enabled = !0, this.ssp.viewport.camera.layers.enable(Ve), this.ssp.addObject(this.tiles.group), this.ssp.signals.beforeRender.add(this.beforeRenderHandler);
2163
2878
  }
2164
2879
  disable() {
2165
2880
  this._enabled = !1, this.ssp.removeObject(this.tiles.group), this.ssp.signals.beforeRender.remove(this.beforeRenderHandler);
2166
2881
  }
2167
2882
  invalidate(e, t, r) {
2168
- if (!this.reorientationPlugin)
2883
+ if (this.groundDecalManager?.invalidateBoundingBoxes(), !this.reorientationPlugin)
2169
2884
  return console.warn(
2170
2885
  "TilesRenderer: reorientationPlugin is not enabled, invalidate() will not work."
2171
2886
  ), () => {
@@ -2177,12 +2892,12 @@ class kt {
2177
2892
  height: r
2178
2893
  };
2179
2894
  const n = () => {
2180
- const o = f.degToRad(t), d = f.degToRad(e);
2181
- i.transformLatLonHeightToOrigin(o, d, r), this.render(), a();
2182
- }, a = () => {
2895
+ const l = p.degToRad(t), h = p.degToRad(e);
2896
+ i.transformLatLonHeightToOrigin(l, h, r), this.render(), o();
2897
+ }, o = () => {
2183
2898
  this.tiles.removeEventListener("load-root-tileset", n), this.loedTilesSets.delete(n);
2184
2899
  };
2185
- return this.tiles.addEventListener("load-root-tileset", n), this.loedTilesSets.add(n), this.tiles.root && n(), a;
2900
+ return this.tiles.addEventListener("load-root-tileset", n), this.loedTilesSets.add(n), this.tiles.root && n(), o;
2186
2901
  }
2187
2902
  dispose() {
2188
2903
  this.disable(), this.terrainManager.dispose(), this.overlayManager.dispose(), this.groundDecalManager?.dispose(), this._globeDepth?.dispose(), this._globeDepth = void 0, this.loedTilesSets.forEach(
@@ -2190,12 +2905,12 @@ class kt {
2190
2905
  ), this.loedTilesSets.clear(), this.tiles.removeEventListener("needs-render", this.render), this.tiles.removeEventListener("needs-update", this.render), this.tiles.dispose();
2191
2906
  }
2192
2907
  }
2193
- const C = {
2908
+ const P = {
2194
2909
  DEFAULT: 0,
2195
2910
  GRADIENT: 1,
2196
2911
  TOPOGRAPHIC_LINES: 2,
2197
2912
  LIGHTING: 3
2198
- }, ht = {
2913
+ }, Kt = {
2199
2914
  vertexShader: (
2200
2915
  /* glsl */
2201
2916
  `
@@ -2221,7 +2936,7 @@ const C = {
2221
2936
  }
2222
2937
  `
2223
2938
  )
2224
- }, ut = {
2939
+ }, er = {
2225
2940
  vertexShader: (
2226
2941
  /* glsl */
2227
2942
  `
@@ -2267,10 +2982,10 @@ const C = {
2267
2982
  `
2268
2983
  )
2269
2984
  };
2270
- let D = null, G = null, F = null;
2271
- class ct {
2985
+ let J = null, $ = null, j = null;
2986
+ class tr {
2272
2987
  constructor(e, t) {
2273
- this.ssp = e, this.options = t, "url" in this.options ? this.tiles = new T(this.options.url) : (this.tiles = new T(), this._initCesiumIon(this.options)), this._initBasePlugins(this.options);
2988
+ this.ssp = e, this.options = t, "url" in this.options ? this.tiles = new E(this.options.url) : (this.tiles = new E(), this._initCesiumIon(this.options)), this._initBasePlugins(this.options);
2274
2989
  }
2275
2990
  tiles;
2276
2991
  tilesFadePlugin;
@@ -2278,10 +2993,10 @@ class ct {
2278
2993
  reorientationPlugin;
2279
2994
  options;
2280
2995
  // 用于模型居中
2281
- _box = new Me();
2282
- _sphere = new ue();
2996
+ _box = new te();
2997
+ _sphere = new G();
2283
2998
  // 当前材质类型
2284
- _materialType = C.DEFAULT;
2999
+ _materialType = P.DEFAULT;
2285
3000
  // 按需渲染标志
2286
3001
  _needsUpdate = !0;
2287
3002
  _cameraTransitionStart = !1;
@@ -2291,7 +3006,7 @@ class ct {
2291
3006
  */
2292
3007
  _initCesiumIon(e) {
2293
3008
  this.tiles.registerPlugin(
2294
- new ge({
3009
+ new Pe({
2295
3010
  apiToken: e.apiToken,
2296
3011
  assetId: e.assetId,
2297
3012
  autoRefreshToken: e.autoRefreshToken ?? !0
@@ -2302,9 +3017,9 @@ class ct {
2302
3017
  * 初始化基础插件
2303
3018
  */
2304
3019
  _initBasePlugins(e) {
2305
- if (e._managedByPlugin || (D === null ? D = this.tiles.lruCache : this.tiles.lruCache = D, G === null ? G = this.tiles.parseQueue : this.tiles.parseQueue = G, F === null ? F = this.tiles.downloadQueue : this.tiles.downloadQueue = F, this.tiles.lruCache.maxSize = 600, this.tiles.lruCache.minSize = 300, this.tiles.lruCache.unloadPercent = 0.8), this._setupGLTFLoader(), this.tilesFadePlugin = new B({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new H(), this.tiles.registerPlugin(this.tilesFadePlugin), this.tiles.registerPlugin(this.updateOnChangePlugin), this.tiles.maxDepth = e.maxDepth ?? 20, this.tiles.errorTarget = e.errorTarget ?? 2, this.options.reorientation) {
3020
+ if (e._managedByPlugin || (J === null ? J = this.tiles.lruCache : this.tiles.lruCache = J, $ === null ? $ = this.tiles.parseQueue : this.tiles.parseQueue = $, j === null ? j = this.tiles.downloadQueue : this.tiles.downloadQueue = j, this.tiles.lruCache.maxSize = 600, this.tiles.lruCache.minSize = 300, this.tiles.lruCache.unloadPercent = 0.8), this._setupGLTFLoader(), this.tilesFadePlugin = new re({ maximumFadeOutTiles: 200 }), this.updateOnChangePlugin = new ie(), this.tiles.registerPlugin(this.tilesFadePlugin), this.tiles.registerPlugin(this.updateOnChangePlugin), this.tiles.maxDepth = e.maxDepth ?? 20, this.tiles.errorTarget = e.errorTarget ?? 2, this.options.reorientation) {
2306
3021
  const t = this.options.reorientation || { lon: 120, lat: 30 };
2307
- this.reorientationPlugin = new j({
3022
+ this.reorientationPlugin = new se({
2308
3023
  lon: t.lon,
2309
3024
  lat: t.lat,
2310
3025
  height: t.height ?? 0.1
@@ -2320,7 +3035,7 @@ class ct {
2320
3035
  * 设置 GLTF Loader
2321
3036
  */
2322
3037
  _setupGLTFLoader() {
2323
- const e = new de(this.tiles.manager), t = this.ssp.manager?.store?.modelManager;
3038
+ const e = new be(this.tiles.manager), t = this.ssp.manager?.store?.modelManager;
2324
3039
  if (t?.gltfLoader) {
2325
3040
  const { dracoLoader: r, ktx2Loader: i, meshoptDecoder: n } = t.gltfLoader;
2326
3041
  r && e.setDRACOLoader(r), i && e.setKTX2Loader(i), n && e.setMeshoptDecoder(n);
@@ -2364,7 +3079,7 @@ class ct {
2364
3079
  onLoadModel = ({ scene: e }) => {
2365
3080
  e.traverse((t) => {
2366
3081
  t.isMesh && (t.originalMaterial = t.material);
2367
- }), this._materialType !== C.DEFAULT && this.updateMaterial(e);
3082
+ }), this._materialType !== P.DEFAULT && this.updateMaterial(e);
2368
3083
  };
2369
3084
  /**
2370
3085
  * 更新场景中所有网格的材质(参考 customMaterial.js)
@@ -2374,19 +3089,19 @@ class ct {
2374
3089
  e.traverse((r) => {
2375
3090
  if (r.isMesh)
2376
3091
  switch (r.material && r.material !== r.originalMaterial && r.material.dispose(), t) {
2377
- case C.DEFAULT:
3092
+ case P.DEFAULT:
2378
3093
  r.material = r.originalMaterial, r.material && (r.material.side = 2), r.receiveShadow = !1, r.castShadow = !1;
2379
3094
  break;
2380
- case C.GRADIENT:
2381
- r.material = new Z(ht), r.material.side = 2, r.receiveShadow = !1, r.castShadow = !1;
3095
+ case P.GRADIENT:
3096
+ r.material = new he(Kt), r.material.side = 2, r.receiveShadow = !1, r.castShadow = !1;
2382
3097
  break;
2383
- case C.TOPOGRAPHIC_LINES: {
2384
- const i = new Z(ut);
3098
+ case P.TOPOGRAPHIC_LINES: {
3099
+ const i = new he(er);
2385
3100
  i.extensions = { derivatives: !0 }, i.side = 2, r.material = i, r.receiveShadow = !1, r.castShadow = !1;
2386
3101
  break;
2387
3102
  }
2388
- case C.LIGHTING:
2389
- r.material = new Se(), r.material.side = 2, r.receiveShadow = !0, r.castShadow = !0;
3103
+ case P.LIGHTING:
3104
+ r.material = new Ue(), r.material.side = 2, r.receiveShadow = !0, r.castShadow = !0;
2390
3105
  break;
2391
3106
  }
2392
3107
  });
@@ -2433,12 +3148,12 @@ class ct {
2433
3148
  height: r
2434
3149
  };
2435
3150
  const n = () => {
2436
- const o = f.degToRad(t), d = f.degToRad(e);
2437
- i.transformLatLonHeightToOrigin(o, d, r), this.render(), a();
2438
- }, a = () => {
3151
+ const l = p.degToRad(t), h = p.degToRad(e);
3152
+ i.transformLatLonHeightToOrigin(l, h, r), this.render(), o();
3153
+ }, o = () => {
2439
3154
  this.tiles.removeEventListener("load-root-tileset", n), this.loedTilesSets.delete(n);
2440
3155
  };
2441
- return this.tiles.addEventListener("load-root-tileset", n), this.loedTilesSets.add(n), this.tiles.root && n(), a;
3156
+ return this.tiles.addEventListener("load-root-tileset", n), this.loedTilesSets.add(n), this.tiles.root && n(), o;
2442
3157
  }
2443
3158
  dispose() {
2444
3159
  this.disable(), this.loedTilesSets.forEach(
@@ -2446,8 +3161,8 @@ class ct {
2446
3161
  ), this.loedTilesSets.clear(), this.tiles.removeEventListener("load-model", this.onLoadModel), this.tiles.removeEventListener("dispose-model", this.onDisposeModel), this.options._managedByPlugin || (this.tiles.removeEventListener("load-model", this._onNeedsRender), this.tiles.removeEventListener("needs-render", this._onNeedsRender), this.tiles.removeEventListener("needs-update", this._onNeedsRender)), this.tiles.dispose();
2447
3162
  }
2448
3163
  }
2449
- const U = 2;
2450
- class xt {
3164
+ const H = 2;
3165
+ class wr {
2451
3166
  constructor(e) {
2452
3167
  this.ssp = e;
2453
3168
  const { controls: t, viewport: r } = e;
@@ -2468,12 +3183,12 @@ class xt {
2468
3183
  _downloadQueue = null;
2469
3184
  _referenceOrigin = null;
2470
3185
  _referencePlacements = /* @__PURE__ */ new WeakMap();
2471
- _referenceFrame = new b();
2472
- _targetFrame = new b();
2473
- _sourceFrame = new b();
2474
- _placementMatrix = new b();
2475
- _upCorrectionMatrix = new b();
2476
- _boundingSphere = new ue();
3186
+ _referenceFrame = new g();
3187
+ _targetFrame = new g();
3188
+ _sourceFrame = new g();
3189
+ _placementMatrix = new g();
3190
+ _upCorrectionMatrix = new g();
3191
+ _boundingSphere = new G();
2477
3192
  _beforeRenderHandler = () => {
2478
3193
  this.needsUpdate && (this.needsUpdate = !1, this.ssp.viewport.camera.updateMatrixWorld(), this.tilesMap.forEach((e) => {
2479
3194
  e.tiles.setCamera(this.ssp.viewport.camera), e.tiles.setResolutionFromRenderer(this.ssp.viewport.camera, this.ssp.viewport.renderer), e.applyAutoCenter(), e.tiles.group.updateMatrixWorld(), e.tiles.update();
@@ -2513,21 +3228,21 @@ class xt {
2513
3228
  async loadTiles(e) {
2514
3229
  const t = "url" in e ? e.url : e.assetId;
2515
3230
  if (this.tilesMap.has(t))
2516
- return I.utils.warn(`${t} already loaded`), this.tilesMap.get(t);
2517
- const { ssp: r } = this, i = this._getReferencePlacement(e), n = this._getTilesRendererOptions(e, i), a = new ct(r, {
3231
+ return L.utils.warn(`${t} already loaded`), this.tilesMap.get(t);
3232
+ const { ssp: r } = this, i = this._getReferencePlacement(e), n = this._getTilesRendererOptions(e, i), o = new tr(r, {
2518
3233
  ...n,
2519
3234
  _managedByPlugin: !0
2520
3235
  });
2521
- i && (this._referencePlacements.set(a, i), a.options.reorientation = i);
2522
- const { tiles: o } = a;
2523
- this._lruCache === null ? this._lruCache = o.lruCache : o.lruCache = this._lruCache, this._parseQueue === null ? this._parseQueue = o.parseQueue : o.parseQueue = this._parseQueue, this._downloadQueue === null ? this._downloadQueue = o.downloadQueue : o.downloadQueue = this._downloadQueue, o.lruCache.maxSize = 600, o.lruCache.minSize = 300, o.lruCache.unloadPercent = 0.8, this.tilesMap.set(t, a), o.setCamera(this._tilesCamera), o.setResolutionFromRenderer(this._tilesCamera, r.viewport.renderer), r.addObject(o.group), this._referenceOrigin && this.applyReferencePlacement(a, i);
2524
- const d = () => {
3236
+ i && (this._referencePlacements.set(o, i), o.options.reorientation = i);
3237
+ const { tiles: l } = o;
3238
+ this._lruCache === null ? this._lruCache = l.lruCache : l.lruCache = this._lruCache, this._parseQueue === null ? this._parseQueue = l.parseQueue : l.parseQueue = this._parseQueue, this._downloadQueue === null ? this._downloadQueue = l.downloadQueue : l.downloadQueue = this._downloadQueue, l.lruCache.maxSize = 600, l.lruCache.minSize = 300, l.lruCache.unloadPercent = 0.8, this.tilesMap.set(t, o), l.setCamera(this._tilesCamera), l.setResolutionFromRenderer(this._tilesCamera, r.viewport.renderer), r.addObject(l.group), this._referenceOrigin && this.applyReferencePlacement(o, i);
3239
+ const h = () => {
2525
3240
  this.cameraTransitionStart || (this.needsUpdate = !0, r.render());
2526
3241
  };
2527
- return o.addEventListener("load-model", d), new Promise((l) => {
2528
- o.addEventListener("load-tile-set", () => {
2529
- const h = this._referencePlacements.get(a);
2530
- this._referenceOrigin && this.applyReferencePlacement(a, h ?? null), d(), l(a);
3242
+ return l.addEventListener("load-model", h), new Promise((c) => {
3243
+ l.addEventListener("load-tile-set", () => {
3244
+ const d = this._referencePlacements.get(o);
3245
+ this._referenceOrigin && this.applyReferencePlacement(o, d ?? null), h(), c(o);
2531
3246
  });
2532
3247
  });
2533
3248
  }
@@ -2561,41 +3276,41 @@ class xt {
2561
3276
  }), this.tilesMap.clear();
2562
3277
  }
2563
3278
  invalidate(e, t, r, i) {
2564
- (i ? [i] : Array.from(this.tilesMap.values())).forEach((a) => {
2565
- const o = this._referencePlacements.get(a) ?? null;
2566
- this._referenceOrigin ? this.applyReferencePlacement(a, {
2567
- ...o ?? {},
3279
+ (i ? [i] : Array.from(this.tilesMap.values())).forEach((o) => {
3280
+ const l = this._referencePlacements.get(o) ?? null;
3281
+ this._referenceOrigin ? this.applyReferencePlacement(o, {
3282
+ ...l ?? {},
2568
3283
  lon: e,
2569
3284
  lat: t,
2570
3285
  height: r
2571
- }) : a.invalidate(e, t, r);
3286
+ }) : o.invalidate(e, t, r);
2572
3287
  });
2573
3288
  }
2574
3289
  applyReferencePlacement(e, t) {
2575
3290
  if (!this._referenceOrigin)
2576
- return I.utils.warn("TilesRendererManager: reference origin is not set."), !1;
2577
- const { ellipsoid: r, group: i } = e.tiles, n = this._referenceOrigin, a = this._isGeoreferenced(e);
3291
+ return L.utils.warn("TilesRendererManager: reference origin is not set."), !1;
3292
+ const { ellipsoid: r, group: i } = e.tiles, n = this._referenceOrigin, o = this._isGeoreferenced(e);
2578
3293
  if (r.getObjectFrame(
2579
- f.degToRad(n.lat),
2580
- f.degToRad(n.lon),
3294
+ p.degToRad(n.lat),
3295
+ p.degToRad(n.lon),
2581
3296
  n.height ?? 0.1,
2582
3297
  0,
2583
3298
  0,
2584
3299
  0,
2585
3300
  this._referenceFrame,
2586
- U
3301
+ H
2587
3302
  ), this._placementMatrix.copy(this._referenceFrame).invert(), t)
2588
3303
  r.getObjectFrame(
2589
- f.degToRad(t.lat),
2590
- f.degToRad(t.lon),
3304
+ p.degToRad(t.lat),
3305
+ p.degToRad(t.lon),
2591
3306
  t.height ?? 0,
2592
3307
  0,
2593
3308
  0,
2594
3309
  0,
2595
3310
  this._targetFrame,
2596
- U
2597
- ), this._placementMatrix.multiply(this._targetFrame), a ? (this._sourceFrame.copy(this._getSourceFrame(e)).invert(), this._placementMatrix.multiply(this._sourceFrame)) : (this._getUpCorrectionMatrix(t.up ?? "+z"), this._placementMatrix.multiply(this._upCorrectionMatrix));
2598
- else if (!a)
3311
+ H
3312
+ ), this._placementMatrix.multiply(this._targetFrame), o ? (this._sourceFrame.copy(this._getSourceFrame(e)).invert(), this._placementMatrix.multiply(this._sourceFrame)) : (this._getUpCorrectionMatrix(t.up ?? "+z"), this._placementMatrix.multiply(this._upCorrectionMatrix));
3313
+ else if (!o)
2599
3314
  return !1;
2600
3315
  return i.matrix.copy(this._placementMatrix), i.matrix.decompose(i.position, i.quaternion, i.scale), i.updateMatrixWorld(!0), t && (this._referencePlacements.set(e, t), e.options.reorientation = t), this.needsUpdate = !0, e.render(), !0;
2601
3316
  }
@@ -2619,7 +3334,7 @@ class xt {
2619
3334
  0,
2620
3335
  0,
2621
3336
  this._sourceFrame,
2622
- U
3337
+ H
2623
3338
  ), this._sourceFrame;
2624
3339
  }
2625
3340
  _getReferencePlacement(e) {
@@ -2665,228 +3380,230 @@ class xt {
2665
3380
  this.clear(), this.ssp.signals.beforeRender.remove(this._beforeRenderHandler), this.ssp.signals.cameraObjectChange.remove(this._onCameraObjectChange), this._lruCache = null, this._parseQueue = null, this._downloadQueue = null;
2666
3381
  }
2667
3382
  }
2668
- function Rt(s) {
3383
+ function _r(s) {
2669
3384
  if (s == null) return [0, 0, 0, 0];
2670
3385
  const e = String(s).trim().toLowerCase();
2671
3386
  if (e === "" || e === "transparent") return [0, 0, 0, 0];
2672
3387
  const t = /^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/.exec(e);
2673
3388
  if (t !== null) {
2674
- const i = Number(t[1]) / 255, n = Number(t[2]) / 255, a = Number(t[3]) / 255, o = Number(t[4]);
2675
- return [v(i), v(n), v(a), v(o)];
3389
+ const i = Number(t[1]) / 255, n = Number(t[2]) / 255, o = Number(t[3]) / 255, l = Number(t[4]);
3390
+ return [_(i), _(n), _(o), _(l)];
2676
3391
  }
2677
3392
  const r = /^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/.exec(e);
2678
3393
  if (r !== null) {
2679
- const i = Number(r[1]) / 255, n = Number(r[2]) / 255, a = Number(r[3]) / 255;
2680
- return [v(i), v(n), v(a), 1];
3394
+ const i = Number(r[1]) / 255, n = Number(r[2]) / 255, o = Number(r[3]) / 255;
3395
+ return [_(i), _(n), _(o), 1];
2681
3396
  }
2682
3397
  if (e.startsWith("#")) {
2683
3398
  const i = e.slice(1);
2684
3399
  if (i.length === 3) {
2685
- const n = parseInt(i[0] + i[0], 16) / 255, a = parseInt(i[1] + i[1], 16) / 255, o = parseInt(i[2] + i[2], 16) / 255;
2686
- if (Number.isFinite(n) && Number.isFinite(a) && Number.isFinite(o))
2687
- return [n, a, o, 1];
3400
+ const n = parseInt(i[0] + i[0], 16) / 255, o = parseInt(i[1] + i[1], 16) / 255, l = parseInt(i[2] + i[2], 16) / 255;
3401
+ if (Number.isFinite(n) && Number.isFinite(o) && Number.isFinite(l))
3402
+ return [n, o, l, 1];
2688
3403
  } else if (i.length === 6) {
2689
- const n = parseInt(i.slice(0, 2), 16) / 255, a = parseInt(i.slice(2, 4), 16) / 255, o = parseInt(i.slice(4, 6), 16) / 255;
2690
- if (Number.isFinite(n) && Number.isFinite(a) && Number.isFinite(o))
2691
- return [n, a, o, 1];
3404
+ const n = parseInt(i.slice(0, 2), 16) / 255, o = parseInt(i.slice(2, 4), 16) / 255, l = parseInt(i.slice(4, 6), 16) / 255;
3405
+ if (Number.isFinite(n) && Number.isFinite(o) && Number.isFinite(l))
3406
+ return [n, o, l, 1];
2692
3407
  } else if (i.length === 8) {
2693
- const n = parseInt(i.slice(0, 2), 16) / 255, a = parseInt(i.slice(2, 4), 16) / 255, o = parseInt(i.slice(4, 6), 16) / 255, d = parseInt(i.slice(6, 8), 16) / 255;
2694
- if (Number.isFinite(n) && Number.isFinite(a) && Number.isFinite(o) && Number.isFinite(d))
2695
- return [n, a, o, d];
3408
+ const n = parseInt(i.slice(0, 2), 16) / 255, o = parseInt(i.slice(2, 4), 16) / 255, l = parseInt(i.slice(4, 6), 16) / 255, h = parseInt(i.slice(6, 8), 16) / 255;
3409
+ if (Number.isFinite(n) && Number.isFinite(o) && Number.isFinite(l) && Number.isFinite(h))
3410
+ return [n, o, l, h];
2696
3411
  }
2697
3412
  }
2698
3413
  return [1, 1, 1, 1];
2699
3414
  }
2700
- function It(s, e) {
2701
- typeof s.fillOpacity == "number" && Number.isFinite(s.fillOpacity) ? e[0] = v(s.fillOpacity / 100) : typeof s.opacity == "number" && Number.isFinite(s.opacity) ? e[0] = v(s.opacity) : e[0] = 1, typeof s.strokeOpacity == "number" && Number.isFinite(s.strokeOpacity) ? e[1] = v(s.strokeOpacity / 100) : typeof s.opacity == "number" && Number.isFinite(s.opacity) ? e[1] = v(s.opacity) : e[1] = 1;
3415
+ function Mr(s, e) {
3416
+ typeof s.fillOpacity == "number" && Number.isFinite(s.fillOpacity) ? e[0] = _(s.fillOpacity / 100) : typeof s.opacity == "number" && Number.isFinite(s.opacity) ? e[0] = _(s.opacity) : e[0] = 1, typeof s.strokeOpacity == "number" && Number.isFinite(s.strokeOpacity) ? e[1] = _(s.strokeOpacity / 100) : typeof s.opacity == "number" && Number.isFinite(s.opacity) ? e[1] = _(s.opacity) : e[1] = 1;
2702
3417
  }
2703
- function v(s) {
3418
+ function _(s) {
2704
3419
  return !Number.isFinite(s) || s < 0 ? 0 : s > 1 ? 1 : s;
2705
3420
  }
2706
- const le = 100, Q = 1e-4;
2707
- function P(s, e) {
3421
+ const Se = 100, ne = 1e-4;
3422
+ function I(s, e) {
2708
3423
  const t = s[0] - e[0], r = s[1] - e[1];
2709
3424
  return Math.sqrt(t * t + r * r);
2710
3425
  }
2711
- function pt(s) {
3426
+ function rr(s) {
2712
3427
  let e = 0;
2713
3428
  for (let t = 0; t < s.length - 1; t++)
2714
- e += P(s[t], s[t + 1]);
3429
+ e += I(s[t], s[t + 1]);
2715
3430
  return e;
2716
3431
  }
2717
- function Nt(s) {
2718
- return Math.pow(pt(s), 0.99);
3432
+ function Or(s) {
3433
+ return Math.pow(rr(s), 0.99);
2719
3434
  }
2720
- function _e(s, e) {
3435
+ function De(s, e) {
2721
3436
  return [(s[0] + e[0]) / 2, (s[1] + e[1]) / 2];
2722
3437
  }
2723
- function z(s, e) {
3438
+ function ee(s, e) {
2724
3439
  let t;
2725
3440
  const r = Math.asin(
2726
- Math.abs(e[1] - s[1]) / P(s, e)
3441
+ Math.abs(e[1] - s[1]) / I(s, e)
2727
3442
  );
2728
3443
  return e[1] >= s[1] && e[0] >= s[0] ? t = r + Math.PI : e[1] >= s[1] && e[0] < s[0] ? t = Math.PI * 2 - r : e[1] < s[1] && e[0] < s[0] ? t = r : t = Math.PI - r, t;
2729
3444
  }
2730
- function At(s, e, t) {
2731
- const r = z(e, s) - z(e, t);
3445
+ function Sr(s, e, t) {
3446
+ const r = ee(e, s) - ee(e, t);
2732
3447
  return r < 0 ? r + Math.PI * 2 : r;
2733
3448
  }
2734
- function gt(s, e, t) {
3449
+ function ir(s, e, t) {
2735
3450
  return (t[1] - s[1]) * (e[0] - s[0]) > (e[1] - s[1]) * (t[0] - s[0]);
2736
3451
  }
2737
- function Lt(s, e, t, r, i) {
2738
- const n = z(s, e), a = i ? n + t : n - t, o = r * Math.cos(a), d = r * Math.sin(a);
2739
- return [e[0] + o, e[1] + d];
3452
+ function br(s, e, t, r, i) {
3453
+ const n = ee(s, e), o = i ? n + t : n - t, l = r * Math.cos(o), h = r * Math.sin(o);
3454
+ return [e[0] + l, e[1] + h];
2740
3455
  }
2741
- function Y(s, e, t) {
3456
+ function oe(s, e, t) {
2742
3457
  let r = s[0] - e[0], i = s[1] - e[1];
2743
3458
  const n = Math.sqrt(r * r + i * i);
2744
3459
  r /= n, i /= n;
2745
- let a = t[0] - e[0], o = t[1] - e[1];
2746
- const d = Math.sqrt(a * a + o * o);
2747
- return a /= d, o /= d, [r + a, i + o];
3460
+ let o = t[0] - e[0], l = t[1] - e[1];
3461
+ const h = Math.sqrt(o * o + l * l);
3462
+ return o /= h, l /= h, [r + o, i + l];
2748
3463
  }
2749
- function X(s, e, t, r) {
2750
- const i = Y(e, t, r);
2751
- let n, a, o, d, l;
2752
- const h = Math.sqrt(i[0] * i[0] + i[1] * i[1]), c = i[0] / h, y = i[1] / h, _ = P(e, t), p = P(t, r);
2753
- return h > Q ? gt(e, t, r) ? (o = s * _, d = t[0] - o * y, l = t[1] + o * c, n = [d, l], o = s * p, d = t[0] + o * y, l = t[1] - o * c, a = [d, l]) : (o = s * _, d = t[0] + o * y, l = t[1] - o * c, n = [d, l], o = s * p, d = t[0] - o * y, l = t[1] + o * c, a = [d, l]) : (d = t[0] + s * (e[0] - t[0]), l = t[1] + s * (e[1] - t[1]), n = [d, l], d = t[0] + s * (r[0] - t[0]), l = t[1] + s * (r[1] - t[1]), a = [d, l]), [n, a];
3464
+ function ae(s, e, t, r) {
3465
+ const i = oe(e, t, r);
3466
+ let n, o, l, h, c;
3467
+ const d = Math.sqrt(i[0] * i[0] + i[1] * i[1]), f = i[0] / d, v = i[1] / d, M = I(e, t), y = I(t, r);
3468
+ return d > ne ? ir(e, t, r) ? (l = s * M, h = t[0] - l * v, c = t[1] + l * f, n = [h, c], l = s * y, h = t[0] + l * v, c = t[1] - l * f, o = [h, c]) : (l = s * M, h = t[0] + l * v, c = t[1] - l * f, n = [h, c], l = s * y, h = t[0] - l * v, c = t[1] + l * f, o = [h, c]) : (h = t[0] + s * (e[0] - t[0]), c = t[1] + s * (e[1] - t[1]), n = [h, c], h = t[0] + s * (r[0] - t[0]), c = t[1] + s * (r[1] - t[1]), o = [h, c]), [n, o];
2754
3469
  }
2755
- function ft(s) {
2756
- const e = s[0], t = s[1], r = s[2], n = X(0, e, t, r)[0], a = Y(e, t, r), o = Math.sqrt(a[0] * a[0] + a[1] * a[1]);
2757
- let d;
2758
- if (o > Q) {
2759
- const l = _e(e, t), h = e[0] - l[0], c = e[1] - l[1], _ = 2 / P(e, t), p = -_ * c, g = _ * h, m = p * p - g * g, S = 2 * p * g, w = g * g - p * p, x = n[0] - l[0], E = n[1] - l[1];
2760
- d = [
2761
- l[0] + m * x + S * E,
2762
- l[1] + S * x + w * E
3470
+ function sr(s) {
3471
+ const e = s[0], t = s[1], r = s[2], n = ae(0, e, t, r)[0], o = oe(e, t, r), l = Math.sqrt(o[0] * o[0] + o[1] * o[1]);
3472
+ let h;
3473
+ if (l > ne) {
3474
+ const c = De(e, t), d = e[0] - c[0], f = e[1] - c[1], M = 2 / I(e, t), y = -M * f, m = M * d, w = y * y - m * m, k = 2 * y * m, T = m * m - y * y, A = n[0] - c[0], R = n[1] - c[1];
3475
+ h = [
3476
+ c[0] + w * A + k * R,
3477
+ c[1] + k * A + T * R
2763
3478
  ];
2764
3479
  } else
2765
- d = [
2766
- e[0] + A(1) * (t[0] - e[0]),
2767
- e[1] + A(1) * (t[1] - e[1])
3480
+ h = [
3481
+ e[0] + U(1) * (t[0] - e[0]),
3482
+ e[1] + U(1) * (t[1] - e[1])
2768
3483
  ];
2769
- return d;
3484
+ return h;
2770
3485
  }
2771
- function A(s) {
3486
+ function U(s) {
2772
3487
  return 0.3 * s;
2773
3488
  }
2774
- function yt(s) {
2775
- const e = s.length, t = s[e - 3], r = s[e - 2], i = s[e - 1], a = X(0, t, r, i)[1], o = Y(t, r, i), d = Math.sqrt(o[0] * o[0] + o[1] * o[1]);
2776
- let l;
2777
- if (d > Q) {
2778
- const h = _e(r, i), c = i[0] - h[0], y = i[1] - h[1], p = 2 / P(r, i), g = -p * y, m = p * c, S = g * g - m * m, w = 2 * g * m, x = m * m - g * g, E = a[0] - h[0], q = a[1] - h[1];
2779
- l = [
2780
- h[0] + S * E + w * q,
2781
- h[1] + w * E + x * q
3489
+ function nr(s) {
3490
+ const e = s.length, t = s[e - 3], r = s[e - 2], i = s[e - 1], o = ae(0, t, r, i)[1], l = oe(t, r, i), h = Math.sqrt(l[0] * l[0] + l[1] * l[1]);
3491
+ let c;
3492
+ if (h > ne) {
3493
+ const d = De(r, i), f = i[0] - d[0], v = i[1] - d[1], y = 2 / I(r, i), m = -y * v, w = y * f, k = m * m - w * w, T = 2 * m * w, A = w * w - m * m, R = o[0] - d[0], le = o[1] - d[1];
3494
+ c = [
3495
+ d[0] + k * R + T * le,
3496
+ d[1] + T * R + A * le
2782
3497
  ];
2783
3498
  } else
2784
- l = [
2785
- i[0] + A(1) * (r[0] - i[0]),
2786
- i[1] + A(1) * (r[1] - i[1])
3499
+ c = [
3500
+ i[0] + U(1) * (r[0] - i[0]),
3501
+ i[1] + U(1) * (r[1] - i[1])
2787
3502
  ];
2788
- return l;
3503
+ return c;
2789
3504
  }
2790
- function Dt(s, e) {
2791
- const r = [ft(e)];
2792
- for (let a = 0; a < e.length - 2; a++) {
2793
- const o = e[a], d = e[a + 1], l = e[a + 2], h = X(s, o, d, l);
2794
- r.push(h[0], h[1]);
3505
+ function Cr(s, e) {
3506
+ const r = [sr(e)];
3507
+ for (let o = 0; o < e.length - 2; o++) {
3508
+ const l = e[o], h = e[o + 1], c = e[o + 2], d = ae(s, l, h, c);
3509
+ r.push(d[0], d[1]);
2795
3510
  }
2796
- const i = yt(e);
3511
+ const i = nr(e);
2797
3512
  r.push(i);
2798
3513
  const n = [];
2799
- for (let a = 0; a < e.length - 1; a++) {
2800
- const o = e[a], d = e[a + 1];
2801
- n.push(o);
2802
- for (let l = 0; l < le; l++) {
2803
- const h = l / le, c = Math.pow(1 - h, 3) * o[0] + 3 * h * Math.pow(1 - h, 2) * r[a * 2][0] + 3 * h * h * (1 - h) * r[a * 2 + 1][0] + Math.pow(h, 3) * d[0], y = Math.pow(1 - h, 3) * o[1] + 3 * h * Math.pow(1 - h, 2) * r[a * 2][1] + 3 * h * h * (1 - h) * r[a * 2 + 1][1] + Math.pow(h, 3) * d[1];
2804
- n.push([c, y]);
3514
+ for (let o = 0; o < e.length - 1; o++) {
3515
+ const l = e[o], h = e[o + 1];
3516
+ n.push(l);
3517
+ for (let c = 0; c < Se; c++) {
3518
+ const d = c / Se, f = Math.pow(1 - d, 3) * l[0] + 3 * d * Math.pow(1 - d, 2) * r[o * 2][0] + 3 * d * d * (1 - d) * r[o * 2 + 1][0] + Math.pow(d, 3) * h[0], v = Math.pow(1 - d, 3) * l[1] + 3 * d * Math.pow(1 - d, 2) * r[o * 2][1] + 3 * d * d * (1 - d) * r[o * 2 + 1][1] + Math.pow(d, 3) * h[1];
3519
+ n.push([f, v]);
2805
3520
  }
2806
- n.push(d);
3521
+ n.push(h);
2807
3522
  }
2808
3523
  return n;
2809
3524
  }
2810
- function Gt(s) {
3525
+ function xr(s) {
2811
3526
  if (s.length <= 2) return s;
2812
3527
  const e = 2, t = [], r = s.length - e - 1;
2813
3528
  t.push(s[0]);
2814
3529
  for (let i = 0; i <= r; i++)
2815
3530
  for (let n = 0; n <= 1; n += 0.05) {
2816
- let a = 0, o = 0;
2817
- for (let d = 0; d <= e; d++) {
2818
- const l = mt(d, n);
2819
- a += l * s[i + d][0], o += l * s[i + d][1];
3531
+ let o = 0, l = 0;
3532
+ for (let h = 0; h <= e; h++) {
3533
+ const c = or(h, n);
3534
+ o += c * s[i + h][0], l += c * s[i + h][1];
2820
3535
  }
2821
- t.push([a, o]);
3536
+ t.push([o, l]);
2822
3537
  }
2823
3538
  return t.push(s[s.length - 1]), t;
2824
3539
  }
2825
- function mt(s, e) {
3540
+ function or(s, e) {
2826
3541
  return s === 0 ? Math.pow(e - 1, 2) / 2 : s === 1 ? (-2 * Math.pow(e, 2) + 2 * e + 1) / 2 : s === 2 ? Math.pow(e, 2) / 2 : 0;
2827
3542
  }
2828
- function Ft(s, e) {
2829
- return W(s, e);
3543
+ function kr(s, e) {
3544
+ return Y(s, e);
2830
3545
  }
2831
- function Ut(s, e) {
2832
- return ve(s, e);
3546
+ function Tr(s, e) {
3547
+ return Ne(s, e);
2833
3548
  }
2834
- function Jt(s) {
2835
- return !s || s.length < 3 ? [] : me(s);
3549
+ function Pr(s) {
3550
+ return !s || s.length < 3 ? [] : Re(s);
2836
3551
  }
2837
- function Wt(s) {
2838
- return !s || s.length < 3 ? [] : ye(s);
3552
+ function Er(s) {
3553
+ return !s || s.length < 3 ? [] : Ie(s);
2839
3554
  }
2840
- function $t(s) {
2841
- return !s || s.length < 2 ? [] : fe(s);
3555
+ function Ir(s) {
3556
+ return !s || s.length < 2 ? [] : Ee(s);
2842
3557
  }
2843
3558
  export {
2844
- Pt as ArcgisTilesRenderer,
2845
- $ as EMERGENCY_RESOURCE_ICON_BY_ONTOLOGY_ID,
2846
- Et as EMERGENCY_RESOURCE_ONTOLOGY_IDS,
2847
- le as FITTING_COUNT,
2848
- je as GisPlotArrow,
2849
- O as GisPlotBase,
2850
- Xe as GisPlotCircle,
2851
- We as GisPlotLine,
2852
- Je as GisPlotPoint,
2853
- $e as GisPlotPolygon,
2854
- ze as GisPlotRectangle,
2855
- He as GisPlotSector,
2856
- Qe as GisPlotText,
2857
- ot as GroundDecalManager,
2858
- C as MaterialType,
2859
- P as MathDistance,
2860
- _e as Mid,
2861
- N as OverlayManager,
3559
+ yr as ArcgisTilesRenderer,
3560
+ K as EMERGENCY_RESOURCE_ICON_BY_ONTOLOGY_ID,
3561
+ mr as EMERGENCY_RESOURCE_ONTOLOGY_IDS,
3562
+ Se as FITTING_COUNT,
3563
+ ct as GisPlotArrow,
3564
+ C as GisPlotBase,
3565
+ ut as GisPlotCircle,
3566
+ st as GisPlotLine,
3567
+ it as GisPlotPoint,
3568
+ nt as GisPlotPolygon,
3569
+ ot as GisPlotRectangle,
3570
+ lt as GisPlotSector,
3571
+ ht as GisPlotText,
3572
+ zt as GroundDecalManager,
3573
+ P as MaterialType,
3574
+ I as MathDistance,
3575
+ De as Mid,
3576
+ B as OverlayManager,
2862
3577
  u as OverlayType,
2863
- at as PlotPrimitiveBridge,
2864
- kt as TerrainTilesRenderer,
2865
- M as TerrainType,
2866
- De as TileCustomMaterialPlugin,
2867
- ct as TilesRenderer,
2868
- xt as TilesRendererManager,
2869
- Q as ZERO_TOLERANCE,
2870
- Ut as createAssaultDirectionArrow,
2871
- Jt as createAttackArrow,
2872
- $t as createCurvedArrow,
2873
- Ft as createFineArrow,
2874
- Wt as createSwallowtailAttackArrow,
2875
- bt as default,
2876
- At as getAngleOfThreePoints,
2877
- z as getAzimuth,
2878
- Nt as getBaseLength,
2879
- X as getBisectorNormals,
2880
- Dt as getCurvePoints,
2881
- Y as getNormal,
2882
- Gt as getQBSplinePoints,
2883
- Lt as getThirdPoint,
2884
- gt as isClockWise,
2885
- Rt as parseColorToRGBA,
2886
- Ke as plotOrderToRenderOrder,
2887
- tt as resolveEmergencyResourceIcon,
2888
- It as resolveOpacity,
2889
- rt as resolvePlotPointImageUrl,
2890
- Ze as sanitizePlotOrder,
2891
- pt as wholeDistance
3578
+ Wt as PlotPrimitiveBridge,
3579
+ vr as TerrainTilesRenderer,
3580
+ x as TerrainType,
3581
+ et as TileCustomMaterialPlugin,
3582
+ tr as TilesRenderer,
3583
+ wr as TilesRendererManager,
3584
+ ne as ZERO_TOLERANCE,
3585
+ Xt as computePlotBoundingBox,
3586
+ Tr as createAssaultDirectionArrow,
3587
+ Pr as createAttackArrow,
3588
+ Ir as createCurvedArrow,
3589
+ kr as createFineArrow,
3590
+ Er as createSwallowtailAttackArrow,
3591
+ pr as default,
3592
+ Vt as flyToPlotById,
3593
+ Sr as getAngleOfThreePoints,
3594
+ ee as getAzimuth,
3595
+ Or as getBaseLength,
3596
+ ae as getBisectorNormals,
3597
+ Cr as getCurvePoints,
3598
+ oe as getNormal,
3599
+ xr as getQBSplinePoints,
3600
+ br as getThirdPoint,
3601
+ ir as isClockWise,
3602
+ _r as parseColorToRGBA,
3603
+ yt as plotOrderToRenderOrder,
3604
+ Dt as resolveEmergencyResourceIcon,
3605
+ Mr as resolveOpacity,
3606
+ Lt as resolvePlotPointImageUrl,
3607
+ ft as sanitizePlotOrder,
3608
+ rr as wholeDistance
2892
3609
  };