gisviewer-vue3-arcgis 1.0.89 → 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 (41) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +4 -5
  2. package/es/src/gis-map/gis-map.vue.mjs +80 -80
  3. package/es/src/gis-map/index.d.ts +3 -4
  4. package/es/src/gis-map/utils/GreenWaveline.mjs +1 -1
  5. package/es/src/gis-map/utils/holo-flow/index.d.ts +2 -0
  6. package/es/src/gis-map/utils/holo-flow/index.mjs +30 -19
  7. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
  8. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +56 -48
  9. package/es/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
  10. package/es/src/gis-map/utils/holo-flow/trace-external-renderer.mjs +11 -7
  11. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
  12. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +49 -41
  13. package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
  14. package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.mjs +31 -17
  15. package/es/src/gis-map/utils/map-initializer.d.ts +2 -1
  16. package/es/src/gis-map/utils/map-initializer.mjs +135 -107
  17. package/es/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -2
  18. package/es/src/gis-map/utils/traffic-flow.d.ts +14 -3
  19. package/es/src/gis-map/utils/traffic-flow.mjs +156 -130
  20. package/es/src/types/index.d.ts +14 -3
  21. package/lib/src/gis-map/gis-map.vue.d.ts +4 -5
  22. package/lib/src/gis-map/gis-map.vue.js +1 -1
  23. package/lib/src/gis-map/index.d.ts +3 -4
  24. package/lib/src/gis-map/utils/GreenWaveline.js +1 -1
  25. package/lib/src/gis-map/utils/holo-flow/index.d.ts +2 -0
  26. package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
  27. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
  28. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
  29. package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
  30. package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.js +1 -1
  31. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
  32. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +1 -1
  33. package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
  34. package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.js +1 -1
  35. package/lib/src/gis-map/utils/map-initializer.d.ts +2 -1
  36. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  37. package/lib/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -2
  38. package/lib/src/gis-map/utils/traffic-flow.d.ts +14 -3
  39. package/lib/src/gis-map/utils/traffic-flow.js +1 -1
  40. package/lib/src/types/index.d.ts +14 -3
  41. 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, 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';
@@ -31,6 +31,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
31
31
  setMapCenter: (params: ISetMapCenterParams) => Promise<import("../types").IResult>;
32
32
  setMapCamera: (params: ISetMapCameraParams) => Promise<import("../types").IResult>;
33
33
  lookAt: (params: ILookAtParams) => Promise<void>;
34
+ setLayerVisibility: (params: ILayerVisibleParams) => import("../types").IResult;
34
35
  requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
35
36
  handle: number;
36
37
  points: number[][];
@@ -51,10 +52,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
51
52
  clearHoloTrace: () => void;
52
53
  handleHoloSignalData: (signalData: any) => Promise<void>;
53
54
  clearHoloSignal: () => void;
54
- toggleTrafficInfo: (params: {
55
- name: string;
56
- visible: boolean;
57
- }) => void;
55
+ toggleTrafficInfo: (params: IToggleTrafficInfoParams) => void;
56
+ toggleTrafficObject: (params: IToggleTrafficInfoParams) => void;
58
57
  toggleVehicleInfo: (contentType: string) => void;
59
58
  addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
60
59
  removeOverlaysByType: (types: string[]) => import("../types").IResult;
@@ -1,109 +1,109 @@
1
- import { defineComponent as F, ref as ee, onMounted as ae, getCurrentInstance as te, computed as ne, openBlock as re, createElementBlock as oe, createElementVNode as se } from "vue";
2
- import ce, { registerStore as ie } 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 le from "./utils/map-initializer.mjs";
6
- import me from "./utils/open-drive-renderer/index.mjs";
7
- import pe from "./utils/overlay.mjs";
8
- import ue from "./utils/queue-length.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
+ import de from "./utils/queue-length.mjs";
9
9
  import v from "./utils/road-config-tool/index.mjs";
10
- import de from "./utils/traffic-flow.mjs";
11
- const fe = { class: "gis-viewer" }, Le = /* @__PURE__ */ F({
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(y, { expose: h, emit: k }) {
19
- const m = ee(null);
20
- let r, s, n, o, a, t, i, l;
21
- ie(), 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 = te(), { $gisviewerAssetsRoot: c } = e.appContext.config.globalProperties, g = await (await fetch(C.config)).json();
25
- g.assetsRoot = C.assetsRoot || c;
26
- const X = ce.useAppDataStore;
27
- X.mapConfig = g, s = new le(), r = await s.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, Y) => {
30
- p("markerClick", u, d, f, Y);
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
- }), a = new w(r), p("mapLoaded");
35
+ }), t = new g(o), p("mapLoaded");
36
36
  });
37
- const O = ne(() => r), T = async (e) => await s.setMapCenter(e), A = async (e) => await s.setMapCamera(e), L = async (e) => await s.lookAt(e), I = (e, c) => s.requestCoordinateTransform(e, c), D = (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
38
  s.cancelCoordinateTransform(e);
39
- }, b = (e) => {
39
+ }, S = (e) => {
40
40
  s.setMapZoomRange(e);
41
- }, S = (e) => (n || (n = new v(r)), n.showLaneNumber(e)), _ = () => {
41
+ }, _ = (e) => (n || (n = new v(o)), n.showLaneNumber(e)), M = () => {
42
42
  n == null || n.clearLaneNumber();
43
- }, M = async (e) => (n || (n = new v(r)), await n.initializeSearch(e)), R = async () => n == null ? void 0 : n.calCrossIndicatorArea(), x = async () => {
43
+ }, R = async (e) => (n || (n = new v(o)), await n.initializeSearch(e)), V = async () => n == null ? void 0 : n.calCrossIndicatorArea(), x = async () => {
44
44
  }, B = async (e, c) => {
45
- o || (o = new de(r)), o.connectTrafficFlow(e, c);
45
+ r || (r = new ge(o)), r.connectTrafficFlow(e, c);
46
46
  }, H = () => {
47
- o == null || o.disconnectTrafficFlow();
48
- }, V = (e) => {
49
- a || (a = new w(r)), a.handleVehicleTraceData(e);
50
- }, z = () => {
51
- a == null || a.clearHoloTrace();
52
- }, N = async (e) => {
53
- a || (a = new w(r)), await a.handleSignalData(e);
54
- }, Q = () => {
55
- a == null || a.clearHoloSignal();
56
- }, P = (e) => {
57
- switch (e.name.toLowerCase()) {
58
- case "vehiclePlate".toLowerCase():
59
- o == null || o.toggleVehiclePlate(e.visible);
60
- break;
61
- }
47
+ r == null || r.disconnectTrafficFlow();
48
+ }, z = (e) => {
49
+ t || (t = new g(o)), t.handleVehicleTraceData(e);
50
+ }, N = () => {
51
+ t == null || t.clearHoloTrace();
52
+ }, Q = async (e) => {
53
+ t || (t = new g(o)), await t.handleSignalData(e);
54
+ }, j = () => {
55
+ t == null || t.clearHoloSignal();
62
56
  }, E = (e) => {
63
- a == null || a.updatePanelContent(e);
64
- }, Z = async (e) => (t || (t = new pe(r)), await t.addOverlays(e)), j = (e) => t == null ? void 0 : t.removeOverlaysByType(e), q = (e) => t == null ? void 0 : t.removeOverlaysById(e), $ = () => t == null ? void 0 : t.removeAllOverlays(), G = () => {
65
- t == null || t.showAllOverlays();
66
- }, J = (e) => {
67
- i || (i = new ue(r)), i.updateQueueLength(e);
68
- }, K = () => {
57
+ r == null || r.toggleTrafficInfo(e);
58
+ }, P = (e) => {
59
+ t == null || t.toggleTrafficObject(e), r == null || r.toggleTrafficObject(e);
60
+ }, Z = (e) => {
61
+ t == null || t.updatePanelContent(e);
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 = () => {
63
+ a == null || a.showAllOverlays();
64
+ }, U = (e) => {
65
+ i || (i = new de(o)), i.updateQueueLength(e);
66
+ }, W = () => {
69
67
  i == null || i.removeQueueLength();
70
- }, U = async (e, c) => {
71
- l || (l = new me(r)), await l.showOpenDrive(e, c);
72
- }, W = async () => {
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
- }, C = y, p = k;
75
- return h({
76
- mapViewer: O,
77
- setMapCenter: T,
78
- lookAt: L,
79
- setMapCamera: A,
80
- setMapZoomRange: b,
81
- requestCoordinateTransform: I,
72
+ }, y = w, p = T;
73
+ return O({
74
+ mapViewer: h,
75
+ setLayerVisibility: I,
76
+ setMapCenter: k,
77
+ lookAt: A,
78
+ setMapCamera: b,
79
+ setMapZoomRange: S,
80
+ requestCoordinateTransform: L,
82
81
  cancelCoordinateTransform: D,
83
- addOverlays: Z,
84
- showAllOverlays: G,
85
- removeOverlaysByType: j,
86
- removeOverlaysById: q,
87
- removeAllOverlays: $,
88
- showLaneNumber: S,
89
- clearLaneNumber: _,
90
- initializeAreaTool: M,
91
- calCrossIndicatorArea: R,
82
+ addOverlays: q,
83
+ showAllOverlays: K,
84
+ removeOverlaysByType: $,
85
+ removeOverlaysById: G,
86
+ removeAllOverlays: J,
87
+ showLaneNumber: _,
88
+ clearLaneNumber: M,
89
+ initializeAreaTool: R,
90
+ calCrossIndicatorArea: V,
92
91
  calRoadIndicatorArea: x,
93
92
  connectCarFlow: B,
94
93
  disconnectCarFlow: H,
95
- handleHoloVehicleTraceData: V,
96
- clearHoloTrace: z,
97
- handleHoloSignalData: N,
98
- clearHoloSignal: Q,
99
- toggleTrafficInfo: P,
100
- toggleVehicleInfo: E,
101
- updateQueueLength: J,
102
- removeQueueLength: K,
103
- showOpenDrive: U,
104
- hideOpenDrive: W
105
- }), (e, c) => (re(), oe("div", fe, [
106
- se("div", {
94
+ handleHoloVehicleTraceData: z,
95
+ clearHoloTrace: N,
96
+ handleHoloSignalData: Q,
97
+ clearHoloSignal: j,
98
+ toggleTrafficInfo: E,
99
+ toggleTrafficObject: P,
100
+ toggleVehicleInfo: Z,
101
+ updateQueueLength: U,
102
+ removeQueueLength: W,
103
+ showOpenDrive: X,
104
+ hideOpenDrive: Y
105
+ }), (e, c) => (se(), ce("div", ye, [
106
+ ie("div", {
107
107
  class: "gis-viewer-main",
108
108
  ref_key: "mapContainer",
109
109
  ref: m
@@ -21,6 +21,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
21
21
  setMapCenter: (params: import("../types").ISetMapCenterParams) => Promise<import("../types").IResult>;
22
22
  setMapCamera: (params: import("../types").ISetMapCameraParams) => Promise<import("../types").IResult>;
23
23
  lookAt: (params: import("../types").ILookAtParams) => Promise<void>;
24
+ setLayerVisibility: (params: import("../types").ILayerVisibleParams) => import("../types").IResult;
24
25
  requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
25
26
  handle: number;
26
27
  points: number[][];
@@ -41,10 +42,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
41
42
  clearHoloTrace: () => void;
42
43
  handleHoloSignalData: (signalData: any) => Promise<void>;
43
44
  clearHoloSignal: () => void;
44
- toggleTrafficInfo: (params: {
45
- name: string;
46
- visible: boolean;
47
- }) => void;
45
+ toggleTrafficInfo: (params: import("../types").IToggleTrafficInfoParams) => void;
46
+ toggleTrafficObject: (params: import("../types").IToggleTrafficInfoParams) => void;
48
47
  toggleVehicleInfo: (contentType: string) => void;
49
48
  addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
50
49
  removeOverlaysByType: (types: string[]) => import("../types").IResult;
@@ -76,7 +76,7 @@ class d {
76
76
  const a = {
77
77
  type: "simple-line",
78
78
  color: [8, 69, 9, 0.8],
79
- width: 10,
79
+ width: 5,
80
80
  ...t
81
81
  }, o = new p({
82
82
  paths: i
@@ -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
  }