gisviewer-vue3-arcgis 1.0.194 → 1.0.195
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 -0
- package/es/src/gis-map/gis-map.vue.mjs +67 -62
- package/es/src/gis-map/index.d.ts +4 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +15 -3
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +67 -34
- package/es/src/types/index.d.ts +1 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +4 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +15 -3
- package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -142,6 +142,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
142
142
|
message: string;
|
|
143
143
|
};
|
|
144
144
|
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
145
|
+
stopAddGreenWaveBand: () => {
|
|
146
|
+
status: number;
|
|
147
|
+
message: string;
|
|
148
|
+
} | undefined;
|
|
145
149
|
props: any;
|
|
146
150
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
147
151
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import D, { registerStore as
|
|
1
|
+
import { defineComponent as Ge, ref as b, reactive as Qe, onMounted as je, getCurrentInstance as Ze, onUnmounted as $e, computed as qe, openBlock as h, createElementBlock as k, createElementVNode as p, withDirectives as Ke, vShow as Ue, Fragment as Je, renderList as Re, createBlock as Xe } from "vue";
|
|
2
|
+
import D, { registerStore as Ye } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import Fe from "./utils/green-wave-band-controller/index.mjs";
|
|
5
|
+
import et from "./utils/holo-flow/index.mjs";
|
|
6
|
+
import tt from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
7
|
+
import at from "./utils/map-initializer.mjs";
|
|
8
8
|
import L from "./utils/open-drive-renderer/index.mjs";
|
|
9
9
|
import T from "./utils/overlay.mjs";
|
|
10
|
-
import
|
|
10
|
+
import nt from "./utils/queue-length.mjs";
|
|
11
11
|
import I from "./utils/road-config-tool/index.mjs";
|
|
12
12
|
import B from "./utils/signal-control-area-controller/index.mjs";
|
|
13
|
-
import
|
|
14
|
-
const
|
|
13
|
+
import rt from "./utils/traffic-flow.mjs";
|
|
14
|
+
const st = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, wt = /* @__PURE__ */ Ge({
|
|
15
15
|
__name: "gis-map",
|
|
16
16
|
props: {
|
|
17
17
|
config: {},
|
|
@@ -19,51 +19,51 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
19
19
|
},
|
|
20
20
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
21
21
|
setup(M, { expose: _, emit: x }) {
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
const f =
|
|
25
|
-
|
|
26
|
-
const H = D.useAppDataStore, O =
|
|
27
|
-
|
|
28
|
-
if (!
|
|
22
|
+
const S = b(null);
|
|
23
|
+
let o, l, c, s, n, r, g, t, a, d;
|
|
24
|
+
const f = b(!1);
|
|
25
|
+
Ye();
|
|
26
|
+
const H = D.useAppDataStore, O = Qe([]);
|
|
27
|
+
je(async () => {
|
|
28
|
+
if (!S.value)
|
|
29
29
|
return;
|
|
30
30
|
document.addEventListener("keydown", (m) => {
|
|
31
31
|
m.ctrlKey && m.key === "i" && (f.value = !f.value);
|
|
32
32
|
});
|
|
33
|
-
const e =
|
|
34
|
-
i.assetsRoot =
|
|
35
|
-
container:
|
|
33
|
+
const e = Ze(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(A.config)).json();
|
|
34
|
+
i.assetsRoot = A.assetsRoot || u, H.mapConfig = i, l = new at(), o = await l.initialize({
|
|
35
|
+
container: S.value,
|
|
36
36
|
mapConfig: i,
|
|
37
|
-
markerClickCallback: (m,
|
|
38
|
-
|
|
37
|
+
markerClickCallback: (m, y, w, Ee) => {
|
|
38
|
+
v("markerClick", m, y, w, Ee);
|
|
39
39
|
},
|
|
40
|
-
mapClickCallback: (m,
|
|
41
|
-
|
|
40
|
+
mapClickCallback: (m, y, w) => {
|
|
41
|
+
v("mapClick", m, y, w);
|
|
42
42
|
}
|
|
43
|
-
}), n = new
|
|
44
|
-
}),
|
|
45
|
-
a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(),
|
|
43
|
+
}), n = new et(o, O), await n.init(), v("mapLoaded");
|
|
44
|
+
}), $e(() => {
|
|
45
|
+
a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(), s == null || s.disconnectTrafficFlow();
|
|
46
46
|
});
|
|
47
|
-
const V =
|
|
47
|
+
const V = qe(() => o), P = () => {
|
|
48
48
|
const e = D.useAppDataStore;
|
|
49
49
|
e.saveTrackLog = !0;
|
|
50
50
|
}, N = () => {
|
|
51
51
|
n.downloadTrackLog();
|
|
52
52
|
}, z = () => {
|
|
53
53
|
C("vehicleId");
|
|
54
|
-
},
|
|
54
|
+
}, W = () => {
|
|
55
55
|
C("plateNumber");
|
|
56
|
-
},
|
|
56
|
+
}, E = async (e) => await l.setMapCenter(e), G = async (e) => await l.setMapCamera(e), Q = async (e) => await l.lookAt(e), j = (e) => l.setLayerVisibility(e), Z = (e, u) => l.requestCoordinateTransform(e, u), $ = (e) => {
|
|
57
57
|
l.cancelCoordinateTransform(e);
|
|
58
58
|
}, q = (e) => {
|
|
59
59
|
l.setMapZoomRange(e);
|
|
60
|
-
}, K = (e) => (c || (c = new I(
|
|
60
|
+
}, K = (e) => (c || (c = new I(o)), c.showLaneNumber(e)), U = () => {
|
|
61
61
|
c == null || c.clearLaneNumber();
|
|
62
|
-
}, J = async (e) => (c || (c = new I(
|
|
62
|
+
}, J = async (e) => (c || (c = new I(o)), await c.initializeSearch(e)), R = async () => c == null ? void 0 : c.calCrossIndicatorArea(), X = async () => {
|
|
63
63
|
}, Y = async (e, u) => {
|
|
64
|
-
|
|
64
|
+
s || (s = new rt(o)), s.connectTrafficFlow(e, u);
|
|
65
65
|
}, F = () => {
|
|
66
|
-
|
|
66
|
+
s == null || s.disconnectTrafficFlow();
|
|
67
67
|
}, ee = async (e) => {
|
|
68
68
|
n.handleVehicleTraceData(e);
|
|
69
69
|
}, te = () => {
|
|
@@ -74,23 +74,23 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
74
74
|
await n.handleSignalData(e);
|
|
75
75
|
}, re = () => {
|
|
76
76
|
n.clearHoloSignal();
|
|
77
|
-
}, oe = (e) => {
|
|
78
|
-
o == null || o.toggleTrafficInfo(e), n == null || n.toggleTrafficInfo(e);
|
|
79
77
|
}, se = (e) => {
|
|
78
|
+
s == null || s.toggleTrafficInfo(e), n == null || n.toggleTrafficInfo(e);
|
|
79
|
+
}, oe = (e) => {
|
|
80
80
|
n == null || n.togglePause(e);
|
|
81
81
|
}, ie = (e) => {
|
|
82
|
-
|
|
82
|
+
s == null || s.toggleTrafficObject(e), n == null || n.toggleTrafficObject(e);
|
|
83
83
|
}, C = (e) => {
|
|
84
84
|
n == null || n.updatePanelContent(e);
|
|
85
|
-
}, ce = async (e) => (r || (r = new T(
|
|
85
|
+
}, ce = async (e) => (r || (r = new T(o)), r.addOverlays(e)), le = (e) => (r || (r = new T(o)), r.addMask(e)), ue = () => {
|
|
86
86
|
r == null || r.removeMask();
|
|
87
87
|
}, me = (e) => r == null ? void 0 : r.removeOverlaysByType(e), ge = (e) => r == null ? void 0 : r.removeOverlaysById(e), pe = () => r == null ? void 0 : r.removeAllOverlays(), de = () => {
|
|
88
88
|
r == null || r.showAllOverlays();
|
|
89
89
|
}, Se = (e) => {
|
|
90
|
-
g || (g = new
|
|
90
|
+
g || (g = new nt(o)), g.updateQueueLength(e);
|
|
91
91
|
}, fe = () => {
|
|
92
92
|
g == null || g.removeQueueLength();
|
|
93
|
-
}, Ce = async (e, u) => (t || (t = new L(
|
|
93
|
+
}, Ce = async (e, u) => (t || (t = new L(o)), await t.showOpenDriveFromServer(e, u)), ve = async (e) => (t || (t = new L(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ye = async () => await (t == null ? void 0 : t.clearOpenDrive()), we = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
94
94
|
status: -1,
|
|
95
95
|
message: "未加载OpenDrive地图"
|
|
96
96
|
}, he = async (e) => t ? t.selectSumo(e) : {
|
|
@@ -99,10 +99,10 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
99
99
|
}, Oe = async (e) => t ? t.unselectSumo(e) : {
|
|
100
100
|
status: -1,
|
|
101
101
|
message: "未加载OpenDrive地图"
|
|
102
|
-
},
|
|
102
|
+
}, Ae = async (e) => t ? await t.geometrySearch(e) : {
|
|
103
103
|
status: -1,
|
|
104
104
|
message: "未加载OpenDrive地图"
|
|
105
|
-
},
|
|
105
|
+
}, be = async (e) => t ? await t.getSumoInfo(e) : {
|
|
106
106
|
status: -1,
|
|
107
107
|
message: "未加载OpenDrive地图"
|
|
108
108
|
}, ke = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
@@ -111,17 +111,21 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
111
111
|
}, De = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
|
|
112
112
|
status: -1,
|
|
113
113
|
message: "未加载OpenDrive地图"
|
|
114
|
-
}, Le = (e) => (a || (a = new B(
|
|
114
|
+
}, Le = (e) => (a || (a = new B(o)), a.showSignalControlArea(e)), Te = () => {
|
|
115
115
|
a == null || a.clearSignalControlArea();
|
|
116
|
-
}, Ie = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Be = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new B(
|
|
116
|
+
}, Ie = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Be = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new B(o)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = () => a ? a.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Ve = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Ne = (e) => a ? a.changeSubSignalControlAreaBorderVisibility(
|
|
117
117
|
e
|
|
118
|
-
) : { status: -1, message: "未加载信号控制区" }, ze = (e) => (
|
|
118
|
+
) : { status: -1, message: "未加载信号控制区" }, ze = (e) => (d || (d = new Fe(o)), d.addGreenWaveBand(e)), We = () => {
|
|
119
|
+
if (!d)
|
|
120
|
+
return { status: -1, message: "未加载绿波带" };
|
|
121
|
+
d.stopAddGreenWaveBand();
|
|
122
|
+
}, A = M, v = x;
|
|
119
123
|
return _({
|
|
120
124
|
mapViewer: V,
|
|
121
|
-
setLayerVisibility:
|
|
122
|
-
setMapCenter:
|
|
123
|
-
lookAt:
|
|
124
|
-
setMapCamera:
|
|
125
|
+
setLayerVisibility: j,
|
|
126
|
+
setMapCenter: E,
|
|
127
|
+
lookAt: Q,
|
|
128
|
+
setMapCamera: G,
|
|
125
129
|
setMapZoomRange: q,
|
|
126
130
|
requestCoordinateTransform: Z,
|
|
127
131
|
cancelCoordinateTransform: $,
|
|
@@ -144,20 +148,20 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
144
148
|
handleHoloSignalData: ne,
|
|
145
149
|
clearHoloSignal: re,
|
|
146
150
|
setInterpolate: ae,
|
|
147
|
-
toggleTrafficInfo:
|
|
151
|
+
toggleTrafficInfo: se,
|
|
148
152
|
toggleTrafficObject: ie,
|
|
149
153
|
toggleVehicleInfo: C,
|
|
150
|
-
togglePause:
|
|
154
|
+
togglePause: oe,
|
|
151
155
|
updateQueueLength: Se,
|
|
152
156
|
removeQueueLength: fe,
|
|
153
157
|
showOpenDriveFromServer: Ce,
|
|
154
|
-
showOpenDriveFromFile:
|
|
155
|
-
clearOpenDrive:
|
|
156
|
-
geometrySearchInOpenDrive:
|
|
158
|
+
showOpenDriveFromFile: ve,
|
|
159
|
+
clearOpenDrive: ye,
|
|
160
|
+
geometrySearchInOpenDrive: Ae,
|
|
157
161
|
findSumoInOpenDrive: we,
|
|
158
162
|
selectSumoInOpenDrive: he,
|
|
159
163
|
unselectSumoInOpenDrive: Oe,
|
|
160
|
-
getSumoInfo:
|
|
164
|
+
getSumoInfo: be,
|
|
161
165
|
splitOpenDriveLane: ke,
|
|
162
166
|
clearSplitOpenDriveLane: De,
|
|
163
167
|
showSignalControlArea: Le,
|
|
@@ -171,14 +175,15 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
171
175
|
selectSubSignalControlAreaCross: Ve,
|
|
172
176
|
unselectSubSignalControlAreaCross: Pe,
|
|
173
177
|
changeSubSignalControlAreaBorderVisibility: Ne,
|
|
174
|
-
addGreenWaveBand: ze
|
|
175
|
-
|
|
178
|
+
addGreenWaveBand: ze,
|
|
179
|
+
stopAddGreenWaveBand: We
|
|
180
|
+
}), (e, u) => (h(), k("div", st, [
|
|
176
181
|
p("div", {
|
|
177
182
|
class: "gis-viewer-main",
|
|
178
183
|
ref_key: "mapContainer",
|
|
179
|
-
ref:
|
|
184
|
+
ref: S
|
|
180
185
|
}, [
|
|
181
|
-
|
|
186
|
+
Ke(p("div", ot, [
|
|
182
187
|
p("button", {
|
|
183
188
|
style: { "margin-right": "10px" },
|
|
184
189
|
onClick: P
|
|
@@ -191,12 +196,12 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
191
196
|
style: { "margin-right": "10px" },
|
|
192
197
|
onClick: z
|
|
193
198
|
}, " 显示车辆id "),
|
|
194
|
-
p("button", { onClick:
|
|
199
|
+
p("button", { onClick: W }, "显示车辆号牌")
|
|
195
200
|
], 512), [
|
|
196
|
-
[
|
|
201
|
+
[Ue, f.value]
|
|
197
202
|
])
|
|
198
203
|
], 512),
|
|
199
|
-
(h(!0), k(
|
|
204
|
+
(h(!0), k(Je, null, Re(O, (i, m) => (h(), Xe(tt, {
|
|
200
205
|
key: m,
|
|
201
206
|
"display-mode": i.displayMode,
|
|
202
207
|
"road-id": i.crossId,
|
|
@@ -212,5 +217,5 @@ const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom
|
|
|
212
217
|
}
|
|
213
218
|
});
|
|
214
219
|
export {
|
|
215
|
-
|
|
220
|
+
wt as default
|
|
216
221
|
};
|
|
@@ -130,6 +130,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
130
130
|
message: string;
|
|
131
131
|
};
|
|
132
132
|
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
133
|
+
stopAddGreenWaveBand: () => {
|
|
134
|
+
status: number;
|
|
135
|
+
message: string;
|
|
136
|
+
} | undefined;
|
|
133
137
|
props: any;
|
|
134
138
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
135
139
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
2
|
export default class GreenWaveBandController {
|
|
3
3
|
private view;
|
|
4
|
-
private
|
|
4
|
+
private allNodesLayer;
|
|
5
5
|
private viewClickWatcher?;
|
|
6
6
|
private openDriveServer;
|
|
7
7
|
private selectedNodeIds;
|
|
8
|
+
private addCrossCallback;
|
|
9
|
+
private removeCrossCallback;
|
|
10
|
+
private removeAllCrossCallback;
|
|
8
11
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
9
12
|
/**
|
|
10
13
|
* 新增绿波带
|
|
11
|
-
* @param
|
|
14
|
+
* @param params
|
|
12
15
|
*/
|
|
13
|
-
addGreenWaveBand(
|
|
16
|
+
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
14
17
|
stopAddGreenWaveBand(): void;
|
|
18
|
+
/**
|
|
19
|
+
* 显示所有路口,进去待选状态
|
|
20
|
+
* @param nodeAttributes
|
|
21
|
+
*/
|
|
15
22
|
private showAllNodes;
|
|
23
|
+
/**
|
|
24
|
+
* 点击待选/已选路口
|
|
25
|
+
* @param event
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
16
28
|
private handleViewClick;
|
|
17
29
|
/**
|
|
18
30
|
* 显示下游节点
|
|
@@ -1,71 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
class
|
|
1
|
+
import d from "@arcgis/core/Graphic";
|
|
2
|
+
import c from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import n from "axios";
|
|
4
|
+
class u {
|
|
5
5
|
constructor(e) {
|
|
6
|
-
this.selectedNodeIds = [], this.view = e, this.
|
|
7
|
-
id: "
|
|
8
|
-
}), this.view.map.
|
|
6
|
+
this.selectedNodeIds = [], this.view = e, this.allNodesLayer = new c({
|
|
7
|
+
id: "allNodesLayer"
|
|
8
|
+
}), this.view.map.add(this.allNodesLayer);
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 新增绿波带
|
|
12
|
-
* @param
|
|
12
|
+
* @param params
|
|
13
13
|
*/
|
|
14
14
|
addGreenWaveBand(e) {
|
|
15
|
-
this.selectedNodeIds = [], this.openDriveServer = e.odrServer, this.showAllNodes(e.crossesInArea), this.viewClickWatcher || (this.viewClickWatcher = this.view.on("click", (
|
|
16
|
-
this.handleViewClick(
|
|
15
|
+
this.addCrossCallback = e.addCrossCallback, this.removeCrossCallback = e.removeCrossCallback, e.removeAllCrossCallback && (this.removeAllCrossCallback = e.removeAllCrossCallback), this.selectedNodeIds = [], this.openDriveServer = e.odrServer, this.showAllNodes(e.crossesInArea), this.viewClickWatcher || (this.viewClickWatcher = this.view.on("click", (l) => {
|
|
16
|
+
this.handleViewClick(l);
|
|
17
17
|
}));
|
|
18
18
|
}
|
|
19
19
|
stopAddGreenWaveBand() {
|
|
20
20
|
var e;
|
|
21
|
-
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0;
|
|
21
|
+
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0, this.allNodesLayer.removeAll(), this.selectedNodeIds = [];
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* 显示所有路口,进去待选状态
|
|
25
|
+
* @param nodeAttributes
|
|
26
|
+
*/
|
|
23
27
|
showAllNodes(e) {
|
|
24
|
-
const
|
|
25
|
-
e.forEach((
|
|
26
|
-
|
|
27
|
-
new
|
|
28
|
+
const l = [];
|
|
29
|
+
e.forEach((o) => {
|
|
30
|
+
l.push(
|
|
31
|
+
new d({
|
|
28
32
|
geometry: {
|
|
29
33
|
type: "point",
|
|
30
|
-
x:
|
|
31
|
-
y:
|
|
34
|
+
x: o.longitude,
|
|
35
|
+
y: o.latitude
|
|
32
36
|
},
|
|
33
37
|
symbol: this.getSymbol(!1),
|
|
34
|
-
attributes: { ...
|
|
38
|
+
attributes: { ...o, selected: !1 }
|
|
35
39
|
})
|
|
36
40
|
);
|
|
37
|
-
}), this.
|
|
41
|
+
}), this.allNodesLayer.addMany(l);
|
|
38
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* 点击待选/已选路口
|
|
45
|
+
* @param event
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
39
48
|
async handleViewClick(e) {
|
|
40
49
|
var a;
|
|
41
|
-
const
|
|
42
|
-
include: [this.
|
|
50
|
+
const o = (a = (await this.view.hitTest(e, {
|
|
51
|
+
include: [this.allNodesLayer]
|
|
43
52
|
})).results) == null ? void 0 : a.filter(
|
|
44
|
-
(
|
|
53
|
+
(i) => i.type === "graphic"
|
|
45
54
|
);
|
|
46
|
-
if (
|
|
55
|
+
if (o.length === 0)
|
|
47
56
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
const r = o[0].graphic, s = r.getAttribute("id");
|
|
58
|
+
if (!this.selectedNodeIds.includes(s))
|
|
59
|
+
r.setAttribute("selected", !0), this.addCrossCallback && this.addCrossCallback({
|
|
60
|
+
id: s,
|
|
61
|
+
name: r.getAttribute("name")
|
|
62
|
+
}), r.symbol = this.getSymbol(!0), this.selectedNodeIds.push(s), this.allNodesLayer.graphics.forEach((i) => {
|
|
63
|
+
this.selectedNodeIds.length === 0 ? i !== r && (i.visible = !1) : i.getAttribute("selected") === !1 && (i.visible = !1);
|
|
64
|
+
}), await this.showDownstreamNodes(s);
|
|
65
|
+
else {
|
|
66
|
+
const i = this.selectedNodeIds.indexOf(s) + 1;
|
|
67
|
+
if (i === 1)
|
|
68
|
+
this.removeAllCrossCallback && this.removeAllCrossCallback(), this.selectedNodeIds = [], this.allNodesLayer.graphics.forEach((t) => {
|
|
69
|
+
t.setAttribute("selected", !1), t.symbol = this.getSymbol(!1), t.visible = !0;
|
|
70
|
+
});
|
|
71
|
+
else {
|
|
72
|
+
for (let t = i; t < this.selectedNodeIds.length; t++)
|
|
73
|
+
this.removeCrossCallback && this.removeCrossCallback({
|
|
74
|
+
id: this.selectedNodeIds[t]
|
|
75
|
+
});
|
|
76
|
+
this.selectedNodeIds = this.selectedNodeIds.slice(0, i), this.allNodesLayer.graphics.forEach((t) => {
|
|
77
|
+
this.selectedNodeIds.includes(t.getAttribute("id")) ? (t.setAttribute("selected", !0), t.symbol = this.getSymbol(!0)) : (t.setAttribute("selected", !1), t.symbol = this.getSymbol(!1), t.visible = !1);
|
|
78
|
+
}), await this.showDownstreamNodes(s);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
console.log(this.selectedNodeIds);
|
|
52
82
|
}
|
|
53
83
|
/**
|
|
54
84
|
* 显示下游节点
|
|
55
85
|
* @param nodeId
|
|
56
86
|
*/
|
|
57
87
|
async showDownstreamNodes(e) {
|
|
58
|
-
|
|
88
|
+
this.view.container.style.cursor = "progress";
|
|
89
|
+
const l = await n.get(
|
|
59
90
|
`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,
|
|
60
91
|
{ params: { nodeId: e } }
|
|
61
92
|
);
|
|
62
|
-
if (
|
|
93
|
+
if (l.status !== 200 || l.data.status !== 0) {
|
|
94
|
+
this.view.container.style.cursor = "default";
|
|
63
95
|
return;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
}
|
|
97
|
+
l.data.result.forEach((r) => {
|
|
98
|
+
this.allNodesLayer.graphics.forEach((s) => {
|
|
99
|
+
s.getAttribute("nodeId") === r.id && s.getAttribute("selected") === !1 && (s.visible = !0);
|
|
67
100
|
});
|
|
68
|
-
});
|
|
101
|
+
}), this.view.container.style.cursor = "default";
|
|
69
102
|
}
|
|
70
103
|
getSymbol(e) {
|
|
71
104
|
return {
|
|
@@ -157,5 +190,5 @@ class p {
|
|
|
157
190
|
}
|
|
158
191
|
}
|
|
159
192
|
export {
|
|
160
|
-
|
|
193
|
+
u as default
|
|
161
194
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -142,6 +142,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
142
142
|
message: string;
|
|
143
143
|
};
|
|
144
144
|
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
145
|
+
stopAddGreenWaveBand: () => {
|
|
146
|
+
status: number;
|
|
147
|
+
message: string;
|
|
148
|
+
} | undefined;
|
|
145
149
|
props: any;
|
|
146
150
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
147
151
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),h=require("./stores/index.js");require("./style/index.css");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),h=require("./stores/index.js");require("./style/index.css");const He=require("./utils/green-wave-band-controller/index.js"),Pe=require("./utils/holo-flow/index.js"),ze=require("./utils/holo-flow/signal-countdown-panel.vue.js"),je=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),A=require("./utils/overlay.js"),We=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),D=require("./utils/signal-control-area-controller/index.js"),Ge=require("./utils/traffic-flow.js"),Qe={class:"gis-viewer"},Ze={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},Ke=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:_,emit:B}){const f=a.ref(null);let i,u,l,o,r,s,m,t,n,p;const S=a.ref(!1);h.registerStore();const x=h.default.useAppDataStore,b=a.reactive([]);a.onMounted(async()=>{if(!f.value)return;document.addEventListener("keydown",g=>{g.ctrlKey&&g.key==="i"&&(S.value=!S.value)});const e=a.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(k.config)).json();c.assetsRoot=k.assetsRoot||d,x.mapConfig=c,u=new je.default,i=await u.initialize({container:f.value,mapConfig:c,markerClickCallback:(g,w,C,Ee)=>{y("markerClick",g,w,C,Ee)},mapClickCallback:(g,w,C)=>{y("mapClick",g,w,C)}}),r=new Pe.default(i,b),await r.init(),y("mapLoaded")}),a.onUnmounted(()=>{n==null||n.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const I=a.computed(()=>i),q=()=>{const e=h.default.useAppDataStore;e.saveTrackLog=!0},V=()=>{r.downloadTrackLog()},M=()=>{v("vehicleId")},N=()=>{v("plateNumber")},E=async e=>await u.setMapCenter(e),H=async e=>await u.setMapCamera(e),P=async e=>await u.lookAt(e),z=e=>u.setLayerVisibility(e),j=(e,d)=>u.requestCoordinateTransform(e,d),W=e=>{u.cancelCoordinateTransform(e)},G=e=>{u.setMapZoomRange(e)},Q=e=>(l||(l=new L.default(i)),l.showLaneNumber(e)),Z=()=>{l==null||l.clearLaneNumber()},K=async e=>(l||(l=new L.default(i)),await l.initializeSearch(e)),U=async()=>l==null?void 0:l.calCrossIndicatorArea(),J=async()=>{},X=async(e,d)=>{o||(o=new Ge.default(i)),o.connectTrafficFlow(e,d)},Y=()=>{o==null||o.disconnectTrafficFlow()},F=async e=>{r.handleVehicleTraceData(e)},R=()=>{r.clearHoloTrace()},$=e=>{r.setInterpolate(e)},ee=async e=>{await r.handleSignalData(e)},te=()=>{r.clearHoloSignal()},ne=e=>{o==null||o.toggleTrafficInfo(e),r==null||r.toggleTrafficInfo(e)},ae=e=>{r==null||r.togglePause(e)},re=e=>{o==null||o.toggleTrafficObject(e),r==null||r.toggleTrafficObject(e)},v=e=>{r==null||r.updatePanelContent(e)},se=async e=>(s||(s=new A.default(i)),s.addOverlays(e)),oe=e=>(s||(s=new A.default(i)),s.addMask(e)),ie=()=>{s==null||s.removeMask()},ce=e=>s==null?void 0:s.removeOverlaysByType(e),le=e=>s==null?void 0:s.removeOverlaysById(e),ue=()=>s==null?void 0:s.removeAllOverlays(),de=()=>{s==null||s.showAllOverlays()},ge=e=>{m||(m=new We.default(i)),m.updateQueueLength(e)},me=()=>{m==null||m.removeQueueLength()},pe=async(e,d)=>(t||(t=new O.default(i)),await t.showOpenDriveFromServer(e,d)),fe=async e=>(t||(t=new O.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),Se=async()=>await(t==null?void 0:t.clearOpenDrive()),ve=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Ce=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},be=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},ke=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Oe=e=>(n||(n=new D.default(i)),n.showSignalControlArea(e)),Ae=()=>{n==null||n.clearSignalControlArea()},Le=async e=>n?await n.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},De=async e=>n?await n.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Te=()=>n?n.resetHighlight():{status:-1,message:"未加载信号控制区"},_e=e=>(n||(n=new D.default(i)),n.showSubSignalControlArea(e)),Be=e=>n?n.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},xe=()=>n?n.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ie=e=>n?n.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},qe=e=>n?n.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ve=e=>n?n.changeSubSignalControlAreaBorderVisibility(e):{status:-1,message:"未加载信号控制区"},Me=e=>(p||(p=new He.default(i)),p.addGreenWaveBand(e)),Ne=()=>{if(!p)return{status:-1,message:"未加载绿波带"};p.stopAddGreenWaveBand()},k=T,y=B;return _({mapViewer:I,setLayerVisibility:z,setMapCenter:E,lookAt:P,setMapCamera:H,setMapZoomRange:G,requestCoordinateTransform:j,cancelCoordinateTransform:W,addOverlays:se,addMask:oe,removeMask:ie,showAllOverlays:de,removeOverlaysByType:ce,removeOverlaysById:le,removeAllOverlays:ue,showLaneNumber:Q,clearLaneNumber:Z,initializeAreaTool:K,calCrossIndicatorArea:U,calRoadIndicatorArea:J,connectCarFlow:X,disconnectCarFlow:Y,handleHoloVehicleTraceData:F,clearHoloTrace:R,handleHoloSignalData:ee,clearHoloSignal:te,setInterpolate:$,toggleTrafficInfo:ne,toggleTrafficObject:re,toggleVehicleInfo:v,togglePause:ae,updateQueueLength:ge,removeQueueLength:me,showOpenDriveFromServer:pe,showOpenDriveFromFile:fe,clearOpenDrive:Se,geometrySearchInOpenDrive:Ce,findSumoInOpenDrive:ve,selectSumoInOpenDrive:ye,unselectSumoInOpenDrive:we,getSumoInfo:he,splitOpenDriveLane:be,clearSplitOpenDriveLane:ke,showSignalControlArea:Oe,clearSignalControlArea:Ae,locateSignalControlArea:Le,highlightSignalControlArea:De,resetHighlightSignalControlArea:Te,showSubSignalControlArea:_e,editSubSignalControlArea:Be,stopEditSubSignalControlArea:xe,selectSubSignalControlAreaCross:Ie,unselectSubSignalControlAreaCross:qe,changeSubSignalControlAreaBorderVisibility:Ve,addGreenWaveBand:Me,stopAddGreenWaveBand:Ne}),(e,d)=>(a.openBlock(),a.createElementBlock("div",Qe,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:f},[a.withDirectives(a.createElementVNode("div",Ze,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 开始记录 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:V}," 下载日志 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 显示车辆id "),a.createElementVNode("button",{onClick:N},"显示车辆号牌")],512),[[a.vShow,S.value]])],512),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b,(c,g)=>(a.openBlock(),a.createBlock(ze.default,{key:g,"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=Ke;
|
|
@@ -130,6 +130,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
130
130
|
message: string;
|
|
131
131
|
};
|
|
132
132
|
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
133
|
+
stopAddGreenWaveBand: () => {
|
|
134
|
+
status: number;
|
|
135
|
+
message: string;
|
|
136
|
+
} | undefined;
|
|
133
137
|
props: any;
|
|
134
138
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
135
139
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
2
|
export default class GreenWaveBandController {
|
|
3
3
|
private view;
|
|
4
|
-
private
|
|
4
|
+
private allNodesLayer;
|
|
5
5
|
private viewClickWatcher?;
|
|
6
6
|
private openDriveServer;
|
|
7
7
|
private selectedNodeIds;
|
|
8
|
+
private addCrossCallback;
|
|
9
|
+
private removeCrossCallback;
|
|
10
|
+
private removeAllCrossCallback;
|
|
8
11
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
9
12
|
/**
|
|
10
13
|
* 新增绿波带
|
|
11
|
-
* @param
|
|
14
|
+
* @param params
|
|
12
15
|
*/
|
|
13
|
-
addGreenWaveBand(
|
|
16
|
+
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
14
17
|
stopAddGreenWaveBand(): void;
|
|
18
|
+
/**
|
|
19
|
+
* 显示所有路口,进去待选状态
|
|
20
|
+
* @param nodeAttributes
|
|
21
|
+
*/
|
|
15
22
|
private showAllNodes;
|
|
23
|
+
/**
|
|
24
|
+
* 点击待选/已选路口
|
|
25
|
+
* @param event
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
16
28
|
private handleViewClick;
|
|
17
29
|
/**
|
|
18
30
|
* 显示下游节点
|
|
@@ -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 d=require("@arcgis/core/Graphic"),c=require("@arcgis/core/layers/GraphicsLayer"),n=require("axios");class h{constructor(e){this.selectedNodeIds=[],this.view=e,this.allNodesLayer=new c({id:"allNodesLayer"}),this.view.map.add(this.allNodesLayer)}addGreenWaveBand(e){this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,e.removeAllCrossCallback&&(this.removeAllCrossCallback=e.removeAllCrossCallback),this.selectedNodeIds=[],this.openDriveServer=e.odrServer,this.showAllNodes(e.crossesInArea),this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",l=>{this.handleViewClick(l)}))}stopAddGreenWaveBand(){var e;(e=this.viewClickWatcher)==null||e.remove(),this.viewClickWatcher=void 0,this.allNodesLayer.removeAll(),this.selectedNodeIds=[]}showAllNodes(e){const l=[];e.forEach(o=>{l.push(new d({geometry:{type:"point",x:o.longitude,y:o.latitude},symbol:this.getSymbol(!1),attributes:{...o,selected:!1}}))}),this.allNodesLayer.addMany(l)}async handleViewClick(e){var a;const o=(a=(await this.view.hitTest(e,{include:[this.allNodesLayer]})).results)==null?void 0:a.filter(i=>i.type==="graphic");if(o.length===0)return;const r=o[0].graphic,s=r.getAttribute("id");if(!this.selectedNodeIds.includes(s))r.setAttribute("selected",!0),this.addCrossCallback&&this.addCrossCallback({id:s,name:r.getAttribute("name")}),r.symbol=this.getSymbol(!0),this.selectedNodeIds.push(s),this.allNodesLayer.graphics.forEach(i=>{this.selectedNodeIds.length===0?i!==r&&(i.visible=!1):i.getAttribute("selected")===!1&&(i.visible=!1)}),await this.showDownstreamNodes(s);else{const i=this.selectedNodeIds.indexOf(s)+1;if(i===1)this.removeAllCrossCallback&&this.removeAllCrossCallback(),this.selectedNodeIds=[],this.allNodesLayer.graphics.forEach(t=>{t.setAttribute("selected",!1),t.symbol=this.getSymbol(!1),t.visible=!0});else{for(let t=i;t<this.selectedNodeIds.length;t++)this.removeCrossCallback&&this.removeCrossCallback({id:this.selectedNodeIds[t]});this.selectedNodeIds=this.selectedNodeIds.slice(0,i),this.allNodesLayer.graphics.forEach(t=>{this.selectedNodeIds.includes(t.getAttribute("id"))?(t.setAttribute("selected",!0),t.symbol=this.getSymbol(!0)):(t.setAttribute("selected",!1),t.symbol=this.getSymbol(!1),t.visible=!1)}),await this.showDownstreamNodes(s)}}console.log(this.selectedNodeIds)}async showDownstreamNodes(e){this.view.container.style.cursor="progress";const l=await n.get(`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,{params:{nodeId:e}});if(l.status!==200||l.data.status!==0){this.view.container.style.cursor="default";return}l.data.result.forEach(r=>{this.allNodesLayer.graphics.forEach(s=>{s.getAttribute("nodeId")===r.id&&s.getAttribute("selected")===!1&&(s.visible=!0)})}),this.view.container.style.cursor="default"}getSymbol(e){return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:30,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:2,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:25,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}}}exports.default=h;
|
package/lib/src/types/index.d.ts
CHANGED