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.
- package/es/src/gis-map/gis-map.vue.d.ts +4 -5
- package/es/src/gis-map/gis-map.vue.mjs +80 -80
- package/es/src/gis-map/index.d.ts +3 -4
- package/es/src/gis-map/utils/GreenWaveline.mjs +1 -1
- package/es/src/gis-map/utils/holo-flow/index.d.ts +2 -0
- package/es/src/gis-map/utils/holo-flow/index.mjs +30 -19
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +56 -48
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.mjs +11 -7
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +49 -41
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.mjs +31 -17
- package/es/src/gis-map/utils/map-initializer.d.ts +2 -1
- package/es/src/gis-map/utils/map-initializer.mjs +135 -107
- package/es/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -2
- package/es/src/gis-map/utils/traffic-flow.d.ts +14 -3
- package/es/src/gis-map/utils/traffic-flow.mjs +156 -130
- package/es/src/types/index.d.ts +14 -3
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -5
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +3 -4
- package/lib/src/gis-map/utils/GreenWaveline.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +2 -0
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +8 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +2 -0
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +2 -0
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +12 -0
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.d.ts +2 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -2
- package/lib/src/gis-map/utils/traffic-flow.d.ts +14 -3
- package/lib/src/gis-map/utils/traffic-flow.js +1 -1
- package/lib/src/types/index.d.ts +14 -3
- 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
|
-
|
|
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
|
|
2
|
-
import
|
|
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
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
const
|
|
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(
|
|
19
|
-
const m =
|
|
20
|
-
let
|
|
21
|
-
|
|
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 =
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
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,
|
|
30
|
-
p("markerClick", u,
|
|
29
|
+
markerClickCallback: (u, f, d, ee) => {
|
|
30
|
+
p("markerClick", u, f, d, ee);
|
|
31
31
|
},
|
|
32
|
-
mapClickCallback: (u,
|
|
33
|
-
p("mapClick", u,
|
|
32
|
+
mapClickCallback: (u, f, d) => {
|
|
33
|
+
p("mapClick", u, f, d);
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), t = new g(o), p("mapLoaded");
|
|
36
36
|
});
|
|
37
|
-
const
|
|
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
|
-
},
|
|
39
|
+
}, S = (e) => {
|
|
40
40
|
s.setMapZoomRange(e);
|
|
41
|
-
},
|
|
41
|
+
}, _ = (e) => (n || (n = new v(o)), n.showLaneNumber(e)), M = () => {
|
|
42
42
|
n == null || n.clearLaneNumber();
|
|
43
|
-
},
|
|
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
|
-
|
|
45
|
+
r || (r = new ge(o)), r.connectTrafficFlow(e, c);
|
|
46
46
|
}, H = () => {
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
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
|
-
|
|
64
|
-
},
|
|
65
|
-
t == null || t.
|
|
66
|
-
},
|
|
67
|
-
|
|
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
|
-
},
|
|
71
|
-
l || (l = new
|
|
72
|
-
},
|
|
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
|
-
},
|
|
75
|
-
return
|
|
76
|
-
mapViewer:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
84
|
-
showAllOverlays:
|
|
85
|
-
removeOverlaysByType:
|
|
86
|
-
removeOverlaysById:
|
|
87
|
-
removeAllOverlays:
|
|
88
|
-
showLaneNumber:
|
|
89
|
-
clearLaneNumber:
|
|
90
|
-
initializeAreaTool:
|
|
91
|
-
calCrossIndicatorArea:
|
|
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:
|
|
96
|
-
clearHoloTrace:
|
|
97
|
-
handleHoloSignalData:
|
|
98
|
-
clearHoloSignal:
|
|
99
|
-
toggleTrafficInfo:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -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
|
|
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(
|
|
6
|
-
this.view =
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.view = e;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* 处理全息流轨迹数据
|
|
10
10
|
* */
|
|
11
|
-
handleVehicleTraceData(
|
|
12
|
-
this.traceHoloFlow || (this.traceHoloFlow = new i(this.view)), this.traceHoloFlow.handleVehicleTraceData(
|
|
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
|
|
16
|
-
(
|
|
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(
|
|
32
|
+
updatePanelContent(e) {
|
|
22
33
|
var o;
|
|
23
|
-
let
|
|
24
|
-
switch (
|
|
34
|
+
let l = a.None;
|
|
35
|
+
switch (e) {
|
|
25
36
|
case "none":
|
|
26
|
-
|
|
37
|
+
l = a.None;
|
|
27
38
|
break;
|
|
28
39
|
case "plateNumber":
|
|
29
|
-
|
|
40
|
+
l = a.PlateNumber;
|
|
30
41
|
break;
|
|
31
42
|
case "vehicleId":
|
|
32
|
-
|
|
43
|
+
l = a.Id;
|
|
33
44
|
break;
|
|
34
45
|
case "mix":
|
|
35
|
-
|
|
46
|
+
l = a.Mix;
|
|
36
47
|
break;
|
|
37
48
|
}
|
|
38
|
-
(o = this.traceHoloFlow) == null || o.updatePanelContent(
|
|
49
|
+
(o = this.traceHoloFlow) == null || o.updatePanelContent(l);
|
|
39
50
|
}
|
|
40
|
-
async handleSignalData(
|
|
41
|
-
this.signalHoloFlow || (this.signalHoloFlow = new t(this.view)), await this.signalHoloFlow.initializeLayer(), await this.signalHoloFlow.handleSignalData(
|
|
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
|
|
45
|
-
(
|
|
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
|
|
9
|
-
this.mapConfig = JSON.parse(JSON.stringify(
|
|
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((
|
|
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: [
|
|
22
|
+
paths: [s.geometry.coordinates]
|
|
23
23
|
},
|
|
24
24
|
attributes: {
|
|
25
|
-
ObjectID:
|
|
26
|
-
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
|
|
110
|
-
if (
|
|
109
|
+
const a = new Date().getTime();
|
|
110
|
+
if (a - this.lastDataTime < 100)
|
|
111
111
|
return;
|
|
112
|
-
this.lastDataTime =
|
|
113
|
-
const { crossId: o, lat:
|
|
114
|
-
await this.updateCountdown(o,
|
|
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
|
-
|
|
116
|
+
t.channelsConfig,
|
|
117
117
|
l
|
|
118
|
-
), this.currentPhaseMap.set(o,
|
|
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,
|
|
131
|
+
async updateCountdown(e, a, i, o) {
|
|
132
132
|
if (this.isDeletingCanvas)
|
|
133
133
|
return;
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
this.drawCountdownText(
|
|
134
|
+
const s = this.countdownCanvasMap.get(e);
|
|
135
|
+
if (s)
|
|
136
|
+
this.drawCountdownText(s.countdownCanvas, o);
|
|
137
137
|
else {
|
|
138
|
-
const
|
|
139
|
-
longitude:
|
|
140
|
-
latitude:
|
|
138
|
+
const n = new c({
|
|
139
|
+
longitude: i,
|
|
140
|
+
latitude: a,
|
|
141
141
|
z: 10
|
|
142
|
-
}),
|
|
143
|
-
if (
|
|
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 =
|
|
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:
|
|
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((
|
|
158
|
-
const
|
|
159
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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,
|
|
180
|
+
async updatePhaseLine(e, a, i) {
|
|
173
181
|
const o = this.phaseLineLayer.source.filter(
|
|
174
|
-
(
|
|
182
|
+
(s) => s.getAttribute("id").includes(e)
|
|
175
183
|
);
|
|
176
|
-
o.forEach((
|
|
177
|
-
const
|
|
178
|
-
this.isLaneInChannels(
|
|
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,
|
|
188
|
-
const
|
|
189
|
-
for (let
|
|
190
|
-
for (let
|
|
191
|
-
const l =
|
|
192
|
-
if (o === l[0] &&
|
|
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
|
|
199
|
-
|
|
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
|
|
204
|
-
|
|
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
|
|
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
|
-
|
|
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),
|
|
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, (
|
|
119
|
-
n.model.add(
|
|
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,
|
|
310
|
-
f.scale.set(
|
|
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
|
}
|