gisviewer-vue3-arcgis 1.0.170 → 1.0.171
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 -4
- package/es/src/gis-map/gis-map.vue.mjs +98 -99
- package/es/src/gis-map/index.d.ts +2 -2
- package/es/src/gis-map/utils/GreenWaveline.d.ts +68 -0
- package/es/src/gis-map/utils/holo-flow/index.d.ts +3 -2
- package/es/src/gis-map/utils/holo-flow/index.mjs +9 -6
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +60 -77
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -4
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +2 -2
- package/lib/src/gis-map/utils/GreenWaveline.d.ts +68 -0
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +3 -2
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- 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 { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
3
|
+
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } 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';
|
|
@@ -34,9 +34,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
34
34
|
mapConfig: {};
|
|
35
35
|
saveTrackLog: boolean;
|
|
36
36
|
isSketching: boolean;
|
|
37
|
-
countdownPanels:
|
|
37
|
+
countdownPanels: ISignalCountdownProps[];
|
|
38
38
|
}, {}, {}>;
|
|
39
|
-
|
|
39
|
+
countdownPanelProps: {
|
|
40
40
|
displayMode: string;
|
|
41
41
|
crossId: string;
|
|
42
42
|
roadId: string;
|
|
@@ -58,7 +58,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
58
58
|
rNumber?: number | undefined;
|
|
59
59
|
rColor?: string | undefined;
|
|
60
60
|
};
|
|
61
|
-
}[]
|
|
61
|
+
}[];
|
|
62
62
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
63
63
|
startSaveTrackLog: () => void;
|
|
64
64
|
downloadTrackLog: () => void;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import A, { registerStore as Ke } from "./stores/index.mjs";
|
|
1
|
+
import { defineComponent as He, ref as O, reactive as xe, onMounted as Be, getCurrentInstance as Pe, onUnmounted as Ve, computed as ze, openBlock as v, createElementBlock as k, createElementVNode as g, withDirectives as Ne, vShow as Qe, Fragment as je, renderList as Ee, createBlock as Ze } from "vue";
|
|
2
|
+
import A, { registerStore as $e } from "./stores/index.mjs";
|
|
4
3
|
import "./style/index.css";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import qe from "./utils/holo-flow/index.mjs";
|
|
5
|
+
import Ke from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
7
6
|
import Ue from "./utils/map-initializer.mjs";
|
|
8
7
|
import L from "./utils/open-drive-renderer/index.mjs";
|
|
9
|
-
import
|
|
8
|
+
import T from "./utils/overlay.mjs";
|
|
10
9
|
import Ge from "./utils/queue-length.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
10
|
+
import D from "./utils/road-config-tool/index.mjs";
|
|
11
|
+
import b from "./utils/signal-control-area-controller/index.mjs";
|
|
13
12
|
import Je from "./utils/traffic-flow.mjs";
|
|
14
|
-
const
|
|
13
|
+
const Re = { class: "gis-viewer" }, We = { style: { position: "absolute", bottom: "10px", left: "10px" } }, lt = /* @__PURE__ */ He({
|
|
15
14
|
__name: "gis-map",
|
|
16
15
|
props: {
|
|
17
16
|
config: {},
|
|
18
17
|
assetsRoot: {}
|
|
19
18
|
},
|
|
20
19
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
21
|
-
setup(
|
|
20
|
+
setup(I, { expose: M, emit: _ }) {
|
|
22
21
|
const d = O(null);
|
|
23
22
|
let o, l, c, s, a, n, p, t, r;
|
|
24
23
|
const f = O(!1);
|
|
25
|
-
|
|
26
|
-
const
|
|
24
|
+
$e();
|
|
25
|
+
const H = A.useAppDataStore, h = xe([]);
|
|
27
26
|
Be(async () => {
|
|
28
27
|
if (!d.value)
|
|
29
28
|
return;
|
|
@@ -31,153 +30,153 @@ const We = { class: "gis-viewer" }, Xe = { style: { position: "absolute", bottom
|
|
|
31
30
|
m.ctrlKey && m.key === "i" && (f.value = !f.value);
|
|
32
31
|
});
|
|
33
32
|
const e = Pe(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(C.config)).json();
|
|
34
|
-
i.assetsRoot = C.assetsRoot || u,
|
|
33
|
+
i.assetsRoot = C.assetsRoot || u, H.mapConfig = i, l = new Ue(), o = await l.initialize({
|
|
35
34
|
container: d.value,
|
|
36
35
|
mapConfig: i,
|
|
37
|
-
markerClickCallback: (m,
|
|
38
|
-
|
|
36
|
+
markerClickCallback: (m, S, w, _e) => {
|
|
37
|
+
y("markerClick", m, S, w, _e);
|
|
39
38
|
},
|
|
40
|
-
mapClickCallback: (m,
|
|
41
|
-
|
|
39
|
+
mapClickCallback: (m, S, w) => {
|
|
40
|
+
y("mapClick", m, S, w);
|
|
42
41
|
}
|
|
43
|
-
}), a = new
|
|
42
|
+
}), a = new qe(o, h), await a.init(), y("mapLoaded");
|
|
44
43
|
}), Ve(() => {
|
|
45
44
|
r == null || r.clearSignalControlArea(), t == null || t.clearOpenDrive(), a.clearHoloTrace(), a.clearHoloSignal(), s == null || s.disconnectTrafficFlow();
|
|
46
45
|
});
|
|
47
|
-
const
|
|
46
|
+
const x = ze(() => o), B = () => {
|
|
48
47
|
const e = A.useAppDataStore;
|
|
49
48
|
e.saveTrackLog = !0;
|
|
50
|
-
},
|
|
49
|
+
}, P = () => {
|
|
51
50
|
a.downloadTrackLog();
|
|
52
|
-
},
|
|
51
|
+
}, V = async (e) => await l.setMapCenter(e), z = async (e) => await l.setMapCamera(e), N = async (e) => await l.lookAt(e), Q = (e) => l.setLayerVisibility(e), j = (e, u) => l.requestCoordinateTransform(e, u), E = (e) => {
|
|
53
52
|
l.cancelCoordinateTransform(e);
|
|
54
|
-
},
|
|
53
|
+
}, Z = (e) => {
|
|
55
54
|
l.setMapZoomRange(e);
|
|
56
|
-
},
|
|
55
|
+
}, $ = (e) => (c || (c = new D(o)), c.showLaneNumber(e)), q = () => {
|
|
57
56
|
c == null || c.clearLaneNumber();
|
|
58
|
-
},
|
|
57
|
+
}, K = async (e) => (c || (c = new D(o)), await c.initializeSearch(e)), U = async () => c == null ? void 0 : c.calCrossIndicatorArea(), G = async () => {
|
|
59
58
|
}, J = async (e, u) => {
|
|
60
59
|
s || (s = new Je(o)), s.connectTrafficFlow(e, u);
|
|
61
|
-
},
|
|
60
|
+
}, R = () => {
|
|
62
61
|
s == null || s.disconnectTrafficFlow();
|
|
63
|
-
},
|
|
64
|
-
a
|
|
65
|
-
},
|
|
62
|
+
}, W = async (e) => {
|
|
63
|
+
a.handleVehicleTraceData(e);
|
|
64
|
+
}, X = () => {
|
|
66
65
|
a.clearHoloTrace();
|
|
67
|
-
},
|
|
66
|
+
}, Y = (e) => {
|
|
68
67
|
a.setInterpolate(e);
|
|
69
|
-
},
|
|
68
|
+
}, F = async (e) => {
|
|
70
69
|
await a.handleSignalData(e);
|
|
71
|
-
},
|
|
70
|
+
}, ee = () => {
|
|
72
71
|
a.clearHoloSignal();
|
|
73
|
-
},
|
|
72
|
+
}, te = (e) => {
|
|
74
73
|
s == null || s.toggleTrafficInfo(e), a == null || a.toggleTrafficInfo(e);
|
|
75
|
-
},
|
|
74
|
+
}, ae = (e) => {
|
|
76
75
|
a == null || a.togglePause(e);
|
|
77
|
-
},
|
|
76
|
+
}, ne = (e) => {
|
|
78
77
|
s == null || s.toggleTrafficObject(e), a == null || a.toggleTrafficObject(e);
|
|
79
|
-
},
|
|
78
|
+
}, re = (e) => {
|
|
80
79
|
a == null || a.updatePanelContent(e);
|
|
81
|
-
},
|
|
80
|
+
}, se = async (e) => (n || (n = new T(o)), n.addOverlays(e)), oe = (e) => (n || (n = new T(o)), n.addMask(e)), ie = () => {
|
|
82
81
|
n == null || n.removeMask();
|
|
83
|
-
},
|
|
82
|
+
}, ce = (e) => n == null ? void 0 : n.removeOverlaysByType(e), le = (e) => n == null ? void 0 : n.removeOverlaysById(e), ue = () => n == null ? void 0 : n.removeAllOverlays(), me = () => {
|
|
84
83
|
n == null || n.showAllOverlays();
|
|
85
|
-
},
|
|
84
|
+
}, pe = (e) => {
|
|
86
85
|
p || (p = new Ge(o)), p.updateQueueLength(e);
|
|
87
|
-
},
|
|
86
|
+
}, ge = () => {
|
|
88
87
|
p == null || p.removeQueueLength();
|
|
89
|
-
},
|
|
88
|
+
}, de = async (e, u) => (t || (t = new L(o)), await t.showOpenDriveFromServer(e, u)), fe = async (e) => (t || (t = new L(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ye = async () => await (t == null ? void 0 : t.clearOpenDrive()), Se = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
90
89
|
status: -1,
|
|
91
90
|
message: "未加载OpenDrive地图"
|
|
92
|
-
},
|
|
91
|
+
}, we = async (e) => t ? t.selectSumo(e) : {
|
|
93
92
|
status: -1,
|
|
94
93
|
message: "未加载OpenDrive地图"
|
|
95
|
-
},
|
|
94
|
+
}, ve = async (e) => t ? t.unselectSumo(e) : {
|
|
96
95
|
status: -1,
|
|
97
96
|
message: "未加载OpenDrive地图"
|
|
98
|
-
},
|
|
97
|
+
}, he = async (e) => t ? await t.geometrySearch(e) : {
|
|
99
98
|
status: -1,
|
|
100
99
|
message: "未加载OpenDrive地图"
|
|
101
|
-
},
|
|
100
|
+
}, Ce = async (e) => t ? await t.getSumoInfo(e) : {
|
|
102
101
|
status: -1,
|
|
103
102
|
message: "未加载OpenDrive地图"
|
|
104
|
-
},
|
|
103
|
+
}, Oe = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
105
104
|
status: -1,
|
|
106
105
|
message: "未加载OpenDrive地图"
|
|
107
|
-
},
|
|
106
|
+
}, ke = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
|
|
108
107
|
status: -1,
|
|
109
108
|
message: "未加载OpenDrive地图"
|
|
110
|
-
},
|
|
109
|
+
}, Ae = (e) => (r || (r = new b(o)), r.showSignalControlArea(e)), Le = () => {
|
|
111
110
|
r == null || r.clearSignalControlArea();
|
|
112
|
-
},
|
|
113
|
-
return
|
|
114
|
-
mapViewer:
|
|
115
|
-
setLayerVisibility:
|
|
116
|
-
setMapCenter:
|
|
117
|
-
lookAt:
|
|
118
|
-
setMapCamera:
|
|
119
|
-
setMapZoomRange:
|
|
120
|
-
requestCoordinateTransform:
|
|
121
|
-
cancelCoordinateTransform:
|
|
122
|
-
addOverlays:
|
|
123
|
-
addMask:
|
|
124
|
-
removeMask:
|
|
125
|
-
showAllOverlays:
|
|
126
|
-
removeOverlaysByType:
|
|
127
|
-
removeOverlaysById:
|
|
128
|
-
removeAllOverlays:
|
|
129
|
-
showLaneNumber:
|
|
130
|
-
clearLaneNumber:
|
|
131
|
-
initializeAreaTool:
|
|
111
|
+
}, Te = async (e) => r ? await r.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, De = async (e) => r ? await r.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, be = () => r ? r.resetHighlight() : { status: -1, message: "未加载信号控制区" }, Ie = (e) => (r || (r = new b(o)), r.showSubSignalControlArea(e)), Me = () => r ? r.editSubSignalArea() : { status: -1, message: "未加载信号控制区" }, C = I, y = _;
|
|
112
|
+
return M({
|
|
113
|
+
mapViewer: x,
|
|
114
|
+
setLayerVisibility: Q,
|
|
115
|
+
setMapCenter: V,
|
|
116
|
+
lookAt: N,
|
|
117
|
+
setMapCamera: z,
|
|
118
|
+
setMapZoomRange: Z,
|
|
119
|
+
requestCoordinateTransform: j,
|
|
120
|
+
cancelCoordinateTransform: E,
|
|
121
|
+
addOverlays: se,
|
|
122
|
+
addMask: oe,
|
|
123
|
+
removeMask: ie,
|
|
124
|
+
showAllOverlays: me,
|
|
125
|
+
removeOverlaysByType: ce,
|
|
126
|
+
removeOverlaysById: le,
|
|
127
|
+
removeAllOverlays: ue,
|
|
128
|
+
showLaneNumber: $,
|
|
129
|
+
clearLaneNumber: q,
|
|
130
|
+
initializeAreaTool: K,
|
|
132
131
|
calCrossIndicatorArea: U,
|
|
133
132
|
calRoadIndicatorArea: G,
|
|
134
133
|
connectCarFlow: J,
|
|
135
|
-
disconnectCarFlow:
|
|
136
|
-
handleHoloVehicleTraceData:
|
|
137
|
-
clearHoloTrace:
|
|
138
|
-
handleHoloSignalData:
|
|
139
|
-
clearHoloSignal:
|
|
140
|
-
setInterpolate:
|
|
141
|
-
toggleTrafficInfo:
|
|
142
|
-
toggleTrafficObject:
|
|
143
|
-
toggleVehicleInfo:
|
|
144
|
-
togglePause:
|
|
145
|
-
updateQueueLength:
|
|
146
|
-
removeQueueLength:
|
|
147
|
-
showOpenDriveFromServer:
|
|
148
|
-
showOpenDriveFromFile:
|
|
134
|
+
disconnectCarFlow: R,
|
|
135
|
+
handleHoloVehicleTraceData: W,
|
|
136
|
+
clearHoloTrace: X,
|
|
137
|
+
handleHoloSignalData: F,
|
|
138
|
+
clearHoloSignal: ee,
|
|
139
|
+
setInterpolate: Y,
|
|
140
|
+
toggleTrafficInfo: te,
|
|
141
|
+
toggleTrafficObject: ne,
|
|
142
|
+
toggleVehicleInfo: re,
|
|
143
|
+
togglePause: ae,
|
|
144
|
+
updateQueueLength: pe,
|
|
145
|
+
removeQueueLength: ge,
|
|
146
|
+
showOpenDriveFromServer: de,
|
|
147
|
+
showOpenDriveFromFile: fe,
|
|
149
148
|
clearOpenDrive: ye,
|
|
150
|
-
geometrySearchInOpenDrive:
|
|
149
|
+
geometrySearchInOpenDrive: he,
|
|
151
150
|
findSumoInOpenDrive: Se,
|
|
152
|
-
selectSumoInOpenDrive:
|
|
153
|
-
unselectSumoInOpenDrive:
|
|
154
|
-
getSumoInfo:
|
|
155
|
-
splitOpenDriveLane:
|
|
156
|
-
clearSplitOpenDriveLane:
|
|
157
|
-
showSignalControlArea:
|
|
151
|
+
selectSumoInOpenDrive: we,
|
|
152
|
+
unselectSumoInOpenDrive: ve,
|
|
153
|
+
getSumoInfo: Ce,
|
|
154
|
+
splitOpenDriveLane: Oe,
|
|
155
|
+
clearSplitOpenDriveLane: ke,
|
|
156
|
+
showSignalControlArea: Ae,
|
|
158
157
|
clearSignalControlArea: Le,
|
|
159
|
-
locateSignalControlArea:
|
|
160
|
-
highlightSignalControlArea:
|
|
161
|
-
resetHighlightSignalControlArea:
|
|
162
|
-
showSubSignalControlArea:
|
|
163
|
-
editSubSignalControlArea:
|
|
164
|
-
}), (e, u) => (v(), k("div",
|
|
158
|
+
locateSignalControlArea: Te,
|
|
159
|
+
highlightSignalControlArea: De,
|
|
160
|
+
resetHighlightSignalControlArea: be,
|
|
161
|
+
showSubSignalControlArea: Ie,
|
|
162
|
+
editSubSignalControlArea: Me
|
|
163
|
+
}), (e, u) => (v(), k("div", Re, [
|
|
165
164
|
g("div", {
|
|
166
165
|
class: "gis-viewer-main",
|
|
167
166
|
ref_key: "mapContainer",
|
|
168
167
|
ref: d
|
|
169
168
|
}, [
|
|
170
|
-
Ne(g("div",
|
|
169
|
+
Ne(g("div", We, [
|
|
171
170
|
g("button", {
|
|
172
171
|
style: { "margin-right": "10px" },
|
|
173
|
-
onClick:
|
|
172
|
+
onClick: B
|
|
174
173
|
}, " 开始记录 "),
|
|
175
|
-
g("button", { onClick:
|
|
174
|
+
g("button", { onClick: P }, "下载日志")
|
|
176
175
|
], 512), [
|
|
177
176
|
[Qe, f.value]
|
|
178
177
|
])
|
|
179
178
|
], 512),
|
|
180
|
-
(v(!0), k(je, null, Ee(
|
|
179
|
+
(v(!0), k(je, null, Ee(h, (i, m) => (v(), Ze(Ke, {
|
|
181
180
|
key: m,
|
|
182
181
|
"display-mode": i.displayMode,
|
|
183
182
|
"road-id": i.crossId,
|
|
@@ -193,5 +192,5 @@ const We = { class: "gis-viewer" }, Xe = { style: { position: "absolute", bottom
|
|
|
193
192
|
}
|
|
194
193
|
});
|
|
195
194
|
export {
|
|
196
|
-
|
|
195
|
+
lt as default
|
|
197
196
|
};
|
|
@@ -25,7 +25,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
25
25
|
isSketching: boolean;
|
|
26
26
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
27
27
|
}, {}, {}>;
|
|
28
|
-
|
|
28
|
+
countdownPanelProps: {
|
|
29
29
|
displayMode: string;
|
|
30
30
|
crossId: string;
|
|
31
31
|
roadId: string;
|
|
@@ -47,7 +47,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
47
47
|
rNumber?: number | undefined;
|
|
48
48
|
rColor?: string | undefined;
|
|
49
49
|
};
|
|
50
|
-
}[]
|
|
50
|
+
}[];
|
|
51
51
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
52
52
|
startSaveTrackLog: () => void;
|
|
53
53
|
downloadTrackLog: () => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Graphic from '@arcgis/core/Graphic';
|
|
2
|
+
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
4
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
+
interface GreenWaveLineOptions {
|
|
6
|
+
viewer: MapView | SceneView;
|
|
7
|
+
graphicsLayerOptions: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface roadPath {
|
|
12
|
+
paths: [number, number][];
|
|
13
|
+
symbol: any;
|
|
14
|
+
attributes: any;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface animationOptions {
|
|
18
|
+
isAnimation: boolean;
|
|
19
|
+
positive?: boolean;
|
|
20
|
+
positiveColor?: number[];
|
|
21
|
+
negative?: boolean;
|
|
22
|
+
negativeColor?: number[];
|
|
23
|
+
}
|
|
24
|
+
export default class GreenWaveLine {
|
|
25
|
+
private viewer;
|
|
26
|
+
overlayLayer: GraphicsLayer;
|
|
27
|
+
customGreenWaveLineView: any;
|
|
28
|
+
material: THREE.ShaderMaterial;
|
|
29
|
+
renderer: THREE.WebGLRenderer;
|
|
30
|
+
threeScene: THREE.Scene;
|
|
31
|
+
camera: THREE.PerspectiveCamera;
|
|
32
|
+
private defaultAnimationOptions;
|
|
33
|
+
constructor(options: GreenWaveLineOptions);
|
|
34
|
+
addGreenWaveLine(paths: roadPath[], options?: animationOptions): void;
|
|
35
|
+
getAnimationPath(paths: [number, number][], options?: animationOptions): any;
|
|
36
|
+
createLine(paths: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
37
|
+
addPointText(points: any[]): void;
|
|
38
|
+
createPointText(point: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
39
|
+
/**
|
|
40
|
+
* 隐藏覆盖物
|
|
41
|
+
*
|
|
42
|
+
* @param {string[]} [ids]
|
|
43
|
+
* @memberof GreenWaveLine
|
|
44
|
+
*/
|
|
45
|
+
hideWaveLine(ids?: string[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* 显示覆盖物
|
|
48
|
+
*
|
|
49
|
+
* @param {string[]} [ids]
|
|
50
|
+
* @memberof GreenWaveLine
|
|
51
|
+
*/
|
|
52
|
+
showWaveLine(ids?: string[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* 隐藏图层
|
|
55
|
+
*
|
|
56
|
+
* @memberof GreenWaveLine
|
|
57
|
+
*/
|
|
58
|
+
hideLayer(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 显示图层
|
|
61
|
+
*
|
|
62
|
+
* @memberof Overlay
|
|
63
|
+
*/
|
|
64
|
+
showLayer(): void;
|
|
65
|
+
clearGreenWaveLine(): void;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IToggleTrafficInfoParams } from '../../../types';
|
|
1
|
+
import { ISignalCountdownProps, IToggleTrafficInfoParams } from '../../../types';
|
|
2
2
|
export default class Index {
|
|
3
3
|
private readonly view;
|
|
4
4
|
private traceHoloFlow;
|
|
5
5
|
private signalHoloFlow;
|
|
6
|
-
|
|
6
|
+
private signalCountdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, signalCountdownPanelProps: ISignalCountdownProps[]);
|
|
7
8
|
init(): Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* 处理全息流轨迹数据
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { toRaw as i } from "vue";
|
|
2
2
|
import { EVehiclePlateState as a } from "../../../types/index.mjs";
|
|
3
|
-
import
|
|
3
|
+
import n from "../../stores/index.mjs";
|
|
4
4
|
import s from "./signal-holo-flow.mjs";
|
|
5
|
-
import
|
|
5
|
+
import r from "./signal-holo-flow-lsr.mjs";
|
|
6
6
|
import c from "./trace-holo-flow.mjs";
|
|
7
7
|
class m {
|
|
8
|
-
constructor(o) {
|
|
9
|
-
this.view = o;
|
|
8
|
+
constructor(o, e) {
|
|
9
|
+
this.view = o, this.signalCountdownPanelProps = e;
|
|
10
10
|
}
|
|
11
11
|
async init() {
|
|
12
12
|
this.traceHoloFlow = new c(this.view), await this.traceHoloFlow.init();
|
|
@@ -60,8 +60,11 @@ class m {
|
|
|
60
60
|
async handleSignalData(o) {
|
|
61
61
|
var e, l;
|
|
62
62
|
if (!this.signalHoloFlow) {
|
|
63
|
-
const t =
|
|
64
|
-
((l = (e = i(t.mapConfig).holoFlow) == null ? void 0 : e.signal) == null ? void 0 : l.style) === "LSR" ? this.signalHoloFlow = new
|
|
63
|
+
const t = n.useAppDataStore;
|
|
64
|
+
((l = (e = i(t.mapConfig).holoFlow) == null ? void 0 : e.signal) == null ? void 0 : l.style) === "LSR" ? this.signalHoloFlow = new r(
|
|
65
|
+
this.view,
|
|
66
|
+
this.signalCountdownPanelProps
|
|
67
|
+
) : this.signalHoloFlow = new s(this.view), await this.signalHoloFlow.initializeLayer();
|
|
65
68
|
}
|
|
66
69
|
await this.signalHoloFlow.handleSignalData(o);
|
|
67
70
|
}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
import { ISignalCountdownProps } from '../../../types';
|
|
2
3
|
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
4
|
private stopLineLayer;
|
|
4
|
-
private store;
|
|
5
5
|
private watchHandle;
|
|
6
|
-
|
|
6
|
+
private countdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, countdownPanelInfos: ISignalCountdownProps[]);
|
|
7
8
|
private stopLineMap;
|
|
8
9
|
initializeLayer(): Promise<void>;
|
|
9
10
|
private currentPanelScale;
|
|
10
11
|
private getPanelScale;
|
|
11
12
|
handleSignalData(data: any): Promise<void>;
|
|
12
13
|
clearSignal(): void;
|
|
13
|
-
/**
|
|
14
|
-
* 从停止线坐标计算面板位置
|
|
15
|
-
* @param coordinates
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
private getPanelPoint;
|
|
19
14
|
/**
|
|
20
15
|
* 从停止线坐标计算面板旋转角度
|
|
21
16
|
* @param coordinates
|
|
@@ -1,108 +1,103 @@
|
|
|
1
1
|
import * as d from "@arcgis/core/core/reactiveUtils";
|
|
2
|
-
import { Point as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import y from "../common-utils.mjs";
|
|
9
|
-
import L from "./signal-holo-flow.mjs";
|
|
10
|
-
class b extends L {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
super(e), this.stopLineLayer = new P(), this.store = g.useAppDataStore, this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
|
|
2
|
+
import { Point as h } from "@arcgis/core/geometry";
|
|
3
|
+
import w from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
+
import P from "./signal-holo-flow.mjs";
|
|
5
|
+
class L extends P {
|
|
6
|
+
constructor(n, s) {
|
|
7
|
+
super(n), this.stopLineLayer = new w(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = s, this.view.map.add(this.stopLineLayer);
|
|
13
8
|
}
|
|
14
9
|
async initializeLayer() {
|
|
15
10
|
var c, r;
|
|
16
11
|
console.time("初始化停止线图层");
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
12
|
+
let n = (r = (c = this.mapConfig.holoFlow) == null ? void 0 : c.signal) == null ? void 0 : r.stopLineLayer;
|
|
13
|
+
if (!n)
|
|
19
14
|
return;
|
|
20
|
-
|
|
21
|
-
const { roadId:
|
|
22
|
-
f ? f.set(
|
|
15
|
+
n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
|
|
16
|
+
const { roadId: o, nodeId: e, angle: i, destinationPoint: a } = t.properties, { coordinates: l } = t.geometry, f = this.stopLineMap.get(e);
|
|
17
|
+
f ? f.set(o, {
|
|
23
18
|
coord: l,
|
|
24
19
|
panelPoint: a,
|
|
25
|
-
angle:
|
|
20
|
+
angle: i
|
|
26
21
|
}) : this.stopLineMap.set(
|
|
27
|
-
|
|
22
|
+
e,
|
|
28
23
|
/* @__PURE__ */ new Map([
|
|
29
24
|
[
|
|
30
|
-
|
|
31
|
-
{ coord: l, panelPoint: a, angle:
|
|
25
|
+
o,
|
|
26
|
+
{ coord: l, panelPoint: a, angle: i }
|
|
32
27
|
]
|
|
33
28
|
])
|
|
34
29
|
);
|
|
35
30
|
}), console.timeEnd("初始化停止线图层");
|
|
36
31
|
}
|
|
37
32
|
getPanelScale() {
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
return
|
|
33
|
+
const n = this.view.scale;
|
|
34
|
+
let s = 1;
|
|
35
|
+
return n < 1e3 ? s = 1 : n < 2e3 ? s = 0.8 : s = 0.4, s;
|
|
41
36
|
}
|
|
42
|
-
async handleSignalData(
|
|
37
|
+
async handleSignalData(n) {
|
|
43
38
|
this.watchHandle || (this.watchHandle = d.watch(
|
|
44
39
|
() => this.view.extent,
|
|
45
40
|
() => {
|
|
46
41
|
const t = this.getPanelScale();
|
|
47
|
-
for (const
|
|
48
|
-
t !== this.currentPanelScale && (
|
|
49
|
-
const { mapPoint:
|
|
42
|
+
for (const o of this.countdownPanelProps) {
|
|
43
|
+
t !== this.currentPanelScale && (o.scale = t);
|
|
44
|
+
const { mapPoint: e } = o, i = this.view.toScreen({
|
|
50
45
|
type: "point",
|
|
51
|
-
x:
|
|
52
|
-
y:
|
|
46
|
+
x: e[0],
|
|
47
|
+
y: e[1]
|
|
53
48
|
});
|
|
54
|
-
|
|
49
|
+
o.position.left = i.x, o.position.top = i.y;
|
|
55
50
|
}
|
|
56
51
|
this.currentPanelScale = t;
|
|
57
52
|
}
|
|
58
53
|
));
|
|
59
|
-
const
|
|
54
|
+
const s = n.crossId, p = this.stopLineMap.get(s);
|
|
60
55
|
if (!p) {
|
|
61
|
-
console.log(`没有找到路口${
|
|
56
|
+
console.log(`没有找到路口${s}`);
|
|
62
57
|
return;
|
|
63
58
|
}
|
|
64
|
-
const c =
|
|
59
|
+
const c = n.phaseCountDownList, r = /* @__PURE__ */ new Map();
|
|
65
60
|
for (const t of c) {
|
|
66
|
-
let
|
|
61
|
+
let o = "";
|
|
67
62
|
for (let l of t.roadIdList)
|
|
68
63
|
if (l.startsWith("-") && (l = l.slice(1)), p.has(l)) {
|
|
69
|
-
|
|
64
|
+
o = l;
|
|
70
65
|
break;
|
|
71
66
|
}
|
|
72
|
-
if (!
|
|
73
|
-
console.log(`没有找到对应的进口道${
|
|
67
|
+
if (!o) {
|
|
68
|
+
console.log(`没有找到对应的进口道${s}--${o}`);
|
|
74
69
|
continue;
|
|
75
70
|
}
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
78
|
-
console.log(`没有找到对应的方向${
|
|
71
|
+
let e = r.get(o);
|
|
72
|
+
if (e || (e = {}, r.set(o, e)), !t.direction) {
|
|
73
|
+
console.log(`没有找到对应的方向${s}--${JSON.stringify(t)}`);
|
|
79
74
|
continue;
|
|
80
75
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
76
|
+
const i = t.direction.toLowerCase(), a = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
|
|
77
|
+
i === "u" ? (e.uNumber = t.leftTime, e.uColor = a) : i === "l" ? (e.lNumber = t.leftTime, e.lColor = a) : i === "s" ? (e.sNumber = t.leftTime, e.sColor = a) : i === "r" && (e.rNumber = t.leftTime, e.rColor = a);
|
|
83
78
|
}
|
|
84
|
-
r.forEach((t,
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
79
|
+
r.forEach((t, o) => {
|
|
80
|
+
const e = p.get(o);
|
|
81
|
+
if (!e)
|
|
87
82
|
return;
|
|
88
|
-
const
|
|
89
|
-
(a) => a.crossId ===
|
|
83
|
+
const i = this.countdownPanelProps.find(
|
|
84
|
+
(a) => a.crossId === s && a.roadId === o
|
|
90
85
|
);
|
|
91
|
-
if (
|
|
92
|
-
|
|
86
|
+
if (i)
|
|
87
|
+
i.lampStatus = t;
|
|
93
88
|
else {
|
|
94
|
-
const a =
|
|
89
|
+
const a = e.panelPoint, l = this.view.toScreen({
|
|
95
90
|
type: "point",
|
|
96
91
|
x: a[0],
|
|
97
92
|
y: a[1]
|
|
98
|
-
}), f = this.getPanelRotation(
|
|
99
|
-
this.
|
|
93
|
+
}), f = this.getPanelRotation(e.coord);
|
|
94
|
+
this.countdownPanelProps.push({
|
|
100
95
|
displayMode: "complex",
|
|
101
|
-
crossId:
|
|
102
|
-
roadId:
|
|
96
|
+
crossId: s,
|
|
97
|
+
roadId: o,
|
|
103
98
|
mapPoint: a,
|
|
104
99
|
// 定位点地理坐标
|
|
105
|
-
stopLine:
|
|
100
|
+
stopLine: e.coord,
|
|
106
101
|
// 关联的停止线坐标
|
|
107
102
|
position: { left: l.x, top: l.y },
|
|
108
103
|
// 定位点屏幕坐标
|
|
@@ -116,39 +111,27 @@ class b extends L {
|
|
|
116
111
|
});
|
|
117
112
|
}
|
|
118
113
|
clearSignal() {
|
|
119
|
-
var
|
|
120
|
-
this.stopLineLayer.removeAll(), this.
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* 从停止线坐标计算面板位置
|
|
124
|
-
* @param coordinates
|
|
125
|
-
* @returns
|
|
126
|
-
*/
|
|
127
|
-
getPanelPoint(e) {
|
|
128
|
-
const i = y.getCenterPointInLine(e), p = e[0], c = e[e.length - 1];
|
|
129
|
-
let t = w(h.point(p), h.point(c)) - 90;
|
|
130
|
-
return t < -180 && (t += 360), u(h.point(i), 1, t, {
|
|
131
|
-
units: "meters"
|
|
132
|
-
}).geometry.coordinates;
|
|
114
|
+
var n;
|
|
115
|
+
this.stopLineLayer.removeAll(), this.countdownPanelProps = [], (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
|
|
133
116
|
}
|
|
134
117
|
/**
|
|
135
118
|
* 从停止线坐标计算面板旋转角度
|
|
136
119
|
* @param coordinates
|
|
137
120
|
* @returns
|
|
138
121
|
*/
|
|
139
|
-
getPanelRotation(
|
|
140
|
-
const
|
|
141
|
-
x:
|
|
142
|
-
y:
|
|
122
|
+
getPanelRotation(n) {
|
|
123
|
+
const s = n[0], p = new h({
|
|
124
|
+
x: s[0],
|
|
125
|
+
y: s[1],
|
|
143
126
|
spatialReference: this.view.spatialReference
|
|
144
|
-
}), c = this.view.toScreen(p), r =
|
|
127
|
+
}), c = this.view.toScreen(p), r = n[n.length - 1], t = new h({
|
|
145
128
|
x: r[0],
|
|
146
129
|
y: r[1],
|
|
147
130
|
spatialReference: this.view.spatialReference
|
|
148
|
-
}),
|
|
149
|
-
return Math.atan2(
|
|
131
|
+
}), o = this.view.toScreen(t), e = o.x - c.x, i = o.y - c.y;
|
|
132
|
+
return Math.atan2(i, e) * (180 / Math.PI);
|
|
150
133
|
}
|
|
151
134
|
}
|
|
152
135
|
export {
|
|
153
|
-
|
|
136
|
+
L as default
|
|
154
137
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
|
-
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
3
|
+
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } 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';
|
|
@@ -34,9 +34,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
34
34
|
mapConfig: {};
|
|
35
35
|
saveTrackLog: boolean;
|
|
36
36
|
isSketching: boolean;
|
|
37
|
-
countdownPanels:
|
|
37
|
+
countdownPanels: ISignalCountdownProps[];
|
|
38
38
|
}, {}, {}>;
|
|
39
|
-
|
|
39
|
+
countdownPanelProps: {
|
|
40
40
|
displayMode: string;
|
|
41
41
|
crossId: string;
|
|
42
42
|
roadId: string;
|
|
@@ -58,7 +58,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
58
58
|
rNumber?: number | undefined;
|
|
59
59
|
rColor?: string | undefined;
|
|
60
60
|
};
|
|
61
|
-
}[]
|
|
61
|
+
}[];
|
|
62
62
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
63
63
|
startSaveTrackLog: () => void;
|
|
64
64
|
downloadTrackLog: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("./stores/index.js");require("./style/index.css");const _e=require("./utils/holo-flow/index.js"),qe=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ie=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),k=require("./utils/overlay.js"),Me=require("./utils/queue-length.js"),A=require("./utils/road-config-tool/index.js"),L=require("./utils/signal-control-area-controller/index.js"),xe=require("./utils/traffic-flow.js"),Be={class:"gis-viewer"},He={style:{position:"absolute",bottom:"10px",left:"10px"}},Ve=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:b,emit:D}){const p=n.ref(null);let i,u,l,o,a,r,g,t,s;const f=n.ref(!1);S.registerStore();const _=S.default.useAppDataStore,h=n.reactive([]);n.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",d=>{d.ctrlKey&&d.key==="i"&&(f.value=!f.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:m}=e.appContext.config.globalProperties,c=await(await fetch(C.config)).json();c.assetsRoot=C.assetsRoot||m,_.mapConfig=c,u=new Ie.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(d,v,w,De)=>{y("markerClick",d,v,w,De)},mapClickCallback:(d,v,w)=>{y("mapClick",d,v,w)}}),a=new _e.default(i,h),await a.init(),y("mapLoaded")}),n.onUnmounted(()=>{s==null||s.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const q=n.computed(()=>i),I=()=>{const e=S.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{a.downloadTrackLog()},x=async e=>await u.setMapCenter(e),B=async e=>await u.setMapCamera(e),H=async e=>await u.lookAt(e),V=e=>u.setLayerVisibility(e),P=(e,m)=>u.requestCoordinateTransform(e,m),N=e=>{u.cancelCoordinateTransform(e)},E=e=>{u.setMapZoomRange(e)},j=e=>(l||(l=new A.default(i)),l.showLaneNumber(e)),z=()=>{l==null||l.clearLaneNumber()},Q=async e=>(l||(l=new A.default(i)),await l.initializeSearch(e)),Z=async()=>l==null?void 0:l.calCrossIndicatorArea(),K=async()=>{},U=async(e,m)=>{o||(o=new xe.default(i)),o.connectTrafficFlow(e,m)},G=()=>{o==null||o.disconnectTrafficFlow()},J=async e=>{a.handleVehicleTraceData(e)},W=()=>{a.clearHoloTrace()},X=e=>{a.setInterpolate(e)},Y=async e=>{await a.handleSignalData(e)},F=()=>{a.clearHoloSignal()},R=e=>{o==null||o.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},$=e=>{a==null||a.togglePause(e)},ee=e=>{o==null||o.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},te=e=>{a==null||a.updatePanelContent(e)},ae=async e=>(r||(r=new k.default(i)),r.addOverlays(e)),ne=e=>(r||(r=new k.default(i)),r.addMask(e)),re=()=>{r==null||r.removeMask()},se=e=>r==null?void 0:r.removeOverlaysByType(e),oe=e=>r==null?void 0:r.removeOverlaysById(e),ie=()=>r==null?void 0:r.removeAllOverlays(),ce=()=>{r==null||r.showAllOverlays()},le=e=>{g||(g=new Me.default(i)),g.updateQueueLength(e)},ue=()=>{g==null||g.removeQueueLength()},me=async(e,m)=>(t||(t=new O.default(i)),await t.showOpenDriveFromServer(e,m)),de=async e=>(t||(t=new O.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),ge=async()=>await(t==null?void 0:t.clearOpenDrive()),pe=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},fe=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},Se=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},he=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Ce=e=>(s||(s=new L.default(i)),s.showSignalControlArea(e)),Oe=()=>{s==null||s.clearSignalControlArea()},ke=async e=>s?await s.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ae=async e=>s?await s.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=()=>s?s.resetHighlight():{status:-1,message:"未加载信号控制区"},Te=e=>(s||(s=new L.default(i)),s.showSubSignalControlArea(e)),be=()=>s?s.editSubSignalArea():{status:-1,message:"未加载信号控制区"},C=T,y=D;return b({mapViewer:q,setLayerVisibility:V,setMapCenter:x,lookAt:H,setMapCamera:B,setMapZoomRange:E,requestCoordinateTransform:P,cancelCoordinateTransform:N,addOverlays:ae,addMask:ne,removeMask:re,showAllOverlays:ce,removeOverlaysByType:se,removeOverlaysById:oe,removeAllOverlays:ie,showLaneNumber:j,clearLaneNumber:z,initializeAreaTool:Q,calCrossIndicatorArea:Z,calRoadIndicatorArea:K,connectCarFlow:U,disconnectCarFlow:G,handleHoloVehicleTraceData:J,clearHoloTrace:W,handleHoloSignalData:Y,clearHoloSignal:F,setInterpolate:X,toggleTrafficInfo:R,toggleTrafficObject:ee,toggleVehicleInfo:te,togglePause:$,updateQueueLength:le,removeQueueLength:ue,showOpenDriveFromServer:me,showOpenDriveFromFile:de,clearOpenDrive:ge,geometrySearchInOpenDrive:ve,findSumoInOpenDrive:pe,selectSumoInOpenDrive:fe,unselectSumoInOpenDrive:ye,getSumoInfo:we,splitOpenDriveLane:Se,clearSplitOpenDriveLane:he,showSignalControlArea:Ce,clearSignalControlArea:Oe,locateSignalControlArea:ke,highlightSignalControlArea:Ae,resetHighlightSignalControlArea:Le,showSubSignalControlArea:Te,editSubSignalControlArea:be}),(e,m)=>(n.openBlock(),n.createElementBlock("div",Be,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[n.withDirectives(n.createElementVNode("div",He,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:I}," 开始记录 "),n.createElementVNode("button",{onClick:M},"下载日志")],512),[[n.vShow,f.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h,(c,d)=>(n.openBlock(),n.createBlock(qe.default,{key:d,"display-mode":c.displayMode,"road-id":c.crossId,"cross-id":c.roadId,"map-point":c.mapPoint,"stop-line":c.stopLine,position:c.position,rotation:c.rotation,scale:c.scale,"lamp-status":c.lampStatus},null,8,["display-mode","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=Ve;
|
|
@@ -25,7 +25,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
25
25
|
isSketching: boolean;
|
|
26
26
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
27
27
|
}, {}, {}>;
|
|
28
|
-
|
|
28
|
+
countdownPanelProps: {
|
|
29
29
|
displayMode: string;
|
|
30
30
|
crossId: string;
|
|
31
31
|
roadId: string;
|
|
@@ -47,7 +47,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
47
47
|
rNumber?: number | undefined;
|
|
48
48
|
rColor?: string | undefined;
|
|
49
49
|
};
|
|
50
|
-
}[]
|
|
50
|
+
}[];
|
|
51
51
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
52
52
|
startSaveTrackLog: () => void;
|
|
53
53
|
downloadTrackLog: () => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Graphic from '@arcgis/core/Graphic';
|
|
2
|
+
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
4
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
+
interface GreenWaveLineOptions {
|
|
6
|
+
viewer: MapView | SceneView;
|
|
7
|
+
graphicsLayerOptions: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface roadPath {
|
|
12
|
+
paths: [number, number][];
|
|
13
|
+
symbol: any;
|
|
14
|
+
attributes: any;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface animationOptions {
|
|
18
|
+
isAnimation: boolean;
|
|
19
|
+
positive?: boolean;
|
|
20
|
+
positiveColor?: number[];
|
|
21
|
+
negative?: boolean;
|
|
22
|
+
negativeColor?: number[];
|
|
23
|
+
}
|
|
24
|
+
export default class GreenWaveLine {
|
|
25
|
+
private viewer;
|
|
26
|
+
overlayLayer: GraphicsLayer;
|
|
27
|
+
customGreenWaveLineView: any;
|
|
28
|
+
material: THREE.ShaderMaterial;
|
|
29
|
+
renderer: THREE.WebGLRenderer;
|
|
30
|
+
threeScene: THREE.Scene;
|
|
31
|
+
camera: THREE.PerspectiveCamera;
|
|
32
|
+
private defaultAnimationOptions;
|
|
33
|
+
constructor(options: GreenWaveLineOptions);
|
|
34
|
+
addGreenWaveLine(paths: roadPath[], options?: animationOptions): void;
|
|
35
|
+
getAnimationPath(paths: [number, number][], options?: animationOptions): any;
|
|
36
|
+
createLine(paths: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
37
|
+
addPointText(points: any[]): void;
|
|
38
|
+
createPointText(point: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
39
|
+
/**
|
|
40
|
+
* 隐藏覆盖物
|
|
41
|
+
*
|
|
42
|
+
* @param {string[]} [ids]
|
|
43
|
+
* @memberof GreenWaveLine
|
|
44
|
+
*/
|
|
45
|
+
hideWaveLine(ids?: string[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* 显示覆盖物
|
|
48
|
+
*
|
|
49
|
+
* @param {string[]} [ids]
|
|
50
|
+
* @memberof GreenWaveLine
|
|
51
|
+
*/
|
|
52
|
+
showWaveLine(ids?: string[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* 隐藏图层
|
|
55
|
+
*
|
|
56
|
+
* @memberof GreenWaveLine
|
|
57
|
+
*/
|
|
58
|
+
hideLayer(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 显示图层
|
|
61
|
+
*
|
|
62
|
+
* @memberof Overlay
|
|
63
|
+
*/
|
|
64
|
+
showLayer(): void;
|
|
65
|
+
clearGreenWaveLine(): void;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IToggleTrafficInfoParams } from '../../../types';
|
|
1
|
+
import { ISignalCountdownProps, IToggleTrafficInfoParams } from '../../../types';
|
|
2
2
|
export default class Index {
|
|
3
3
|
private readonly view;
|
|
4
4
|
private traceHoloFlow;
|
|
5
5
|
private signalHoloFlow;
|
|
6
|
-
|
|
6
|
+
private signalCountdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, signalCountdownPanelProps: ISignalCountdownProps[]);
|
|
7
8
|
init(): Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* 处理全息流轨迹数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),t=require("../../../types/index.js"),s=require("../../stores/index.js"),n=require("./signal-holo-flow.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),t=require("../../../types/index.js"),s=require("../../stores/index.js"),n=require("./signal-holo-flow.js"),r=require("./signal-holo-flow-lsr.js"),c=require("./trace-holo-flow.js");class h{constructor(e,o){this.view=e,this.signalCountdownPanelProps=o}async init(){this.traceHoloFlow=new c.default(this.view),await this.traceHoloFlow.init()}handleVehicleTraceData(e){this.traceHoloFlow.handleVehicleTraceData(e)}toggleTrafficObject(e){switch(e.name.toLowerCase()){case"groundVehicle".toLowerCase():this.traceHoloFlow.toggleGroundVehicle(e.visible);break;case"elevatedVehicle".toLowerCase():this.traceHoloFlow.toggleElevatedVehicle(e.visible);break}}clearHoloTrace(){this.traceHoloFlow.clearTrace()}toggleTrafficInfo(e){this.traceHoloFlow.toggleTrafficInfo(e)}togglePause(e){this.traceHoloFlow.togglePause(e)}updatePanelContent(e){let o=t.EVehiclePlateState.None;switch(e){case"none":o=t.EVehiclePlateState.None;break;case"plateNumber":o=t.EVehiclePlateState.PlateNumber;break;case"vehicleId":o=t.EVehiclePlateState.Id;break;case"mix":o=t.EVehiclePlateState.Mix;break}this.traceHoloFlow.updatePanelContent(o)}async handleSignalData(e){var o,l;if(!this.signalHoloFlow){const a=s.default.useAppDataStore;((l=(o=i.toRaw(a.mapConfig).holoFlow)==null?void 0:o.signal)==null?void 0:l.style)==="LSR"?this.signalHoloFlow=new r.default(this.view,this.signalCountdownPanelProps):this.signalHoloFlow=new n.default(this.view),await this.signalHoloFlow.initializeLayer()}await this.signalHoloFlow.handleSignalData(e)}clearHoloSignal(){var e;(e=this.signalHoloFlow)==null||e.clearSignal()}setInterpolate(e){this.traceHoloFlow.setInterpolate(e)}downloadTrackLog(){this.traceHoloFlow.downloadLog()}}exports.default=h;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
import { ISignalCountdownProps } from '../../../types';
|
|
2
3
|
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
4
|
private stopLineLayer;
|
|
4
|
-
private store;
|
|
5
5
|
private watchHandle;
|
|
6
|
-
|
|
6
|
+
private countdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, countdownPanelInfos: ISignalCountdownProps[]);
|
|
7
8
|
private stopLineMap;
|
|
8
9
|
initializeLayer(): Promise<void>;
|
|
9
10
|
private currentPanelScale;
|
|
10
11
|
private getPanelScale;
|
|
11
12
|
handleSignalData(data: any): Promise<void>;
|
|
12
13
|
clearSignal(): void;
|
|
13
|
-
/**
|
|
14
|
-
* 从停止线坐标计算面板位置
|
|
15
|
-
* @param coordinates
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
private getPanelPoint;
|
|
19
14
|
/**
|
|
20
15
|
* 从停止线坐标计算面板旋转角度
|
|
21
16
|
* @param coordinates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/core/reactiveUtils"),d=require("@arcgis/core/geometry"),P=require("@arcgis/core/layers/GraphicsLayer"),w=require("./signal-holo-flow.js");function g(f){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const o in f)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(f,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>f[o]})}}return t.default=f,Object.freeze(t)}const m=g(u);class y extends w.default{constructor(t,o){super(t),this.stopLineLayer=new P,this.watchHandle=null,this.stopLineMap=new Map,this.countdownPanelProps=o,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var p,c;console.time("初始化停止线图层");let t=(c=(p=this.mapConfig.holoFlow)==null?void 0:p.signal)==null?void 0:c.stopLineLayer;if(!t)return;t=this.mapConfig.assetsRoot+"/"+t,(await(await fetch(t)).json()).features.forEach(n=>{const{roadId:s,nodeId:e,angle:i,destinationPoint:a}=n.properties,{coordinates:l}=n.geometry,h=this.stopLineMap.get(e);h?h.set(s,{coord:l,panelPoint:a,angle:i}):this.stopLineMap.set(e,new Map([[s,{coord:l,panelPoint:a,angle:i}]]))}),console.timeEnd("初始化停止线图层")}getPanelScale(){const t=this.view.scale;let o=1;return t<1e3?o=1:t<2e3?o=.8:o=.4,o}async handleSignalData(t){this.watchHandle||(this.watchHandle=m.watch(()=>this.view.extent,()=>{const n=this.getPanelScale();for(const s of this.countdownPanelProps){n!==this.currentPanelScale&&(s.scale=n);const{mapPoint:e}=s,i=this.view.toScreen({type:"point",x:e[0],y:e[1]});s.position.left=i.x,s.position.top=i.y}this.currentPanelScale=n}));const o=t.crossId,r=this.stopLineMap.get(o);if(!r){console.log(`没有找到路口${o}`);return}const p=t.phaseCountDownList,c=new Map;for(const n of p){let s="";for(let l of n.roadIdList)if(l.startsWith("-")&&(l=l.slice(1)),r.has(l)){s=l;break}if(!s){console.log(`没有找到对应的进口道${o}--${s}`);continue}let e=c.get(s);if(e||(e={},c.set(s,e)),!n.direction){console.log(`没有找到对应的方向${o}--${JSON.stringify(n)}`);continue}const i=n.direction.toLowerCase(),a=n.color===1?"red":n.color===2?"yellow":"green";i==="u"?(e.uNumber=n.leftTime,e.uColor=a):i==="l"?(e.lNumber=n.leftTime,e.lColor=a):i==="s"?(e.sNumber=n.leftTime,e.sColor=a):i==="r"&&(e.rNumber=n.leftTime,e.rColor=a)}c.forEach((n,s)=>{const e=r.get(s);if(!e)return;const i=this.countdownPanelProps.find(a=>a.crossId===o&&a.roadId===s);if(i)i.lampStatus=n;else{const a=e.panelPoint,l=this.view.toScreen({type:"point",x:a[0],y:a[1]}),h=this.getPanelRotation(e.coord);this.countdownPanelProps.push({displayMode:"complex",crossId:o,roadId:s,mapPoint:a,stopLine:e.coord,position:{left:l.x,top:l.y},rotation:h,scale:this.getPanelScale(),lampStatus:n})}})}clearSignal(){var t;this.stopLineLayer.removeAll(),this.countdownPanelProps=[],(t=this.watchHandle)==null||t.remove(),this.watchHandle=null}getPanelRotation(t){const o=t[0],r=new d.Point({x:o[0],y:o[1],spatialReference:this.view.spatialReference}),p=this.view.toScreen(r),c=t[t.length-1],n=new d.Point({x:c[0],y:c[1],spatialReference:this.view.spatialReference}),s=this.view.toScreen(n),e=s.x-p.x,i=s.y-p.y;return Math.atan2(i,e)*(180/Math.PI)}}exports.default=y;
|