gisviewer-vue3-arcgis 1.0.90 → 1.0.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +3 -5
  2. package/es/src/gis-map/gis-map.vue.mjs +64 -65
  3. package/es/src/gis-map/index.d.ts +2 -4
  4. package/es/src/gis-map/utils/holo-flow/index.d.ts +2 -0
  5. package/es/src/gis-map/utils/holo-flow/index.mjs +30 -19
  6. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
  7. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +56 -48
  8. package/es/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
  9. package/es/src/gis-map/utils/holo-flow/trace-external-renderer.mjs +11 -7
  10. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
  11. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +49 -41
  12. package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
  13. package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.mjs +31 -17
  14. package/es/src/gis-map/utils/map-initializer.mjs +113 -104
  15. package/es/src/gis-map/utils/traffic-flow.d.ts +14 -3
  16. package/es/src/gis-map/utils/traffic-flow.mjs +156 -130
  17. package/es/src/types/index.d.ts +9 -2
  18. package/lib/src/gis-map/gis-map.vue.d.ts +3 -5
  19. package/lib/src/gis-map/gis-map.vue.js +1 -1
  20. package/lib/src/gis-map/index.d.ts +2 -4
  21. package/lib/src/gis-map/utils/holo-flow/index.d.ts +2 -0
  22. package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
  23. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
  24. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
  25. package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
  26. package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.js +1 -1
  27. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
  28. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +1 -1
  29. package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
  30. package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.js +1 -1
  31. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  32. package/lib/src/gis-map/utils/traffic-flow.d.ts +14 -3
  33. package/lib/src/gis-map/utils/traffic-flow.js +1 -1
  34. package/lib/src/types/index.d.ts +9 -2
  35. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import MapView from '@arcgis/core/views/MapView';
2
2
  import SceneView from '@arcgis/core/views/SceneView';
3
- import { ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IStartCrossBufferParam } from '../types';
3
+ import { ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IStartCrossBufferParam, IToggleTrafficInfoParams } from '../types';
4
4
  import HoloFlow from './utils/holo-flow';
5
5
  import MapInitializer from './utils/map-initializer';
6
6
  import OpenDriveRenderer from './utils/open-drive-renderer';
@@ -52,10 +52,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
52
52
  clearHoloTrace: () => void;
53
53
  handleHoloSignalData: (signalData: any) => Promise<void>;
54
54
  clearHoloSignal: () => void;
55
- toggleTrafficInfo: (params: {
56
- name: string;
57
- visible: boolean;
58
- }) => void;
55
+ toggleTrafficInfo: (params: IToggleTrafficInfoParams) => void;
56
+ toggleTrafficObject: (params: IToggleTrafficInfoParams) => void;
59
57
  toggleVehicleInfo: (contentType: string) => void;
60
58
  addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
61
59
  removeOverlaysByType: (types: string[]) => import("../types").IResult;
@@ -1,91 +1,89 @@
1
- import { defineComponent as ee, ref as te, onMounted as ae, getCurrentInstance as ne, computed as re, openBlock as oe, createElementBlock as se, createElementVNode as ie } from "vue";
2
- import ce, { registerStore as le } from "./stores/index.mjs";
1
+ import { defineComponent as te, ref as ae, onMounted as ne, getCurrentInstance as re, computed as oe, openBlock as se, createElementBlock as ce, createElementVNode as ie } from "vue";
2
+ import le, { registerStore as me } from "./stores/index.mjs";
3
3
  import "./style/index.css";
4
- import w from "./utils/holo-flow/index.mjs";
5
- import me from "./utils/map-initializer.mjs";
6
- import pe from "./utils/open-drive-renderer/index.mjs";
7
- import ue from "./utils/overlay.mjs";
4
+ import g from "./utils/holo-flow/index.mjs";
5
+ import pe from "./utils/map-initializer.mjs";
6
+ import ue from "./utils/open-drive-renderer/index.mjs";
7
+ import fe from "./utils/overlay.mjs";
8
8
  import de from "./utils/queue-length.mjs";
9
- import g from "./utils/road-config-tool/index.mjs";
10
- import fe from "./utils/traffic-flow.mjs";
11
- const we = { class: "gis-viewer" }, be = /* @__PURE__ */ ee({
9
+ import v from "./utils/road-config-tool/index.mjs";
10
+ import ge from "./utils/traffic-flow.mjs";
11
+ const ye = { class: "gis-viewer" }, Le = /* @__PURE__ */ te({
12
12
  __name: "gis-map",
13
13
  props: {
14
14
  config: {},
15
15
  assetsRoot: {}
16
16
  },
17
17
  emits: ["mapLoaded", "markerClick", "mapClick"],
18
- setup(v, { expose: h, emit: k }) {
19
- const m = te(null);
20
- let r, o, n, s, t, a, c, l;
21
- le(), ae(async () => {
18
+ setup(w, { expose: O, emit: T }) {
19
+ const m = ae(null);
20
+ let o, s, n, r, t, a, i, l;
21
+ me(), ne(async () => {
22
22
  if (!m.value)
23
23
  return;
24
- const e = ne(), { $gisviewerAssetsRoot: i } = e.appContext.config.globalProperties, C = await (await fetch(y.config)).json();
25
- C.assetsRoot = y.assetsRoot || i;
26
- const Y = ce.useAppDataStore;
27
- Y.mapConfig = C, o = new me(), r = await o.initialize({
24
+ const e = re(), { $gisviewerAssetsRoot: c } = e.appContext.config.globalProperties, C = await (await fetch(y.config)).json();
25
+ C.assetsRoot = y.assetsRoot || c;
26
+ const F = le.useAppDataStore;
27
+ F.mapConfig = C, s = new pe(), o = await s.initialize({
28
28
  container: m.value,
29
- markerClickCallback: (u, d, f, F) => {
30
- p("markerClick", u, d, f, F);
29
+ markerClickCallback: (u, f, d, ee) => {
30
+ p("markerClick", u, f, d, ee);
31
31
  },
32
- mapClickCallback: (u, d, f) => {
33
- p("mapClick", u, d, f);
32
+ mapClickCallback: (u, f, d) => {
33
+ p("mapClick", u, f, d);
34
34
  }
35
- }), t = new w(r), p("mapLoaded");
35
+ }), t = new g(o), p("mapLoaded");
36
36
  });
37
- const O = re(() => r), L = async (e) => await o.setMapCenter(e), T = async (e) => await o.setMapCamera(e), A = async (e) => await o.lookAt(e), b = (e) => o.setLayerVisibility(e), I = (e, i) => o.requestCoordinateTransform(e, i), D = (e) => {
38
- o.cancelCoordinateTransform(e);
37
+ const h = oe(() => o), k = async (e) => await s.setMapCenter(e), b = async (e) => await s.setMapCamera(e), A = async (e) => await s.lookAt(e), I = (e) => s.setLayerVisibility(e), L = (e, c) => s.requestCoordinateTransform(e, c), D = (e) => {
38
+ s.cancelCoordinateTransform(e);
39
39
  }, S = (e) => {
40
- o.setMapZoomRange(e);
41
- }, _ = (e) => (n || (n = new g(r)), n.showLaneNumber(e)), M = () => {
40
+ s.setMapZoomRange(e);
41
+ }, _ = (e) => (n || (n = new v(o)), n.showLaneNumber(e)), M = () => {
42
42
  n == null || n.clearLaneNumber();
43
- }, R = async (e) => (n || (n = new g(r)), await n.initializeSearch(e)), V = async () => n == null ? void 0 : n.calCrossIndicatorArea(), x = async () => {
44
- }, B = async (e, i) => {
45
- s || (s = new fe(r)), s.connectTrafficFlow(e, i);
43
+ }, R = async (e) => (n || (n = new v(o)), await n.initializeSearch(e)), V = async () => n == null ? void 0 : n.calCrossIndicatorArea(), x = async () => {
44
+ }, B = async (e, c) => {
45
+ r || (r = new ge(o)), r.connectTrafficFlow(e, c);
46
46
  }, H = () => {
47
- s == null || s.disconnectTrafficFlow();
47
+ r == null || r.disconnectTrafficFlow();
48
48
  }, z = (e) => {
49
- t || (t = new w(r)), t.handleVehicleTraceData(e);
49
+ t || (t = new g(o)), t.handleVehicleTraceData(e);
50
50
  }, N = () => {
51
51
  t == null || t.clearHoloTrace();
52
52
  }, Q = async (e) => {
53
- t || (t = new w(r)), await t.handleSignalData(e);
54
- }, P = () => {
53
+ t || (t = new g(o)), await t.handleSignalData(e);
54
+ }, j = () => {
55
55
  t == null || t.clearHoloSignal();
56
56
  }, E = (e) => {
57
- switch (e.name.toLowerCase()) {
58
- case "vehiclePlate".toLowerCase():
59
- s == null || s.toggleVehiclePlate(e.visible);
60
- break;
61
- }
57
+ r == null || r.toggleTrafficInfo(e);
58
+ }, P = (e) => {
59
+ t == null || t.toggleTrafficObject(e), r == null || r.toggleTrafficObject(e);
62
60
  }, Z = (e) => {
63
61
  t == null || t.updatePanelContent(e);
64
- }, j = async (e) => (a || (a = new ue(r)), await a.addOverlays(e)), q = (e) => a == null ? void 0 : a.removeOverlaysByType(e), $ = (e) => a == null ? void 0 : a.removeOverlaysById(e), G = () => a == null ? void 0 : a.removeAllOverlays(), J = () => {
62
+ }, q = async (e) => (a || (a = new fe(o)), a.addOverlays(e)), $ = (e) => a == null ? void 0 : a.removeOverlaysByType(e), G = (e) => a == null ? void 0 : a.removeOverlaysById(e), J = () => a == null ? void 0 : a.removeAllOverlays(), K = () => {
65
63
  a == null || a.showAllOverlays();
66
- }, K = (e) => {
67
- c || (c = new de(r)), c.updateQueueLength(e);
68
- }, U = () => {
69
- c == null || c.removeQueueLength();
70
- }, W = async (e, i) => {
71
- l || (l = new pe(r)), await l.showOpenDrive(e, i);
72
- }, X = async () => {
64
+ }, U = (e) => {
65
+ i || (i = new de(o)), i.updateQueueLength(e);
66
+ }, W = () => {
67
+ i == null || i.removeQueueLength();
68
+ }, X = async (e, c) => {
69
+ l || (l = new ue(o)), await l.showOpenDrive(e, c);
70
+ }, Y = async () => {
73
71
  await (l == null ? void 0 : l.hideOpenDrive());
74
- }, y = v, p = k;
75
- return h({
76
- mapViewer: O,
77
- setLayerVisibility: b,
78
- setMapCenter: L,
72
+ }, y = w, p = T;
73
+ return O({
74
+ mapViewer: h,
75
+ setLayerVisibility: I,
76
+ setMapCenter: k,
79
77
  lookAt: A,
80
- setMapCamera: T,
78
+ setMapCamera: b,
81
79
  setMapZoomRange: S,
82
- requestCoordinateTransform: I,
80
+ requestCoordinateTransform: L,
83
81
  cancelCoordinateTransform: D,
84
- addOverlays: j,
85
- showAllOverlays: J,
86
- removeOverlaysByType: q,
87
- removeOverlaysById: $,
88
- removeAllOverlays: G,
82
+ addOverlays: q,
83
+ showAllOverlays: K,
84
+ removeOverlaysByType: $,
85
+ removeOverlaysById: G,
86
+ removeAllOverlays: J,
89
87
  showLaneNumber: _,
90
88
  clearLaneNumber: M,
91
89
  initializeAreaTool: R,
@@ -96,14 +94,15 @@ const we = { class: "gis-viewer" }, be = /* @__PURE__ */ ee({
96
94
  handleHoloVehicleTraceData: z,
97
95
  clearHoloTrace: N,
98
96
  handleHoloSignalData: Q,
99
- clearHoloSignal: P,
97
+ clearHoloSignal: j,
100
98
  toggleTrafficInfo: E,
99
+ toggleTrafficObject: P,
101
100
  toggleVehicleInfo: Z,
102
- updateQueueLength: K,
103
- removeQueueLength: U,
104
- showOpenDrive: W,
105
- hideOpenDrive: X
106
- }), (e, i) => (oe(), se("div", we, [
101
+ updateQueueLength: U,
102
+ removeQueueLength: W,
103
+ showOpenDrive: X,
104
+ hideOpenDrive: Y
105
+ }), (e, c) => (se(), ce("div", ye, [
107
106
  ie("div", {
108
107
  class: "gis-viewer-main",
109
108
  ref_key: "mapContainer",
@@ -113,5 +112,5 @@ const we = { class: "gis-viewer" }, be = /* @__PURE__ */ ee({
113
112
  }
114
113
  });
115
114
  export {
116
- be as default
115
+ Le as default
117
116
  };
@@ -42,10 +42,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
42
42
  clearHoloTrace: () => void;
43
43
  handleHoloSignalData: (signalData: any) => Promise<void>;
44
44
  clearHoloSignal: () => void;
45
- toggleTrafficInfo: (params: {
46
- name: string;
47
- visible: boolean;
48
- }) => void;
45
+ toggleTrafficInfo: (params: import("../types").IToggleTrafficInfoParams) => void;
46
+ toggleTrafficObject: (params: import("../types").IToggleTrafficInfoParams) => void;
49
47
  toggleVehicleInfo: (contentType: string) => void;
50
48
  addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
51
49
  removeOverlaysByType: (types: string[]) => import("../types").IResult;
@@ -1,4 +1,5 @@
1
1
  import View from '@arcgis/core/views/View';
2
+ import { IToggleTrafficInfoParams } from '../../../types';
2
3
  export default class Index {
3
4
  private readonly view;
4
5
  private traceHoloFlow;
@@ -8,6 +9,7 @@ export default class Index {
8
9
  * 处理全息流轨迹数据
9
10
  * */
10
11
  handleVehicleTraceData(data: any): void;
12
+ toggleTrafficObject(params: IToggleTrafficInfoParams): void;
11
13
  clearHoloTrace(): void;
12
14
  updatePanelContent(contentType: string): void;
13
15
  handleSignalData(data: any): Promise<void>;
@@ -1,48 +1,59 @@
1
- import { EVehiclePlateState as l } from "../../../types/index.mjs";
1
+ import { EVehiclePlateState as a } from "../../../types/index.mjs";
2
2
  import t from "./signal-holo-flow.mjs";
3
3
  import i from "./trace-holo-flow.mjs";
4
4
  class h {
5
- constructor(a) {
6
- this.view = a;
5
+ constructor(e) {
6
+ this.view = e;
7
7
  }
8
8
  /**
9
9
  * 处理全息流轨迹数据
10
10
  * */
11
- handleVehicleTraceData(a) {
12
- this.traceHoloFlow || (this.traceHoloFlow = new i(this.view)), this.traceHoloFlow.handleVehicleTraceData(a);
11
+ handleVehicleTraceData(e) {
12
+ this.traceHoloFlow || (this.traceHoloFlow = new i(this.view)), this.traceHoloFlow.handleVehicleTraceData(e);
13
+ }
14
+ toggleTrafficObject(e) {
15
+ var l, o;
16
+ switch (e.name.toLowerCase()) {
17
+ case "groundVehicle".toLowerCase():
18
+ (l = this.traceHoloFlow) == null || l.toggleGroundVehicle(e.visible);
19
+ break;
20
+ case "elevatedVehicle".toLowerCase():
21
+ (o = this.traceHoloFlow) == null || o.toggleElevatedVehicle(e.visible);
22
+ break;
23
+ }
13
24
  }
14
25
  clearHoloTrace() {
15
- var a;
16
- (a = this.traceHoloFlow) == null || a.clearTrace();
26
+ var e;
27
+ (e = this.traceHoloFlow) == null || e.clearTrace();
17
28
  }
18
29
  // public toggleVehiclePlate(visible: boolean): void {
19
30
  // this.traceHoloFlow?.togglePlateLayer(visible);
20
31
  // }
21
- updatePanelContent(a) {
32
+ updatePanelContent(e) {
22
33
  var o;
23
- let e = l.None;
24
- switch (a) {
34
+ let l = a.None;
35
+ switch (e) {
25
36
  case "none":
26
- e = l.None;
37
+ l = a.None;
27
38
  break;
28
39
  case "plateNumber":
29
- e = l.PlateNumber;
40
+ l = a.PlateNumber;
30
41
  break;
31
42
  case "vehicleId":
32
- e = l.Id;
43
+ l = a.Id;
33
44
  break;
34
45
  case "mix":
35
- e = l.Mix;
46
+ l = a.Mix;
36
47
  break;
37
48
  }
38
- (o = this.traceHoloFlow) == null || o.updatePanelContent(e);
49
+ (o = this.traceHoloFlow) == null || o.updatePanelContent(l);
39
50
  }
40
- async handleSignalData(a) {
41
- this.signalHoloFlow || (this.signalHoloFlow = new t(this.view)), await this.signalHoloFlow.initializeLayer(), await this.signalHoloFlow.handleSignalData(a);
51
+ async handleSignalData(e) {
52
+ this.signalHoloFlow || (this.signalHoloFlow = new t(this.view)), await this.signalHoloFlow.initializeLayer(), await this.signalHoloFlow.handleSignalData(e);
42
53
  }
43
54
  clearHoloSignal() {
44
- var a;
45
- (a = this.signalHoloFlow) == null || a.clearSignal();
55
+ var e;
56
+ (e = this.signalHoloFlow) == null || e.clearSignal();
46
57
  }
47
58
  }
48
59
  export {
@@ -25,6 +25,14 @@ export default class SignalHoloFlow {
25
25
  * 获取显示倒计时的canvas
26
26
  * */
27
27
  private updateCountdown;
28
+ /**
29
+ * 在倒计时面板上写入倒计时时间
30
+ * @param countdownCanvas 倒计时面板canvas
31
+ * @param rtState 相位数据
32
+ * @param rtState.stageRemainingTime 剩余时间
33
+ * @param rtState.stageAllRedTime 全红时间
34
+ * @param rtState.stageYellowTime 黄灯时间
35
+ */
28
36
  private drawCountdownText;
29
37
  private updatePhaseLine;
30
38
  /**
@@ -5,8 +5,8 @@ import u from "../../stores/index.mjs";
5
5
  class f {
6
6
  constructor(e) {
7
7
  this.currentPhaseMap = /* @__PURE__ */ new Map(), this.countdownCanvasMap = /* @__PURE__ */ new Map(), this.lastDataTime = 0, this.isDeletingCanvas = !1, this.canvasWidth = 80, this.canvasHeight = 50, this.view = (e.type === "2d", e);
8
- const t = u.useAppDataStore;
9
- this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig));
8
+ const a = u.useAppDataStore;
9
+ this.mapConfig = JSON.parse(JSON.stringify(a.mapConfig));
10
10
  }
11
11
  /**
12
12
  * 初始化相位线图层
@@ -16,14 +16,14 @@ class f {
16
16
  if (this.phaseLineLayer)
17
17
  this.phaseLineLayer.visible || (this.phaseLineLayer.visible = !0);
18
18
  else {
19
- const e = `${this.mapConfig.assetsRoot}/${this.mapConfig.phaseLineLayer}`, o = (await (await fetch(e)).json()).features.map((i, s) => ({
19
+ const e = `${this.mapConfig.assetsRoot}/${this.mapConfig.phaseLineLayer}`, o = (await (await fetch(e)).json()).features.map((s, n) => ({
20
20
  geometry: {
21
21
  type: "polyline",
22
- paths: [i.geometry.coordinates]
22
+ paths: [s.geometry.coordinates]
23
23
  },
24
24
  attributes: {
25
- ObjectID: s + 1,
26
- id: i.properties.id,
25
+ ObjectID: n + 1,
26
+ id: s.properties.id,
27
27
  color: "hide"
28
28
  }
29
29
  }));
@@ -106,16 +106,16 @@ class f {
106
106
  }
107
107
  }
108
108
  async handleSignalData(e) {
109
- const t = new Date().getTime();
110
- if (t - this.lastDataTime < 100)
109
+ const a = new Date().getTime();
110
+ if (a - this.lastDataTime < 100)
111
111
  return;
112
- this.lastDataTime = t;
113
- const { crossId: o, lat: i, lon: s, rtStage: n, channelsConfig: l } = e;
114
- await this.updateCountdown(o, i, s, n), this.phaseLineLayer && ((!this.currentPhaseMap.has(o) || this.currentPhaseMap.get(o) !== n.stagePhase) && await this.updatePhaseLine(
112
+ this.lastDataTime = a;
113
+ const { crossId: o, lat: s, lon: n, rtStage: t, channelsConfig: l } = e;
114
+ await this.updateCountdown(o, s, n, t), this.phaseLineLayer && ((!this.currentPhaseMap.has(o) || this.currentPhaseMap.get(o) !== t.stagePhase) && await this.updatePhaseLine(
115
115
  o,
116
- n.channelsConfig,
116
+ t.channelsConfig,
117
117
  l
118
- ), this.currentPhaseMap.set(o, n.stagePhase));
118
+ ), this.currentPhaseMap.set(o, t.stagePhase));
119
119
  }
120
120
  /**
121
121
  * 清除实时信号相关图层
@@ -128,54 +128,62 @@ class f {
128
128
  /**
129
129
  * 获取显示倒计时的canvas
130
130
  * */
131
- async updateCountdown(e, t, a, o) {
131
+ async updateCountdown(e, a, i, o) {
132
132
  if (this.isDeletingCanvas)
133
133
  return;
134
- const i = this.countdownCanvasMap.get(e);
135
- if (i)
136
- this.drawCountdownText(i.countdownCanvas, o);
134
+ const s = this.countdownCanvasMap.get(e);
135
+ if (s)
136
+ this.drawCountdownText(s.countdownCanvas, o);
137
137
  else {
138
- const s = new c({
139
- longitude: a,
140
- latitude: t,
138
+ const n = new c({
139
+ longitude: i,
140
+ latitude: a,
141
141
  z: 10
142
- }), n = this.view.toScreen(s);
143
- if (n.x > this.view.width || n.y > this.view.height)
142
+ }), t = this.view.toScreen(n);
143
+ if (t.x > this.view.width || t.y > this.view.height || t.x <= 0 || t.y <= 0)
144
144
  return;
145
145
  this.createCountdownCanvas((l) => {
146
146
  const h = l[0], r = l[1];
147
- h.style.left = n.x + "px", h.style.top = n.y + "px", r.style.left = n.x + "px", r.style.top = n.y + "px", this.countdownCanvasMap.set(e, {
147
+ h.style.left = t.x + "px", h.style.top = t.y + "px", r.style.left = t.x + "px", r.style.top = t.y + "px", this.countdownCanvasMap.set(e, {
148
148
  backgroundCanvas: h,
149
149
  countdownCanvas: r,
150
- mapPoint: s
150
+ mapPoint: n
151
151
  }), this.drawCountdownText(r, o);
152
152
  });
153
153
  }
154
154
  this.countdownWatchHandel || (this.countdownWatchHandel = d.watch(
155
155
  () => this.view.extent,
156
156
  () => {
157
- this.countdownCanvasMap.forEach((s) => {
158
- const n = this.view.toScreen(s.mapPoint);
159
- n.x > this.view.width || n.y > this.view.height ? (this.isDeletingCanvas = !0, this.view.container.removeChild(s.backgroundCanvas), this.view.container.removeChild(s.countdownCanvas), this.countdownCanvasMap.delete(e), this.isDeletingCanvas = !1) : (s.backgroundCanvas.style.left = n.x + "px", s.backgroundCanvas.style.top = n.y + "px", s.countdownCanvas.style.left = n.x + "px", s.countdownCanvas.style.top = n.y + "px");
157
+ this.countdownCanvasMap.forEach((n) => {
158
+ const t = this.view.toScreen(n.mapPoint);
159
+ t.x > this.view.width || t.y > this.view.height || t.x <= 0 || t.y <= 0 ? (this.isDeletingCanvas = !0, this.view.container.removeChild(n.backgroundCanvas), this.view.container.removeChild(n.countdownCanvas), this.countdownCanvasMap.delete(e), this.isDeletingCanvas = !1) : (n.backgroundCanvas.style.left = t.x + "px", n.backgroundCanvas.style.top = t.y + "px", n.countdownCanvas.style.left = t.x + "px", n.countdownCanvas.style.top = t.y + "px");
160
160
  });
161
161
  }
162
162
  ));
163
163
  }
164
- drawCountdownText(e, t) {
165
- const a = e.getContext("2d");
166
- a.clearRect(0, 0, e.width, e.height), a.font = "32px LESLIE", a.textBaseline = "middle", a.textAlign = "center", a.fillStyle = t.stageRemainingTime <= t.stageAllRedTime ? "red" : t.stageRemainingTime <= t.stageAllRedTime + t.stageYellowTime ? "yellow" : "lime", a.fillText(
167
- t.stageRemainingTime,
164
+ /**
165
+ * 在倒计时面板上写入倒计时时间
166
+ * @param countdownCanvas 倒计时面板canvas
167
+ * @param rtState 相位数据
168
+ * @param rtState.stageRemainingTime 剩余时间
169
+ * @param rtState.stageAllRedTime 全红时间
170
+ * @param rtState.stageYellowTime 黄灯时间
171
+ */
172
+ drawCountdownText(e, a) {
173
+ const i = e.getContext("2d");
174
+ i.clearRect(0, 0, e.width, e.height), i.font = "32px LESLIE", i.textBaseline = "middle", i.textAlign = "center", i.fillStyle = a.stageRemainingTime <= a.stageAllRedTime ? "red" : a.stageRemainingTime <= a.stageAllRedTime + a.stageYellowTime ? "yellow" : "lime", i.fillText(
175
+ a.stageRemainingTime.toFixed(0),
168
176
  e.width / 2,
169
177
  e.height / 2
170
178
  );
171
179
  }
172
- async updatePhaseLine(e, t, a) {
180
+ async updatePhaseLine(e, a, i) {
173
181
  const o = this.phaseLineLayer.source.filter(
174
- (i) => i.getAttribute("id").includes(e)
182
+ (s) => s.getAttribute("id").includes(e)
175
183
  );
176
- o.forEach((i) => {
177
- const s = i.getAttribute("id");
178
- this.isLaneInChannels(s, t) ? i.setAttribute("color", "green") : this.isLaneInChannels(s, a) ? i.setAttribute("color", "red") : i.setAttribute("color", "green");
184
+ o.forEach((s) => {
185
+ const n = s.getAttribute("id");
186
+ this.isLaneInChannels(n, a) ? s.setAttribute("color", "green") : this.isLaneInChannels(n, i) ? s.setAttribute("color", "red") : s.setAttribute("color", "green");
179
187
  }), await this.phaseLineLayer.applyEdits({ updateFeatures: o });
180
188
  }
181
189
  /**
@@ -184,24 +192,24 @@ class f {
184
192
  * @param channels 通道列表
185
193
  * @returns
186
194
  */
187
- isLaneInChannels(e, t) {
188
- const a = e.split("+"), o = a[1], i = a[2];
189
- for (let s = 0; s < t.length; s++)
190
- for (let n = 0; n < t[s].laneSnList.length; n++) {
191
- const l = t[s].laneSnList[n].toFixed(0);
192
- if (o === l[0] && i === l[1])
195
+ isLaneInChannels(e, a) {
196
+ const i = e.split("+"), o = i[1], s = i[2];
197
+ for (let n = 0; n < a.length; n++)
198
+ for (let t = 0; t < a[n].laneSnList.length; t++) {
199
+ const l = a[n].laneSnList[t].toFixed(0);
200
+ if (o === l[0] && s === l[1])
193
201
  return !0;
194
202
  }
195
203
  return !1;
196
204
  }
197
205
  createCountdownCanvas(e) {
198
- const t = new Image();
199
- t.src = `${this.mapConfig.assetsRoot}/Images/timeboard/CountdownBG.png`, t.onload = () => {
200
- const a = document.createElement("canvas");
201
- a.width = this.canvasWidth, a.height = this.canvasHeight, a.style.position = "absolute", a.style.transform = "translate(-50%, -50%)", a.getContext("2d").drawImage(t, 0, 0, this.canvasWidth, this.canvasHeight), this.view.container.appendChild(a);
206
+ const a = new Image();
207
+ a.src = `${this.mapConfig.assetsRoot}/Images/timeboard/CountdownBG.png`, a.onload = () => {
202
208
  const i = document.createElement("canvas");
203
- i.width = this.canvasWidth - 10, i.height = this.canvasHeight - 10, i.style.position = "absolute", i.style.transform = "translate(-50%, -50%)", this.view.container.appendChild(i), e([a, i]);
204
- }, t.onerror = () => {
209
+ i.width = this.canvasWidth, i.height = this.canvasHeight, i.style.position = "absolute", i.style.transform = "translate(-50%, -50%)", i.getContext("2d").drawImage(a, 0, 0, this.canvasWidth, this.canvasHeight), this.view.container.appendChild(i);
210
+ const s = document.createElement("canvas");
211
+ s.width = this.canvasWidth - 10, s.height = this.canvasHeight - 10, s.style.position = "absolute", s.style.transform = "translate(-50%, -50%)", this.view.container.appendChild(s), e([i, s]);
212
+ }, a.onerror = () => {
205
213
  console.error("倒计时背景图加载失败");
206
214
  };
207
215
  }
@@ -49,6 +49,8 @@ export default class TraceExternalRenderer implements ITraceRendererInterface {
49
49
  * @returns
50
50
  */
51
51
  updatePanelContent(contentType: EVehiclePlateState): void;
52
+ toggleGroundVehicle(visible: boolean): void;
53
+ toggleElevatedVehicle(visible: boolean): void;
52
54
  /**
53
55
  * 释放模型资源
54
56
  * */
@@ -1,5 +1,5 @@
1
1
  import b from "@arcgis/core/geometry/SpatialReference";
2
- import * as g from "@arcgis/core/views/3d/externalRenderers";
2
+ import * as u from "@arcgis/core/views/3d/externalRenderers";
3
3
  import * as o from "three";
4
4
  import { GLTFLoader as v } from "three/examples/jsm/loaders/GLTFLoader.js";
5
5
  import { EVehiclePlateState as M } from "../../../types/index.mjs";
@@ -64,7 +64,7 @@ class k {
64
64
  const a = this.computeVehiclePosition(r);
65
65
  if (a) {
66
66
  const c = [0, 0, 0];
67
- g.toRenderCoordinates(
67
+ u.toRenderCoordinates(
68
68
  this.view,
69
69
  a,
70
70
  0,
@@ -84,7 +84,7 @@ class k {
84
84
  t.ambient.color[0],
85
85
  t.ambient.color[1],
86
86
  t.ambient.color[2]
87
- ), this.renderer.resetState(), i.bindRenderTarget(), this.renderer.render(this.scene, this.camera), g.requestRender(this.view), i.resetWebGLState();
87
+ ), this.renderer.resetState(), i.bindRenderTarget(), this.renderer.render(this.scene, this.camera), u.requestRender(this.view), i.resetWebGLState();
88
88
  }
89
89
  /**
90
90
  * 新增车辆
@@ -115,8 +115,8 @@ class k {
115
115
  if (n) {
116
116
  if ((n.data.vehicleColor !== e.vehicleColor || n.data.vehicleType !== e.vehicleType) && (this.scene.remove(n.model), this.disposeModel(n.model), n.model = this.getVehicleModel(e), this.scene.add(n.model)), n.data.showName !== e.showName || n.data.plateColor !== e.plateColor) {
117
117
  const m = n.model.getObjectByName("VehiclePlate");
118
- m && (n.model.remove(m), this.disposeModel(m)), this.createPlateSprite(e, (u) => {
119
- n.model.add(u), u.position.set(0, 5, -4);
118
+ m && (n.model.remove(m), this.disposeModel(m)), this.createPlateSprite(e, (g) => {
119
+ n.model.add(g), g.position.set(0, 5, -4);
120
120
  });
121
121
  }
122
122
  n.data = e;
@@ -180,6 +180,10 @@ class k {
180
180
  }
181
181
  }
182
182
  }
183
+ toggleGroundVehicle(i) {
184
+ }
185
+ toggleElevatedVehicle(i) {
186
+ }
183
187
  /**
184
188
  * 释放模型资源
185
189
  * */
@@ -306,8 +310,8 @@ class k {
306
310
  return;
307
311
  const d = new o.CanvasTexture(n), p = new o.SpriteMaterial({
308
312
  map: d
309
- }), f = new o.Sprite(p), m = 0.05, u = n.width * m, y = n.height * m;
310
- f.scale.set(u, y, 1), f.name = "VehiclePlate", e(f);
313
+ }), f = new o.Sprite(p), m = 0.05, g = n.width * m, y = n.height * m;
314
+ f.scale.set(g, y, 1), f.name = "VehiclePlate", e(f);
311
315
  };
312
316
  }
313
317
  }
@@ -14,5 +14,7 @@ export default class TraceHoloFlow {
14
14
  * */
15
15
  clearTrace(): void;
16
16
  updatePanelContent(contentType: EVehiclePlateState): void;
17
+ toggleGroundVehicle(visible: boolean): void;
18
+ toggleElevatedVehicle(visible: boolean): void;
17
19
  private buildVehicleTrackData;
18
20
  }