@teeechina/teee-map 0.0.18 → 0.0.20

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/teee-map.mjs CHANGED
@@ -37082,14 +37082,14 @@ var S = x, C = async () => {
37082
37082
  prevention: R,
37083
37083
  sgfhqy: $e
37084
37084
  }, ot = (e) => {
37085
- let t = [];
37086
- return e.layers.forEach((n, r) => {
37087
- let i = at[n], a = e.sourceLayers[r];
37088
- if (i) {
37089
- let n = i(e, a);
37085
+ let t = [], n = e.layers, r = e.sourceLayers;
37086
+ return !n || !r ? [] : (n.forEach((n, i) => {
37087
+ let a = at[n], o = r[i];
37088
+ if (a) {
37089
+ let n = a(e, o);
37090
37090
  Array.isArray(n) ? t.push(...n) : t.push(n);
37091
37091
  } else console.warn(`图层 ${n} 尚未实现`);
37092
- }), t;
37092
+ }), t);
37093
37093
  }, st = (e, t) => ({
37094
37094
  id: `${e.id}_${t}`,
37095
37095
  type: "background",
@@ -38299,14 +38299,14 @@ var S = x, C = async () => {
38299
38299
  }
38300
38300
  ]
38301
38301
  }, vt = (e) => {
38302
- let t = [];
38303
- return e.layers.forEach((n, r) => {
38304
- let i = _t[n], a = e.sourceLayers[r];
38305
- if (i) {
38306
- let n = i(e, a);
38302
+ let t = [], n = e.layers, r = e.sourceLayers;
38303
+ return !n || !r ? [] : (n.forEach((n, i) => {
38304
+ let a = _t[n], o = r[i];
38305
+ if (a) {
38306
+ let n = a(e, o);
38307
38307
  Array.isArray(n) ? t.push(...n) : t.push(n);
38308
38308
  } else console.warn(`图层 ${n} 尚未实现`);
38309
- }), t;
38309
+ }), t);
38310
38310
  }, yt = {
38311
38311
  background: (e, t) => ({
38312
38312
  id: `${e.id}_${t}`,
@@ -38601,16 +38601,17 @@ var S = x, C = async () => {
38601
38601
  "text-allow-overlap": !0
38602
38602
  },
38603
38603
  paint: { "text-color": "white" }
38604
- }]
38604
+ }],
38605
+ sgfhqy: null
38605
38606
  }, bt = (e) => {
38606
- let t = [];
38607
- return e.layers.forEach((n, r) => {
38608
- let i = yt[n], a = e.sourceLayers[r];
38609
- if (i) {
38610
- let n = i(e, a);
38607
+ let t = [], n = e.layers, r = e.sourceLayers;
38608
+ return !n || !r ? [] : (n.forEach((n, i) => {
38609
+ let a = yt[n], o = r[i];
38610
+ if (a) {
38611
+ let n = a(e, o);
38611
38612
  Array.isArray(n) ? t.push(...n) : t.push(n);
38612
38613
  } else console.warn(`图层 ${n} 尚未实现`);
38613
- }), t;
38614
+ }), t);
38614
38615
  }, xt = (e) => [{
38615
38616
  id: `${e}_raster_layer`,
38616
38617
  type: "raster",
@@ -39629,13 +39630,13 @@ var Ot = class {
39629
39630
  let { mapConfigs: e } = this.teeeMap;
39630
39631
  if (!e) return;
39631
39632
  let t = e.id, n = e.sourceLayers, r = e.layers;
39632
- this.trackFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("track")] }), this.switchFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("switch")] }), this.switchlocFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("switch_loc")] }), this.circuitFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("track_circuit")] }), this.signalFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("signal")] }), this.sgfhqyFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("sgfhqy")] }), this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("label")] });
39633
+ !n || !r || (this.trackFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("track")] }), this.switchFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("switch")] }), this.switchlocFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("switch_loc")] }), this.circuitFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("track_circuit")] }), this.signalFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("signal")] }), this.sgfhqyFeatures = this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("sgfhqy")] }), this.teeeMap.map.querySourceFeatures(t, { sourceLayer: n[r.indexOf("label")] }));
39633
39634
  }
39634
39635
  initState() {
39635
39636
  let { mapConfigs: e } = this.teeeMap;
39636
- e && (e.id, e.sourceLayers.forEach((e) => {
39637
+ e?.sourceLayers && e.sourceLayers.forEach((e) => {
39637
39638
  e.includes("switch") ? (this.switchFeatures.forEach((e) => this.initCTCFeatureState(e)), this.switchlocFeatures.forEach((e) => this.initCTCFeatureState(e))) : e.includes("signal") ? this.signalFeatures.forEach((e) => this.initCTCFeatureState(e)) : e.includes("track") ? (this.trackFeatures.forEach((e) => this.initCTCFeatureState(e)), this.circuitFeatures.forEach((e) => this.initCTCFeatureState(e))) : e.includes("sgfhqy") && this.sgfhqyFeatures.forEach((e) => this.initCTCFeatureState(e));
39638
- }));
39639
+ });
39639
39640
  }
39640
39641
  initCTCFeatureState(e) {
39641
39642
  if (!e) return;
@@ -39784,13 +39785,17 @@ var Ot = class {
39784
39785
  this.teeeMap.map.off("click", this.boundHandlePathClick), this.pathInfoRecords = [];
39785
39786
  }
39786
39787
  handlePathClick(e) {
39787
- let t = this.teeeMap.getMapConfigs().id, n = this.teeeMap.getMapConfigs().sourceLayers, r = this.teeeMap.getMapConfigs().layers, i = [
39788
- `${t}_${n[r.indexOf("track_circuit")]}_mainpath`,
39789
- `${t}_${n[r.indexOf("track_circuit")]}_subpath`,
39790
- `${t}_${n[r.indexOf("track_circuit")]}_hitarea`
39791
- ], a = this.teeeMap.map.queryRenderedFeatures(e.point, { layers: i });
39792
- if (a.length > 0) {
39793
- let e = a, t = this.pathInfoRecords.find((t) => e.some((e) => t.routes.some((t) => t.pathInfo.some((t) => t.properties.name === e.properties.name && t.properties.code === e.properties.code))));
39788
+ let { id: t, sourceLayers: n, layers: r } = this.teeeMap.getMapConfigs();
39789
+ if (!n || !r) return;
39790
+ let i = r.indexOf("track_circuit");
39791
+ if (i === -1) return;
39792
+ let a = n[i], o = [
39793
+ `${t}_${a}_mainpath`,
39794
+ `${t}_${a}_subpath`,
39795
+ `${t}_${a}_hitarea`
39796
+ ], s = this.teeeMap.map.queryRenderedFeatures(e.point, { layers: o });
39797
+ if (s.length > 0) {
39798
+ let e = s, t = this.pathInfoRecords.find((t) => e.some((e) => t.routes.some((t) => t.pathInfo.some((t) => t.properties.name === e.properties.name && t.properties.code === e.properties.code))));
39794
39799
  if (t) {
39795
39800
  let e = this.pathInfoRecords.indexOf(t);
39796
39801
  e > -1 && (this.pathInfoRecords.splice(e, 1), this.pathInfoRecords.push(t)), this.changePathState(this.pathInfoRecords), this.onPathSelected?.(t);
@@ -39810,8 +39815,10 @@ var Ot = class {
39810
39815
  this.onPathSelected?.(t);
39811
39816
  }
39812
39817
  createSignalAction(e) {
39813
- let t, n, r, i = {}, a, o = e.state, s = e.feature.properties, c = s.name;
39814
- return o.subState5 && (o.subState5 == "red" ? (t = "nf", n = "扭封", a = c, i = e, r = `对${s.name}信号机钮封操作`) : (t = "jf", n = "解封", a = c, i = e, r = `对${s.name}信号机解封操作`)), o.subState4 && (o.subState2 == "off" ? (t = "lightoff", n = "灭灯", a = c, i = e, r = `对${s.name}信号机灭灯操作`) : (t = "lighton", n = "点灯", a = c, i = e, r = `对${s.name}信号机点灯操作`)), {
39818
+ let t, n, r, i = {}, a, o = e.state ?? {}, s = e.feature;
39819
+ if (!s) return {};
39820
+ let c = s.properties, l = c.name;
39821
+ return o.subState5 && (o.subState5 == "red" ? (t = "nf", n = "扭封", a = l, i = e, r = `对${c.name}信号机钮封操作`) : (t = "jf", n = "解封", a = l, i = e, r = `对${c.name}信号机解封操作`)), o.subState4 && (o.subState2 == "off" ? (t = "lightoff", n = "灭灯", a = l, i = e, r = `对${c.name}信号机灭灯操作`) : (t = "lighton", n = "点灯", a = l, i = e, r = `对${c.name}信号机点灯操作`)), {
39815
39822
  actionType: t,
39816
39823
  actionName: n,
39817
39824
  content: r,
@@ -39821,7 +39828,7 @@ var Ot = class {
39821
39828
  }
39822
39829
  createAllLightAction(e) {
39823
39830
  let t, n, r, i, a = {};
39824
- return e.state.subState4 === "off" ? (t = "lightoff", n = "全灭", r = "信号机全灭操作", i = "lightoff", a = e) : (t = "lighton", n = "全亮", r = "信号机全亮操作", i = "lighton", a = e), {
39831
+ return (e.state ?? {}).subState4 === "off" ? (t = "lightoff", n = "全灭", r = "信号机全灭操作", i = "lightoff", a = e) : (t = "lighton", n = "全亮", r = "信号机全亮操作", i = "lighton", a = e), {
39825
39832
  actionType: t,
39826
39833
  actionName: n,
39827
39834
  content: r,
@@ -39830,8 +39837,10 @@ var Ot = class {
39830
39837
  };
39831
39838
  }
39832
39839
  createSwitchAction(e) {
39833
- let t, n, r, i, a = {}, o = e.state, s = e.feature.properties, c = s.name;
39834
- return o.subState1 && (o.subState1 == "red" ? (t = "nf", n = "扭封", i = c, a = e, r = `对${s.name}信号机钮封操作`) : (t = "jf", n = "解封", i = c, a = e, r = `对${s.name}信号机解封操作`)), o.subState2 && (o.subState2 == "off" ? (t = "dd", n = "灭灯", i = c, a = e, r = `对${s.name}信号机灭灯操作`) : (t = "md", n = "点灯", i = c, a = e, r = `对${s.name}信号机点灯操作`)), o.subState1 !== void 0 && (o.subState1 === "2" ? (t = "dcsb", n = "道岔锁闭", i = c, a = e, r = `对${s.name}道岔锁闭操作`) : o.subState1 === "3" ? (t = "dczy", n = "道岔占用", i = c, a = e, r = `对${s.name}道岔占用操作`) : o.subState1 === "" && (t = "dccq", n = "道岔出清", i = c, a = e, r = `对${s.name}道岔出清操作`)), o.subState2 !== void 0 && (o.subState2 === "" ? (t = "dcjs", n = "道岔解锁", i = c, a = e, r = `对${s.name}道岔解锁操作`) : (t = "dcds", n = "道岔单锁", i = c, a = e, r = `对${s.name}道岔单锁操作`)), o.subState3 !== void 0 && (o.subState3 === "1" ? (t = "dcdf", n = "道岔单封", i = c, a = e, r = `对${s.name}道岔单封操作`) : o.subState3 === "" && (t = "dcjf", n = "道岔解封", i = c, a = e, r = `对${s.name}道岔解封操作`)), {
39840
+ let t, n, r, i, a = {}, o = e.state ?? {}, s = e.feature;
39841
+ if (!s) return {};
39842
+ let c = s.properties, l = c.name;
39843
+ return o.subState1 && (o.subState1 == "red" ? (t = "nf", n = "扭封", i = l, a = e, r = `对${c.name}信号机钮封操作`) : (t = "jf", n = "解封", i = l, a = e, r = `对${c.name}信号机解封操作`)), o.subState2 && (o.subState2 == "off" ? (t = "dd", n = "灭灯", i = l, a = e, r = `对${c.name}信号机灭灯操作`) : (t = "md", n = "点灯", i = l, a = e, r = `对${c.name}信号机点灯操作`)), o.subState1 !== void 0 && (o.subState1 === "2" ? (t = "dcsb", n = "道岔锁闭", i = l, a = e, r = `对${c.name}道岔锁闭操作`) : o.subState1 === "3" ? (t = "dczy", n = "道岔占用", i = l, a = e, r = `对${c.name}道岔占用操作`) : o.subState1 === "" && (t = "dccq", n = "道岔出清", i = l, a = e, r = `对${c.name}道岔出清操作`)), o.subState2 !== void 0 && (o.subState2 === "" ? (t = "dcjs", n = "道岔解锁", i = l, a = e, r = `对${c.name}道岔解锁操作`) : (t = "dcds", n = "道岔单锁", i = l, a = e, r = `对${c.name}道岔单锁操作`)), o.subState3 !== void 0 && (o.subState3 === "1" ? (t = "dcdf", n = "道岔单封", i = l, a = e, r = `对${c.name}道岔单封操作`) : o.subState3 === "" && (t = "dcjf", n = "道岔解封", i = l, a = e, r = `对${c.name}道岔解封操作`)), {
39835
39844
  actionType: t,
39836
39845
  actionName: n,
39837
39846
  content: r,
@@ -39840,8 +39849,10 @@ var Ot = class {
39840
39849
  };
39841
39850
  }
39842
39851
  createPathAction(e) {
39843
- let t, n, r, i, a = {}, o = e.meta, s = e.feature.properties, c = s.name;
39844
- return o.pathType == "srcSignal" ? (t = "path", n = "srcSignal", i = c, a = e, r = `进路起点:${s.name}信号`) : (t = "path", n = "destSignal", i = c, a = e, r = `进路终点:${s.name}信号`), {
39852
+ let t, n, r, i, a = {}, o = e.meta ?? {}, s = e.feature;
39853
+ if (!s) return {};
39854
+ let c = s.properties, l = c.name;
39855
+ return o.pathType == "srcSignal" ? (t = "path", n = "srcSignal", i = l, a = e, r = `进路起点:${c.name}信号`) : (t = "path", n = "destSignal", i = l, a = e, r = `进路终点:${c.name}信号`), {
39845
39856
  actionType: t,
39846
39857
  actionName: n,
39847
39858
  content: r,
@@ -39850,8 +39861,10 @@ var Ot = class {
39850
39861
  };
39851
39862
  }
39852
39863
  createDLTXAction(e) {
39853
- let t, n, r, i, a = {}, o = e.feature.properties, s = o.name;
39854
- return e.featureType == "dltx" && (t = "dltx", n = "短路铜线", i = s, a = e, r = `区段:${o.name}安置短路铜线`), {
39864
+ let t, n, r, i, a = {}, o = e.feature;
39865
+ if (!o) return {};
39866
+ let s = o.properties, c = s.name;
39867
+ return e.featureType == "dltx" && (t = "dltx", n = "短路铜线", i = c, a = e, r = `区段:${s.name}安置短路铜线`), {
39855
39868
  actionType: t,
39856
39869
  actionName: n,
39857
39870
  content: r,
@@ -39870,8 +39883,10 @@ var Ot = class {
39870
39883
  };
39871
39884
  }
39872
39885
  createFSQAction(e) {
39873
- let t, n, r, i, a = {}, o = e.feature.properties, s = o.name;
39874
- return e.featureType && (t = "fsq", n = "封锁区", r = `对${o.name}区域进行封锁操作`, i = s, a = e), {
39886
+ let t, n, r, i, a = {}, o = e.feature;
39887
+ if (!o) return {};
39888
+ let s = o.properties, c = s.name;
39889
+ return e.featureType && (t = "fsq", n = "封锁区", r = `对${s.name}区域进行封锁操作`, i = c, a = e), {
39875
39890
  actionType: t,
39876
39891
  actionName: n,
39877
39892
  content: r,
@@ -39880,8 +39895,10 @@ var Ot = class {
39880
39895
  };
39881
39896
  }
39882
39897
  createFSQAllAction(e) {
39883
- let t, n, r, i, a = {}, o = e.feature.properties.name;
39884
- return e.featureType && (t = "fsqall", n = "封锁区", r = "对达成场区域进行封锁操作", i = o, a = e), {
39898
+ let t, n, r, i, a = {}, o = e.feature;
39899
+ if (!o) return {};
39900
+ let s = o.properties.name;
39901
+ return e.featureType && (t = "fsqall", n = "封锁区", r = "对达成场区域进行封锁操作", i = s, a = e), {
39885
39902
  actionType: t,
39886
39903
  actionName: n,
39887
39904
  content: r,
@@ -39890,7 +39907,9 @@ var Ot = class {
39890
39907
  };
39891
39908
  }
39892
39909
  createDoorAction(e) {
39893
- let t = e.state, n = e.feature.properties.name, r = {
39910
+ let t = e.state ?? {}, n = e.feature;
39911
+ if (!n) return {};
39912
+ let r = n.properties.name, i = {
39894
39913
  1: {
39895
39914
  op: "open",
39896
39915
  label: "施工开门"
@@ -39907,15 +39926,15 @@ var Ot = class {
39907
39926
  op: "lsclose",
39908
39927
  label: "临时关门"
39909
39928
  }
39910
- }, i = (e) => e === "1" ? "t" : "f", { op: a, label: o } = r[t.state] || {
39929
+ }, a = (e) => e === "1" ? "t" : "f", { op: o, label: s } = i[t.state] || {
39911
39930
  op: "unknown",
39912
39931
  label: "未知操作"
39913
39932
  };
39914
39933
  return {
39915
- actionType: `door_${a}_${i(t.subState1)}_${i(t.subState2)}_${i(t.subState3)}`,
39916
- actionName: `通道门${o}`,
39917
- content: `对${n} ${o}`,
39918
- target: n,
39934
+ actionType: `door_${o}_${a(t.subState1)}_${a(t.subState2)}_${a(t.subState3)}`,
39935
+ actionName: `通道门${s}`,
39936
+ content: `对${r} ${s}`,
39937
+ target: r,
39919
39938
  data: e
39920
39939
  };
39921
39940
  }
@@ -40563,7 +40582,7 @@ var Bt = class {
40563
40582
  for (let e of this.queryFeatures("signal")) {
40564
40583
  let n = String(e.properties?.name ?? ""), i = String(e.properties?.code ?? ""), a = String(e.properties?.stcode ?? i.substring(0, 9));
40565
40584
  if (!n || !i || !a || !this.stationSignalState.includes(a)) continue;
40566
- let o = this.getFeatureState("signal", i)?.state ?? "";
40585
+ let o = String(this.getFeatureState("signal", i)?.state ?? "");
40567
40586
  if (!o) continue;
40568
40587
  let s = r[o] ?? o, c = t.get(a);
40569
40588
  t.set(a, c ? c + n + ":" + s + ";" : n + ":" + s + ";");
@@ -40575,7 +40594,7 @@ var Bt = class {
40575
40594
  if (!n || !r || !a || !this.stationSignalState.includes(a)) continue;
40576
40595
  let o = i.find((e) => String(e.properties?.s_code ?? "") === r && String(e.properties?.location ?? "") === "1") ?? i.find((e) => String(e.properties?.s_code ?? "") === r);
40577
40596
  if (!o) continue;
40578
- let s = this.getFeatureState("switch_loc", String(o.properties?.code ?? ""))?.state ?? "";
40597
+ let s = String(this.getFeatureState("switch_loc", String(o.properties?.code ?? ""))?.state ?? "");
40579
40598
  if (!s) continue;
40580
40599
  let c = Number(s), l = t.get(a);
40581
40600
  l === void 0 ? l = "&" + (c === 5 || c === 6 ? n + ":" + (c === 5 ? 2 : 3) + ";" + n + "-F:" + s + ";" : n + ":" + s + ";") : l += c === 5 || c === 6 ? n + ":" + (c === 5 ? 2 : 3) + ";" + n + "-F:" + s + ";" : n + ":" + s + ";", t.set(a, l);
@@ -40585,7 +40604,7 @@ var Bt = class {
40585
40604
  for (let e of this.queryFeatures("track_circuit")) {
40586
40605
  let t = String(e.properties?.name ?? ""), n = String(e.properties?.code ?? ""), r = String(e.properties?.stcode ?? n.substring(0, 9));
40587
40606
  if (!t || !n || !r || !this.stationSignalState.includes(r)) continue;
40588
- let i = this.getFeatureState("track_circuit", n)?.state ?? "";
40607
+ let i = String(this.getFeatureState("track_circuit", n)?.state ?? "");
40589
40608
  if (!i) continue;
40590
40609
  let o = r + "_" + t;
40591
40610
  a.get(o) ? (i === "1" || i === "2") && a.set(o, {
@@ -49209,7 +49228,7 @@ var ho = class {
49209
49228
  let n = this.getViewportPos(e), r = document.createElement("div");
49210
49229
  r.className = "ctc-menu", r.style.cssText = `position:fixed;z-index:9999;left:${n.x}px;top:${n.y}px;border-radius:2px;background:#fff;color:#000;font-size:13px;min-width:150px;`;
49211
49230
  let i = document.createElement("div");
49212
- return i.style.cssText = "padding:8px;font-size:14px;font-weight:600;display:flex;justify-content:space-between;align-items:center;", i.innerHTML = `${t}<span class="ctc-menu-close" style="cursor:pointer;font-size:18px;color:#999;line-height:1;">×</span>`, i.querySelector(".ctc-menu-close").addEventListener("click", () => this.remove()), r.appendChild(i), r;
49231
+ return i.style.cssText = "padding:8px;font-size:14px;font-weight:600;display:flex;justify-content:space-between;align-items:center;", i.innerHTML = `${t}<span class="ctc-menu-close" style="cursor:pointer;font-size:18px;color:#999;line-height:1;">×</span>`, i.querySelector(".ctc-menu-close")?.addEventListener("click", () => this.remove()), r.appendChild(i), r;
49213
49232
  }
49214
49233
  addSplit(e) {
49215
49234
  let t = document.createElement("div");
@@ -49663,16 +49682,21 @@ var ko = 20037508.34, Ao = (e, t) => [e / ko * 180, Math.atan(Math.exp(t / ko *
49663
49682
  initMap(e) {
49664
49683
  let t = async () => {
49665
49684
  try {
49666
- console.log(`开始构建业务地图: ${e.id}`), Array.isArray(e.source) ? e.source.forEach((e, t) => {
49667
- this.map.addSource(this.mapConfigs.sourceLayers[t], e);
49668
- }) : this.map.getSource(e.id) ? console.warn(`地图源已存在,跳过添加: ${e.id}`) : this.map.addSource(e.id, e.source), e.subSourceId && (this.map.getSource(e.subSourceId) ? console.warn(`地图源已存在,跳过添加: ${e.subSourceId}`) : this.map.addSource(e.subSourceId, e.subSource)), (await Ge()).forEach((e) => {
49685
+ if (console.log(`开始构建业务地图: ${e.id}`), Array.isArray(e.source)) {
49686
+ let { sourceLayers: t } = this.mapConfigs;
49687
+ if (!t) return;
49688
+ e.source.forEach((e, n) => {
49689
+ this.map.addSource(t[n], e);
49690
+ });
49691
+ } else this.map.getSource(e.id) ? console.warn(`地图源已存在,跳过添加: ${e.id}`) : this.map.addSource(e.id, e.source);
49692
+ e.subSourceId && e.subSource && (this.map.getSource(e.subSourceId) ? console.warn(`地图源已存在,跳过添加: ${e.subSourceId}`) : this.map.addSource(e.subSourceId, e.subSource)), (await Ge()).forEach((e) => {
49669
49693
  this.map.hasImage(e.id) ? console.warn(`图标已存在,跳过添加: ${e.id}`) : this.map.addImage(e.id, e.image);
49670
49694
  }), e.layers && e.layers.forEach((e) => {
49671
49695
  this.map.getLayer(e.id) ? console.debug(`图层已存在: ${e.id}`) : this.map.addLayer(e);
49672
49696
  }), this.layerTree = new wo(this.map, e.id);
49673
- let t = this.map.getStyle().sources, n = Object.keys(t);
49697
+ let t = this.map.getStyle()?.sources ?? {}, n = Object.keys(t);
49674
49698
  console.log(`源列表 (${n.length}):`, n, t);
49675
- let r = this.map.getStyle().layers, i = r.map((e) => e.id);
49699
+ let r = this.map.getStyle().layers ?? [], i = r.map((e) => e.id);
49676
49700
  console.log(`图层列表 (${i.length}):`, r), this.map.listImages();
49677
49701
  let a = this.layerFeaturesCache.get("track")?.[0] ?? null;
49678
49702
  if (a) {
@@ -49693,13 +49717,14 @@ var ko = 20037508.34, Ao = (e, t) => [e / ko * 180, Math.atan(Math.exp(t / ko *
49693
49717
  });
49694
49718
  }
49695
49719
  createCTCMap(e, t, n) {
49696
- this.mapConfigs = Eo.ctc(e, t, n);
49697
- let r = Ke.graph(this.mapConfigs.sourceUrl), i = Et.ctc(this.mapConfigs), a = {
49720
+ let r = Eo.ctc(e, t, n);
49721
+ this.mapConfigs = r;
49722
+ let i = Ke.graph(r.sourceUrl), a = Et.ctc(r), o = {
49698
49723
  id: this.mapConfigs.id,
49699
- source: r,
49700
- layers: i
49724
+ source: i,
49725
+ layers: a
49701
49726
  };
49702
- this.initMap(a), this.ctcTool = new To.ctc(this), this.ctcMenu = new To.ctcMenu(this), this.ctcHoverTool = new To.ctcHover(this), this.sgfhqyTool = new To.sgfhqy(this), this.doorTool = new To.door(this);
49727
+ this.initMap(o), this.ctcTool = new To.ctc(this), this.ctcMenu = new To.ctcMenu(this), this.ctcHoverTool = new To.ctcHover(this), this.sgfhqyTool = new To.sgfhqy(this), this.doorTool = new To.door(this);
49703
49728
  }
49704
49729
  createCTCEncryptedMap(e, t, n) {
49705
49730
  Oo(this), this.mapConfigs = Eo.ctc(e, t, n);
@@ -49805,15 +49830,17 @@ var ko = 20037508.34, Ao = (e, t) => [e / ko * 180, Math.atan(Math.exp(t / ko *
49805
49830
  "bumper",
49806
49831
  "prevention"
49807
49832
  ];
49808
- Oo(this), this.mapConfigs = Eo.rage(e, t, n, r);
49809
- let i = Ke.geom(this.mapConfigs.sourceUrl), a = Ke.raster(this.mapConfigs.subSourceUrl), o = Et.geom(this.mapConfigs), s = [...Et.raster(this.mapConfigs.subSourceId), ...o], c = {
49810
- id: this.mapConfigs.id,
49811
- source: i,
49812
- subSourceId: this.mapConfigs.subSourceId,
49813
- subSource: a,
49814
- layers: s
49833
+ Oo(this);
49834
+ let i = Eo.rage(e, t, n, r);
49835
+ this.mapConfigs = i;
49836
+ let a = Ke.geom(i.sourceUrl), o = Ke.raster(i.subSourceUrl), s = Et.geom(i), c = [...Et.raster(i.subSourceId), ...s], l = {
49837
+ id: i.id,
49838
+ source: a,
49839
+ subSourceId: i.subSourceId,
49840
+ subSource: o,
49841
+ layers: c
49815
49842
  };
49816
- this.initMap(c);
49843
+ this.initMap(l);
49817
49844
  }
49818
49845
  getMap() {
49819
49846
  return this.map;
@@ -49843,10 +49870,8 @@ var ko = 20037508.34, Ao = (e, t) => [e / ko * 180, Math.atan(Math.exp(t / ko *
49843
49870
  }));
49844
49871
  }
49845
49872
  updateFeatureState(e, t) {
49846
- if (!this.stashFeatures.get(e)) return;
49847
- Object.assign(this.stashFeatures.get(e), t);
49848
49873
  let n = this.stashFeatures.get(e);
49849
- if (n.sourceLayer?.startsWith("geojson_")) this.map.setFeatureState({
49874
+ if (n) if (Object.assign(n, t), n.sourceLayer?.startsWith("geojson_")) this.map.setFeatureState({
49850
49875
  source: n.sourceLayer,
49851
49876
  id: e
49852
49877
  }, n);
@@ -49860,7 +49885,8 @@ var ko = 20037508.34, Ao = (e, t) => [e / ko * 180, Math.atan(Math.exp(t / ko *
49860
49885
  }
49861
49886
  }
49862
49887
  getFeatureState(e) {
49863
- if (this.stashFeatures.get(e)) return this.stashFeatures.get(e);
49888
+ let t = this.stashFeatures.get(e);
49889
+ if (t) return t;
49864
49890
  }
49865
49891
  locateGeojsonFeature(e, t = !0) {
49866
49892
  let n = S(t ? No(e) : e);