gisviewer-vue3-arcgis 1.0.197 → 1.0.198
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 +1 -1
- package/es/src/gis-map/gis-map.vue.mjs +33 -32
- package/es/src/gis-map/index.d.ts +1 -1
- package/es/src/gis-map/utils/detect-gpu.d.ts +2 -0
- package/es/src/gis-map/utils/detect-gpu.mjs +44 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +2 -1
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +5 -5
- package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.d.ts +0 -4
- package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +18 -60
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +2 -2
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +1 -0
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +58 -35
- package/lib/src/gis-map/gis-map.vue.d.ts +1 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +1 -1
- package/lib/src/gis-map/utils/detect-gpu.d.ts +2 -0
- package/lib/src/gis-map/utils/detect-gpu.js +1 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +2 -1
- package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.d.ts +0 -4
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.d.ts +1 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/package.json +1 -1
|
@@ -146,7 +146,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
146
146
|
status: number;
|
|
147
147
|
message: string;
|
|
148
148
|
} | undefined;
|
|
149
|
-
showGreenWaveBand: (params: IShowGreenWaveBandParams) => void
|
|
149
|
+
showGreenWaveBand: (params: IShowGreenWaveBandParams) => Promise<void>;
|
|
150
150
|
props: any;
|
|
151
151
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
152
152
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { defineComponent as je, ref as b, reactive as Ze, onMounted as $e, getCurrentInstance as qe, onUnmounted as Ke, computed as Ue, openBlock as h, createElementBlock as k, createElementVNode as d, withDirectives as Je, vShow as Re, Fragment as Xe, renderList as Ye, createBlock as Fe } from "vue";
|
|
2
2
|
import D, { registerStore as et } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
+
import tt from "./utils/detect-gpu.mjs";
|
|
4
5
|
import L from "./utils/green-wave-band-controller/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import nt from "./utils/holo-flow/index.mjs";
|
|
7
|
+
import at from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
8
|
+
import rt from "./utils/map-initializer.mjs";
|
|
8
9
|
import T from "./utils/open-drive-renderer/index.mjs";
|
|
9
10
|
import B from "./utils/overlay.mjs";
|
|
10
|
-
import
|
|
11
|
+
import st from "./utils/queue-length.mjs";
|
|
11
12
|
import I from "./utils/road-config-tool/index.mjs";
|
|
12
13
|
import M from "./utils/signal-control-area-controller/index.mjs";
|
|
13
|
-
import
|
|
14
|
-
const
|
|
14
|
+
import ot from "./utils/traffic-flow.mjs";
|
|
15
|
+
const it = { class: "gis-viewer" }, ct = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, At = /* @__PURE__ */ je({
|
|
15
16
|
__name: "gis-map",
|
|
16
17
|
props: {
|
|
17
18
|
config: {},
|
|
@@ -24,30 +25,30 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
24
25
|
const f = b(!1);
|
|
25
26
|
et();
|
|
26
27
|
const V = D.useAppDataStore, O = Ze([]);
|
|
27
|
-
$e(async () => {
|
|
28
|
+
tt(), $e(async () => {
|
|
28
29
|
if (!S.value)
|
|
29
30
|
return;
|
|
30
31
|
document.addEventListener("keydown", (g) => {
|
|
31
32
|
g.ctrlKey && g.key === "i" && (f.value = !f.value);
|
|
32
33
|
});
|
|
33
34
|
const e = qe(), { $gisviewerAssetsRoot: m } = e.appContext.config.globalProperties, i = await (await fetch(A.config)).json();
|
|
34
|
-
i.assetsRoot = A.assetsRoot || m, V.mapConfig = i, l = new
|
|
35
|
+
i.assetsRoot = A.assetsRoot || m, V.mapConfig = i, l = new rt(), s = await l.initialize({
|
|
35
36
|
container: S.value,
|
|
36
37
|
mapConfig: i,
|
|
37
|
-
markerClickCallback: (g,
|
|
38
|
-
|
|
38
|
+
markerClickCallback: (g, C, y, Qe) => {
|
|
39
|
+
w("markerClick", g, C, y, Qe);
|
|
39
40
|
},
|
|
40
|
-
mapClickCallback: (g,
|
|
41
|
-
|
|
41
|
+
mapClickCallback: (g, C, y) => {
|
|
42
|
+
w("mapClick", g, C, y);
|
|
42
43
|
}
|
|
43
|
-
}), a = new
|
|
44
|
+
}), a = new nt(s, O), await a.init(), w("mapLoaded");
|
|
44
45
|
}), Ke(() => {
|
|
45
46
|
n == null || n.clearSignalControlArea(), t == null || t.clearOpenDrive(), a.clearHoloTrace(), a.clearHoloSignal(), o == null || o.disconnectTrafficFlow();
|
|
46
47
|
});
|
|
47
|
-
const
|
|
48
|
+
const G = Ue(() => s), P = () => {
|
|
48
49
|
const e = D.useAppDataStore;
|
|
49
50
|
e.saveTrackLog = !0;
|
|
50
|
-
},
|
|
51
|
+
}, W = () => {
|
|
51
52
|
a.downloadTrackLog();
|
|
52
53
|
}, N = () => {
|
|
53
54
|
v("vehicleId");
|
|
@@ -61,7 +62,7 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
61
62
|
c == null || c.clearLaneNumber();
|
|
62
63
|
}, R = async (e) => (c || (c = new I(s)), await c.initializeSearch(e)), X = async () => c == null ? void 0 : c.calCrossIndicatorArea(), Y = async () => {
|
|
63
64
|
}, F = async (e, m) => {
|
|
64
|
-
o || (o = new
|
|
65
|
+
o || (o = new ot(s)), o.connectTrafficFlow(e, m);
|
|
65
66
|
}, ee = () => {
|
|
66
67
|
o == null || o.disconnectTrafficFlow();
|
|
67
68
|
}, te = async (e) => {
|
|
@@ -87,10 +88,10 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
87
88
|
}, ge = (e) => r == null ? void 0 : r.removeOverlaysByType(e), pe = (e) => r == null ? void 0 : r.removeOverlaysById(e), de = () => r == null ? void 0 : r.removeAllOverlays(), Se = () => {
|
|
88
89
|
r == null || r.showAllOverlays();
|
|
89
90
|
}, fe = (e) => {
|
|
90
|
-
p || (p = new
|
|
91
|
+
p || (p = new st(s)), p.updateQueueLength(e);
|
|
91
92
|
}, ve = () => {
|
|
92
93
|
p == null || p.removeQueueLength();
|
|
93
|
-
},
|
|
94
|
+
}, we = async (e, m) => (t || (t = new T(s)), await t.showOpenDriveFromServer(e, m)), Ce = async (e) => (t || (t = new T(s)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ye = async () => await (t == null ? void 0 : t.clearOpenDrive()), he = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
94
95
|
status: -1,
|
|
95
96
|
message: "未加载OpenDrive地图"
|
|
96
97
|
}, Oe = async (e) => t ? t.selectSumo(e) : {
|
|
@@ -113,15 +114,15 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
113
114
|
message: "未加载OpenDrive地图"
|
|
114
115
|
}, Te = (e) => (n || (n = new M(s)), n.showSignalControlArea(e)), Be = () => {
|
|
115
116
|
n == null || n.clearSignalControlArea();
|
|
116
|
-
}, Ie = async (e) => n ? await n.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = async (e) => n ? await n.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, _e = () => n ? n.resetHighlight() : { status: -1, message: "未加载信号控制区" }, xe = (e) => (n || (n = new M(s)), n.showSubSignalControlArea(e)), He = (e) => n ? n.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ve = () => n ? n.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" },
|
|
117
|
+
}, Ie = async (e) => n ? await n.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = async (e) => n ? await n.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, _e = () => n ? n.resetHighlight() : { status: -1, message: "未加载信号控制区" }, xe = (e) => (n || (n = new M(s)), n.showSubSignalControlArea(e)), He = (e) => n ? n.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ve = () => n ? n.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Ge = (e) => n ? n.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => n ? n.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, We = (e) => n ? n.changeSubSignalControlAreaBorderVisibility(
|
|
117
118
|
e
|
|
118
119
|
) : { status: -1, message: "未加载信号控制区" }, Ne = (e) => (u || (u = new L(s)), u.addGreenWaveBand(e)), ze = () => {
|
|
119
120
|
if (!u)
|
|
120
121
|
return { status: -1, message: "未加载绿波带" };
|
|
121
122
|
u.stopAddGreenWaveBand();
|
|
122
|
-
}, Ee = (e) => (u || (u = new L(s)), u.showGreenWaveBand(e)), A = _,
|
|
123
|
+
}, Ee = async (e) => (u || (u = new L(s)), await u.showGreenWaveBand(e)), A = _, w = H;
|
|
123
124
|
return x({
|
|
124
|
-
mapViewer:
|
|
125
|
+
mapViewer: G,
|
|
125
126
|
setLayerVisibility: Z,
|
|
126
127
|
setMapCenter: E,
|
|
127
128
|
lookAt: j,
|
|
@@ -154,8 +155,8 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
154
155
|
togglePause: ie,
|
|
155
156
|
updateQueueLength: fe,
|
|
156
157
|
removeQueueLength: ve,
|
|
157
|
-
showOpenDriveFromServer:
|
|
158
|
-
showOpenDriveFromFile:
|
|
158
|
+
showOpenDriveFromServer: we,
|
|
159
|
+
showOpenDriveFromFile: Ce,
|
|
159
160
|
clearOpenDrive: ye,
|
|
160
161
|
geometrySearchInOpenDrive: be,
|
|
161
162
|
findSumoInOpenDrive: he,
|
|
@@ -172,26 +173,26 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
172
173
|
showSubSignalControlArea: xe,
|
|
173
174
|
editSubSignalControlArea: He,
|
|
174
175
|
stopEditSubSignalControlArea: Ve,
|
|
175
|
-
selectSubSignalControlAreaCross:
|
|
176
|
-
unselectSubSignalControlAreaCross:
|
|
177
|
-
changeSubSignalControlAreaBorderVisibility:
|
|
176
|
+
selectSubSignalControlAreaCross: Ge,
|
|
177
|
+
unselectSubSignalControlAreaCross: Pe,
|
|
178
|
+
changeSubSignalControlAreaBorderVisibility: We,
|
|
178
179
|
addGreenWaveBand: Ne,
|
|
179
180
|
stopAddGreenWaveBand: ze,
|
|
180
181
|
showGreenWaveBand: Ee
|
|
181
|
-
}), (e, m) => (h(), k("div",
|
|
182
|
+
}), (e, m) => (h(), k("div", it, [
|
|
182
183
|
d("div", {
|
|
183
184
|
class: "gis-viewer-main",
|
|
184
185
|
ref_key: "mapContainer",
|
|
185
186
|
ref: S
|
|
186
187
|
}, [
|
|
187
|
-
Je(d("div",
|
|
188
|
+
Je(d("div", ct, [
|
|
188
189
|
d("button", {
|
|
189
190
|
style: { "margin-right": "10px" },
|
|
190
|
-
onClick:
|
|
191
|
+
onClick: P
|
|
191
192
|
}, " 开始记录 "),
|
|
192
193
|
d("button", {
|
|
193
194
|
style: { "margin-right": "10px" },
|
|
194
|
-
onClick:
|
|
195
|
+
onClick: W
|
|
195
196
|
}, " 下载日志 "),
|
|
196
197
|
d("button", {
|
|
197
198
|
style: { "margin-right": "10px" },
|
|
@@ -202,7 +203,7 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
202
203
|
[Re, f.value]
|
|
203
204
|
])
|
|
204
205
|
], 512),
|
|
205
|
-
(h(!0), k(Xe, null, Ye(O, (i, g) => (h(), Fe(
|
|
206
|
+
(h(!0), k(Xe, null, Ye(O, (i, g) => (h(), Fe(at, {
|
|
206
207
|
key: g,
|
|
207
208
|
"display-mode": i.displayMode,
|
|
208
209
|
"road-id": i.crossId,
|
|
@@ -218,5 +219,5 @@ const ot = { class: "gis-viewer" }, it = { style: { position: "absolute", bottom
|
|
|
218
219
|
}
|
|
219
220
|
});
|
|
220
221
|
export {
|
|
221
|
-
|
|
222
|
+
At as default
|
|
222
223
|
};
|
|
@@ -134,7 +134,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
134
134
|
status: number;
|
|
135
135
|
message: string;
|
|
136
136
|
} | undefined;
|
|
137
|
-
showGreenWaveBand: (params: import("../types").IShowGreenWaveBandParams) => void
|
|
137
|
+
showGreenWaveBand: (params: import("../types").IShowGreenWaveBandParams) => Promise<void>;
|
|
138
138
|
props: any;
|
|
139
139
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
140
140
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const s = (e) => {
|
|
2
|
+
const r = [], o = e.split("");
|
|
3
|
+
for (let t = 0; t < o.length; t++)
|
|
4
|
+
if (o[t] === "(")
|
|
5
|
+
r.push(t);
|
|
6
|
+
else if (o[t] === ")") {
|
|
7
|
+
const n = r.pop();
|
|
8
|
+
n !== void 0 && (o.splice(n, t - n + 1), t = n - 1);
|
|
9
|
+
}
|
|
10
|
+
return o.join("");
|
|
11
|
+
}, i = (e) => s(e).replace(/\/PCIe\/SSE2/g, "").replace(/\s+/g, " ").trim(), c = () => {
|
|
12
|
+
try {
|
|
13
|
+
const e = document.createElement("canvas"), r = e.getContext("webgl") || e.getContext("experimental-webgl");
|
|
14
|
+
if (!r)
|
|
15
|
+
return "Unknown";
|
|
16
|
+
const o = r.getExtension("WEBGL_debug_renderer_info");
|
|
17
|
+
return o && r.getParameter(o.UNMASKED_RENDERER_WEBGL) || "Unknown";
|
|
18
|
+
} catch {
|
|
19
|
+
return "Unknown";
|
|
20
|
+
}
|
|
21
|
+
}, l = () => {
|
|
22
|
+
const e = c();
|
|
23
|
+
try {
|
|
24
|
+
if (/, or similar$/.test(e) || /SwiftShader/.test(e))
|
|
25
|
+
return "Unknown";
|
|
26
|
+
if (/^ANGLE/.test(e)) {
|
|
27
|
+
const r = e.match(/\((.+)\)$/);
|
|
28
|
+
if (r) {
|
|
29
|
+
const o = r[1], t = o.split(/,\s*/g);
|
|
30
|
+
let n = t[1];
|
|
31
|
+
return /^ANGLE Metal Renderer: /.test(n) && (n = e.split(": ")[1].split(",")[0]), t.length === 1 && (n = t[0].split(" ").slice(1).join(" ")), /Direct3D/.test(n) && (n = n.split("Direct3D")[0].trim()), n;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
return "Unknown";
|
|
36
|
+
}
|
|
37
|
+
return i(e);
|
|
38
|
+
}, u = () => {
|
|
39
|
+
const e = l();
|
|
40
|
+
return console.log("GPU:", e), localStorage.setItem("gpu", e), e;
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
u as default
|
|
44
|
+
};
|
|
@@ -12,6 +12,7 @@ export default class GreenWaveBandController {
|
|
|
12
12
|
private selectedNodeIds;
|
|
13
13
|
private scaleWatcher?;
|
|
14
14
|
private readonly nodeScale;
|
|
15
|
+
private hasGpu;
|
|
15
16
|
private addNodeCallback;
|
|
16
17
|
private removeNodeCallback;
|
|
17
18
|
private removeAllNodeCallback;
|
|
@@ -22,7 +23,7 @@ export default class GreenWaveBandController {
|
|
|
22
23
|
*/
|
|
23
24
|
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
24
25
|
stopAddGreenWaveBand(): void;
|
|
25
|
-
showGreenWaveBand(params: IShowGreenWaveBandParams): void
|
|
26
|
+
showGreenWaveBand(params: IShowGreenWaveBandParams): Promise<void>;
|
|
26
27
|
/**
|
|
27
28
|
* 显示所有路口,进入待选状态
|
|
28
29
|
* @param nodeAttributes
|
|
@@ -3,9 +3,9 @@ import { Polyline as m } from "@arcgis/core/geometry";
|
|
|
3
3
|
import c from "@arcgis/core/Graphic";
|
|
4
4
|
import n from "@arcgis/core/layers/GraphicsLayer";
|
|
5
5
|
import b from "axios";
|
|
6
|
-
class
|
|
6
|
+
class w {
|
|
7
7
|
constructor(e) {
|
|
8
|
-
this.selectedNodeIds = [], this.nodeScale = 5e3, this.view = e, this.roadsectLayer = new n({
|
|
8
|
+
this.selectedNodeIds = [], this.nodeScale = 5e3, this.hasGpu = !1, this.hasGpu = localStorage.getItem("gpu") !== "Unknown", this.view = e, this.roadsectLayer = new n({
|
|
9
9
|
id: "roadsectLayer"
|
|
10
10
|
}), this.view.map.add(this.roadsectLayer), this.allNodesLayer = new n({
|
|
11
11
|
id: "allNodesLayer"
|
|
@@ -26,7 +26,7 @@ class N {
|
|
|
26
26
|
var e;
|
|
27
27
|
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0, this.allNodesLayer.removeAll(), this.selectedNodeIds = [], this.roadsectLayer.removeAll(), this.bandLayer.removeAll();
|
|
28
28
|
}
|
|
29
|
-
showGreenWaveBand(e) {
|
|
29
|
+
async showGreenWaveBand(e) {
|
|
30
30
|
this.scaleWatcher || (this.scaleWatcher = y.watch(
|
|
31
31
|
() => this.view.scale,
|
|
32
32
|
(s, i) => {
|
|
@@ -44,7 +44,7 @@ class N {
|
|
|
44
44
|
symbol: this.getLineSymbol(!0),
|
|
45
45
|
attributes: { bandId: e.bandId }
|
|
46
46
|
});
|
|
47
|
-
this.roadsectLayer.add(a), this.view.goTo(a), e.nodeList.forEach((s) => {
|
|
47
|
+
this.roadsectLayer.add(a), await this.view.goTo(a), e.nodeList.forEach((s) => {
|
|
48
48
|
const i = new c({
|
|
49
49
|
geometry: {
|
|
50
50
|
type: "point",
|
|
@@ -338,5 +338,5 @@ class N {
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
export {
|
|
341
|
-
|
|
341
|
+
w as default
|
|
342
342
|
};
|
|
@@ -8,10 +8,6 @@ export default class TraceRendererLayer implements ITraceRendererInterface {
|
|
|
8
8
|
private appDataStore;
|
|
9
9
|
private logTable;
|
|
10
10
|
constructor(view: __esri.MapView);
|
|
11
|
-
private getRendererText;
|
|
12
|
-
private em;
|
|
13
|
-
private el;
|
|
14
|
-
private getGpuText;
|
|
15
11
|
getLog(): (string | number)[][];
|
|
16
12
|
init(): Promise<void>;
|
|
17
13
|
private needInterpolate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import p from "@arcgis/core/Graphic";
|
|
2
|
-
import
|
|
3
|
-
import { toRaw as
|
|
4
|
-
import
|
|
2
|
+
import m from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import { toRaw as g } from "vue";
|
|
4
|
+
import y from "../../stores/index.mjs";
|
|
5
5
|
class v {
|
|
6
6
|
constructor(i) {
|
|
7
|
-
this.hasGpu = !1, this.appDataStore =
|
|
7
|
+
this.hasGpu = !1, this.appDataStore = y.useAppDataStore, this.logTable = [
|
|
8
8
|
[
|
|
9
9
|
"uuid",
|
|
10
10
|
"ptcId",
|
|
@@ -30,53 +30,11 @@ class v {
|
|
|
30
30
|
"step",
|
|
31
31
|
"receiveTimestamp"
|
|
32
32
|
]
|
|
33
|
-
], this.needInterpolate = !0, this.isPaused = !1, this.showVehiclePlate = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.view = i, this.mapConfig =
|
|
33
|
+
], this.needInterpolate = !0, this.isPaused = !1, this.showVehiclePlate = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.view = i, this.mapConfig = g(this.appDataStore.mapConfig), this.vehicleLayer = new m({
|
|
34
34
|
id: "vehicleLayer"
|
|
35
35
|
}), this.view.map.add(this.vehicleLayer);
|
|
36
|
-
const t =
|
|
37
|
-
this.hasGpu =
|
|
38
|
-
}
|
|
39
|
-
getRendererText() {
|
|
40
|
-
try {
|
|
41
|
-
const i = document.createElement("canvas"), t = i.getContext("webgl") || i.getContext("experimental-webgl");
|
|
42
|
-
if (!t)
|
|
43
|
-
return "Unknown";
|
|
44
|
-
const e = t.getExtension("WEBGL_debug_renderer_info");
|
|
45
|
-
return e && t.getParameter(e.UNMASKED_RENDERER_WEBGL) || "Unknown";
|
|
46
|
-
} catch {
|
|
47
|
-
return "Unknown";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
em(i) {
|
|
51
|
-
const t = [], e = i.split("");
|
|
52
|
-
for (let s = 0; s < e.length; s++)
|
|
53
|
-
if (e[s] === "(")
|
|
54
|
-
t.push(s);
|
|
55
|
-
else if (e[s] === ")") {
|
|
56
|
-
const r = t.pop();
|
|
57
|
-
r !== void 0 && (e.splice(r, s - r + 1), s = r - 1);
|
|
58
|
-
}
|
|
59
|
-
return e.join("");
|
|
60
|
-
}
|
|
61
|
-
el(i) {
|
|
62
|
-
return this.em(i).replace(/\/PCIe\/SSE2/g, "").replace(/\s+/g, " ").trim();
|
|
63
|
-
}
|
|
64
|
-
getGpuText(i) {
|
|
65
|
-
try {
|
|
66
|
-
if (/, or similar$/.test(i) || /SwiftShader/.test(i))
|
|
67
|
-
return "Unknown";
|
|
68
|
-
if (/^ANGLE/.test(i)) {
|
|
69
|
-
const t = i.match(/\((.+)\)$/);
|
|
70
|
-
if (t) {
|
|
71
|
-
const e = t[1], s = e.split(/,\s*/g);
|
|
72
|
-
let r = s[1];
|
|
73
|
-
return /^ANGLE Metal Renderer: /.test(r) && (r = i.split(": ")[1].split(",")[0]), s.length === 1 && (r = s[0].split(" ").slice(1).join(" ")), /Direct3D/.test(r) && (r = r.split("Direct3D")[0].trim()), r;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
} catch {
|
|
77
|
-
return "Unknown";
|
|
78
|
-
}
|
|
79
|
-
return this.el(i);
|
|
36
|
+
const t = localStorage.getItem("gpu");
|
|
37
|
+
this.hasGpu = t !== "Unknown";
|
|
80
38
|
}
|
|
81
39
|
getLog() {
|
|
82
40
|
return this.logTable;
|
|
@@ -90,11 +48,11 @@ class v {
|
|
|
90
48
|
return;
|
|
91
49
|
}
|
|
92
50
|
const e = i.map((s) => {
|
|
93
|
-
const { vehicleId: r, heading: o, localTimestamp: h } = s,
|
|
51
|
+
const { vehicleId: r, heading: o, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y), a = new p({
|
|
94
52
|
geometry: {
|
|
95
53
|
type: "point",
|
|
96
|
-
x:
|
|
97
|
-
y:
|
|
54
|
+
x: l,
|
|
55
|
+
y: n
|
|
98
56
|
},
|
|
99
57
|
attributes: {
|
|
100
58
|
...s,
|
|
@@ -103,7 +61,7 @@ class v {
|
|
|
103
61
|
symbol: this.hasGpu ? this.createCIMSymbol(s) : this.createMarkerSymbol()
|
|
104
62
|
});
|
|
105
63
|
return this.hasGpu && (a.visible = !1, this.historyPositionMap.set(r, [
|
|
106
|
-
{ pos: [
|
|
64
|
+
{ pos: [l, n, 0], heading: o, time: h }
|
|
107
65
|
]), this.vehicleObjectMap.set(r, {
|
|
108
66
|
graphic: a,
|
|
109
67
|
data: s,
|
|
@@ -122,7 +80,7 @@ class v {
|
|
|
122
80
|
}
|
|
123
81
|
const e = [];
|
|
124
82
|
i.forEach((s) => {
|
|
125
|
-
const { vehicleId: r, heading: o, localTimestamp: h } = s,
|
|
83
|
+
const { vehicleId: r, heading: o, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y);
|
|
126
84
|
if (this.hasGpu) {
|
|
127
85
|
const a = this.vehicleObjectMap.get(r);
|
|
128
86
|
a ? (a.data = s, a.graphic.attributes = {
|
|
@@ -131,7 +89,7 @@ class v {
|
|
|
131
89
|
}, this.historyPositionMap.get(
|
|
132
90
|
r
|
|
133
91
|
).push({
|
|
134
|
-
pos: [
|
|
92
|
+
pos: [l, n, 0],
|
|
135
93
|
heading: o,
|
|
136
94
|
time: h
|
|
137
95
|
})) : e.push(s);
|
|
@@ -141,8 +99,8 @@ class v {
|
|
|
141
99
|
);
|
|
142
100
|
a ? a.geometry = {
|
|
143
101
|
type: "point",
|
|
144
|
-
x:
|
|
145
|
-
y:
|
|
102
|
+
x: l,
|
|
103
|
+
y: n
|
|
146
104
|
} : e.push(s);
|
|
147
105
|
}
|
|
148
106
|
}), this.addVehicles(e), t();
|
|
@@ -213,12 +171,12 @@ class v {
|
|
|
213
171
|
y: t[0].pos[1]
|
|
214
172
|
};
|
|
215
173
|
else {
|
|
216
|
-
const h = t[0].pos[0] + (t[1].pos[0] - t[0].pos[0]) * o,
|
|
174
|
+
const h = t[0].pos[0] + (t[1].pos[0] - t[0].pos[0]) * o, l = t[0].pos[1] + (t[1].pos[1] - t[0].pos[1]) * o, n = t[0].heading + (t[1].heading - t[0].heading) * o;
|
|
217
175
|
e.graphic.geometry = {
|
|
218
176
|
type: "point",
|
|
219
177
|
x: h,
|
|
220
|
-
y:
|
|
221
|
-
}, e.data.heading =
|
|
178
|
+
y: l
|
|
179
|
+
}, e.data.heading = n, e.graphic.symbol = this.hasGpu ? this.createCIMSymbol(e.data) : this.createMarkerSymbol();
|
|
222
180
|
}
|
|
223
181
|
}
|
|
224
182
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import r from "../common-utils.mjs";
|
|
2
2
|
class e {
|
|
3
3
|
constructor(t, i) {
|
|
4
|
-
this.parentName = "", this.crosses = [], this.subDistricts = [], this.crossCount = 0, this.subDistrictCount = 0, this.id = t.
|
|
4
|
+
this.parentName = "", this.crosses = [], this.subDistricts = [], this.crossCount = 0, this.subDistrictCount = 0, this.id = t.name, this.name = t.areaDesc, this.parentId = t.parentId, this.areaColor = i === "alarm" ? [255, 0, 0] : [61, 139, 249];
|
|
5
5
|
for (const s of t.children)
|
|
6
6
|
if (s.children) {
|
|
7
7
|
const o = new e(s, i);
|
|
8
|
-
o.parentName = this.name, this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
|
|
8
|
+
o.id = s.id, o.name = `SS ${s.name}`, o.parentName = this.name, this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
|
|
9
9
|
} else if (r.isCoordinateValid(s)) {
|
|
10
10
|
const o = {
|
|
11
11
|
id: s.id,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as p from "@arcgis/core/core/reactiveUtils.js";
|
|
2
2
|
import n from "@arcgis/core/Graphic";
|
|
3
3
|
import y from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import d from "@turf/buffer";
|
|
5
|
+
import g from "@turf/convex";
|
|
6
6
|
import * as a from "@turf/helpers";
|
|
7
7
|
import b from "axios";
|
|
8
8
|
import f from "concaveman";
|
|
9
9
|
import C from "../../stores/index.mjs";
|
|
10
10
|
import v from "./district-controller.mjs";
|
|
11
|
-
class
|
|
11
|
+
class G {
|
|
12
12
|
constructor(e) {
|
|
13
13
|
var i;
|
|
14
|
-
this.crossScale = 5e3, this.crossIdsInDistrict = [], this.view = e;
|
|
14
|
+
this.crossScale = 5e3, this.hasGpu = !1, this.crossIdsInDistrict = [], this.view = e, this.hasGpu = localStorage.getItem("gpu") !== "Unknown";
|
|
15
15
|
const r = C.useAppDataStore.mapConfig;
|
|
16
16
|
this.openDriveServer = (i = r.openDriveServer) == null ? void 0 : i.url, this.districtControllerLayer = new y({
|
|
17
17
|
id: "districtControllerLayer"
|
|
@@ -48,7 +48,7 @@ class N {
|
|
|
48
48
|
);
|
|
49
49
|
this.drawArea(r, !0);
|
|
50
50
|
}
|
|
51
|
-
return this.scaleWatcher =
|
|
51
|
+
return this.scaleWatcher = p.watch(
|
|
52
52
|
() => this.view.scale,
|
|
53
53
|
(t, r) => {
|
|
54
54
|
t > this.crossScale && r <= this.crossScale ? (this.crossLayer.graphics.forEach((i) => {
|
|
@@ -81,10 +81,17 @@ class N {
|
|
|
81
81
|
}
|
|
82
82
|
async locateSignalControlArea(e) {
|
|
83
83
|
const t = this.findAreaGraphic(e.id);
|
|
84
|
-
return t ? (t.attributes.type === "cross" ? await this.view.goTo(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
return t ? (t.attributes.type === "cross" ? await this.view.goTo(
|
|
85
|
+
{
|
|
86
|
+
target: t.geometry,
|
|
87
|
+
scale: 1500
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
91
|
+
}
|
|
92
|
+
) : await this.view.goTo(t.geometry, {
|
|
93
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
94
|
+
}), { status: 0, message: "ok" }) : { status: 1, message: "未找到" };
|
|
88
95
|
}
|
|
89
96
|
async highlightSignalControlArea(e) {
|
|
90
97
|
if (!e.id || e.id === "")
|
|
@@ -101,18 +108,32 @@ class N {
|
|
|
101
108
|
if (r.length > 0 && this.highlightLayer.addMany(r), i.length > 0 && this.highlightLayer.addMany(i), this.highlightLayer.graphics.length === 0)
|
|
102
109
|
return { status: 1, message: "未找到" };
|
|
103
110
|
if (t.length > 0)
|
|
104
|
-
await this.view.goTo(t
|
|
111
|
+
await this.view.goTo(t, {
|
|
112
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
113
|
+
});
|
|
105
114
|
else if (r.length > 0) {
|
|
106
115
|
const s = r[0].geometry.centroid;
|
|
107
|
-
await this.view.goTo(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
await this.view.goTo(
|
|
117
|
+
{
|
|
118
|
+
target: s,
|
|
119
|
+
scale: this.crossScale - 500
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
123
|
+
}
|
|
124
|
+
);
|
|
111
125
|
} else
|
|
112
|
-
i.length > 1 ? await this.view.goTo(i
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
i.length > 1 ? await this.view.goTo(i, {
|
|
127
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
128
|
+
}) : await this.view.goTo(
|
|
129
|
+
{
|
|
130
|
+
target: i[0].geometry,
|
|
131
|
+
scale: 1500
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
135
|
+
}
|
|
136
|
+
);
|
|
116
137
|
return { status: 0, message: "ok" };
|
|
117
138
|
}
|
|
118
139
|
resetHighlight() {
|
|
@@ -132,7 +153,9 @@ class N {
|
|
|
132
153
|
attributes: s
|
|
133
154
|
});
|
|
134
155
|
});
|
|
135
|
-
return this.crossLayer.addMany(r), this.view.goTo(r
|
|
156
|
+
return this.crossLayer.addMany(r), this.view.goTo(r, {
|
|
157
|
+
duration: this.hasGpu ? 1e3 : 0
|
|
158
|
+
}), { status: 0, message: "ok" };
|
|
136
159
|
}
|
|
137
160
|
/**
|
|
138
161
|
* 点击路口时
|
|
@@ -177,10 +200,10 @@ class N {
|
|
|
177
200
|
continue;
|
|
178
201
|
}
|
|
179
202
|
if (this.crossLayer.graphics.some(
|
|
180
|
-
(
|
|
203
|
+
(h) => h.getAttribute("id") === o
|
|
181
204
|
))
|
|
182
205
|
continue;
|
|
183
|
-
const
|
|
206
|
+
const u = new n({
|
|
184
207
|
geometry: {
|
|
185
208
|
type: "point",
|
|
186
209
|
x: s.lon,
|
|
@@ -194,7 +217,7 @@ class N {
|
|
|
194
217
|
selected: !1
|
|
195
218
|
}
|
|
196
219
|
});
|
|
197
|
-
i.push(
|
|
220
|
+
i.push(u);
|
|
198
221
|
}
|
|
199
222
|
return this.crossLayer.addMany(i), { status: 0, message: "ok" };
|
|
200
223
|
} else
|
|
@@ -213,7 +236,7 @@ class N {
|
|
|
213
236
|
e.crossesInArea.map(
|
|
214
237
|
(s) => a.point([s.longitude, s.latitude])
|
|
215
238
|
)
|
|
216
|
-
), r =
|
|
239
|
+
), r = g(t);
|
|
217
240
|
r && (this.districtControllerLayer.removeAll(), this.districtControllerLayer.add(
|
|
218
241
|
new n({
|
|
219
242
|
geometry: {
|
|
@@ -302,17 +325,17 @@ class N {
|
|
|
302
325
|
s = a.lineString(r);
|
|
303
326
|
else {
|
|
304
327
|
if (t) {
|
|
305
|
-
const
|
|
328
|
+
const c = a.featureCollection(
|
|
306
329
|
r.map((m) => a.point(m))
|
|
307
330
|
);
|
|
308
|
-
s =
|
|
331
|
+
s = g(c);
|
|
309
332
|
} else {
|
|
310
|
-
const
|
|
311
|
-
|
|
333
|
+
const c = f(r, 0.5);
|
|
334
|
+
c.length >= 4 && (s = a.polygon([c]));
|
|
312
335
|
}
|
|
313
336
|
s || (s = a.lineString(r));
|
|
314
337
|
}
|
|
315
|
-
const o =
|
|
338
|
+
const o = d(
|
|
316
339
|
s.geometry,
|
|
317
340
|
// 区控面积更大,需要更大的缓冲半径
|
|
318
341
|
t ? 200 : 30,
|
|
@@ -344,7 +367,7 @@ class N {
|
|
|
344
367
|
label: "路口数量"
|
|
345
368
|
}
|
|
346
369
|
];
|
|
347
|
-
const
|
|
370
|
+
const u = {
|
|
348
371
|
type: "signalControlArea",
|
|
349
372
|
id: e.id,
|
|
350
373
|
name: e.name,
|
|
@@ -352,7 +375,7 @@ class N {
|
|
|
352
375
|
parentName: e.parentName,
|
|
353
376
|
crossCount: e.crossCount,
|
|
354
377
|
subDistrictCount: e.subDistrictCount
|
|
355
|
-
},
|
|
378
|
+
}, h = new n({
|
|
356
379
|
geometry: {
|
|
357
380
|
type: "polygon",
|
|
358
381
|
rings: o.geometry.coordinates
|
|
@@ -367,9 +390,9 @@ class N {
|
|
|
367
390
|
style: t ? "long-dash" : "solid"
|
|
368
391
|
}
|
|
369
392
|
},
|
|
370
|
-
attributes:
|
|
393
|
+
attributes: u,
|
|
371
394
|
popupTemplate: {
|
|
372
|
-
title: `${
|
|
395
|
+
title: `${e.name}`,
|
|
373
396
|
content: [
|
|
374
397
|
{
|
|
375
398
|
type: "fields",
|
|
@@ -378,7 +401,7 @@ class N {
|
|
|
378
401
|
]
|
|
379
402
|
}
|
|
380
403
|
});
|
|
381
|
-
t ? this.districtControllerLayer.add(
|
|
404
|
+
t ? this.districtControllerLayer.add(h) : this.subDistrictControllerLayer.add(h);
|
|
382
405
|
}
|
|
383
406
|
for (const s of e.subDistricts)
|
|
384
407
|
this.drawArea(s, !1);
|
|
@@ -645,5 +668,5 @@ class N {
|
|
|
645
668
|
}
|
|
646
669
|
}
|
|
647
670
|
export {
|
|
648
|
-
|
|
671
|
+
G as default
|
|
649
672
|
};
|
|
@@ -146,7 +146,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
146
146
|
status: number;
|
|
147
147
|
message: string;
|
|
148
148
|
} | undefined;
|
|
149
|
-
showGreenWaveBand: (params: IShowGreenWaveBandParams) => void
|
|
149
|
+
showGreenWaveBand: (params: IShowGreenWaveBandParams) => Promise<void>;
|
|
150
150
|
props: any;
|
|
151
151
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
152
152
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),C=require("./stores/index.js");require("./style/index.css");const O=require("./utils/green-wave-band-controller/index.js"),We=require("./utils/holo-flow/index.js"),ze=require("./utils/holo-flow/signal-countdown-panel.vue.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),C=require("./stores/index.js");require("./style/index.css");const Ge=require("./utils/detect-gpu.js"),O=require("./utils/green-wave-band-controller/index.js"),We=require("./utils/holo-flow/index.js"),ze=require("./utils/holo-flow/signal-countdown-panel.vue.js"),je=require("./utils/map-initializer.js"),A=require("./utils/open-drive-renderer/index.js"),L=require("./utils/overlay.js"),Qe=require("./utils/queue-length.js"),D=require("./utils/road-config-tool/index.js"),T=require("./utils/signal-control-area-controller/index.js"),Ze=require("./utils/traffic-flow.js"),Ke={class:"gis-viewer"},Ue={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},Je=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(_,{expose:B,emit:q}){const f=a.ref(null);let o,u,l,i,r,s,p,t,n,d;const S=a.ref(!1);C.registerStore();const x=C.default.useAppDataStore,b=a.reactive([]);Ge.default(),a.onMounted(async()=>{if(!f.value)return;document.addEventListener("keydown",m=>{m.ctrlKey&&m.key==="i"&&(S.value=!S.value)});const e=a.getCurrentInstance(),{$gisviewerAssetsRoot:g}=e.appContext.config.globalProperties,c=await(await fetch(k.config)).json();c.assetsRoot=k.assetsRoot||g,x.mapConfig=c,u=new je.default,o=await u.initialize({container:f.value,mapConfig:c,markerClickCallback:(m,y,h,Pe)=>{w("markerClick",m,y,h,Pe)},mapClickCallback:(m,y,h)=>{w("mapClick",m,y,h)}}),r=new We.default(o,b),await r.init(),w("mapLoaded")}),a.onUnmounted(()=>{n==null||n.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),i==null||i.disconnectTrafficFlow()});const I=a.computed(()=>o),V=()=>{const e=C.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{r.downloadTrackLog()},N=()=>{v("vehicleId")},E=()=>{v("plateNumber")},H=async e=>await u.setMapCenter(e),P=async e=>await u.setMapCamera(e),G=async e=>await u.lookAt(e),W=e=>u.setLayerVisibility(e),z=(e,g)=>u.requestCoordinateTransform(e,g),j=e=>{u.cancelCoordinateTransform(e)},Q=e=>{u.setMapZoomRange(e)},Z=e=>(l||(l=new D.default(o)),l.showLaneNumber(e)),K=()=>{l==null||l.clearLaneNumber()},U=async e=>(l||(l=new D.default(o)),await l.initializeSearch(e)),J=async()=>l==null?void 0:l.calCrossIndicatorArea(),X=async()=>{},Y=async(e,g)=>{i||(i=new Ze.default(o)),i.connectTrafficFlow(e,g)},F=()=>{i==null||i.disconnectTrafficFlow()},R=async e=>{r.handleVehicleTraceData(e)},$=()=>{r.clearHoloTrace()},ee=e=>{r.setInterpolate(e)},te=async e=>{await r.handleSignalData(e)},ne=()=>{r.clearHoloSignal()},ae=e=>{i==null||i.toggleTrafficInfo(e),r==null||r.toggleTrafficInfo(e)},re=e=>{r==null||r.togglePause(e)},se=e=>{i==null||i.toggleTrafficObject(e),r==null||r.toggleTrafficObject(e)},v=e=>{r==null||r.updatePanelContent(e)},oe=async e=>(s||(s=new L.default(o)),s.addOverlays(e)),ie=e=>(s||(s=new L.default(o)),s.addMask(e)),ce=()=>{s==null||s.removeMask()},le=e=>s==null?void 0:s.removeOverlaysByType(e),ue=e=>s==null?void 0:s.removeOverlaysById(e),de=()=>s==null?void 0:s.removeAllOverlays(),ge=()=>{s==null||s.showAllOverlays()},me=e=>{p||(p=new Qe.default(o)),p.updateQueueLength(e)},pe=()=>{p==null||p.removeQueueLength()},fe=async(e,g)=>(t||(t=new A.default(o)),await t.showOpenDriveFromServer(e,g)),Se=async e=>(t||(t=new A.default(o)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),ve=async()=>await(t==null?void 0:t.clearOpenDrive()),we=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地图"},he=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Ce=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},be=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},ke=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Oe=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Ae=e=>(n||(n=new T.default(o)),n.showSignalControlArea(e)),Le=()=>{n==null||n.clearSignalControlArea()},De=async e=>n?await n.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Te=async e=>n?await n.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},_e=()=>n?n.resetHighlight():{status:-1,message:"未加载信号控制区"},Be=e=>(n||(n=new T.default(o)),n.showSubSignalControlArea(e)),qe=e=>n?n.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},xe=()=>n?n.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ie=e=>n?n.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ve=e=>n?n.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Me=e=>n?n.changeSubSignalControlAreaBorderVisibility(e):{status:-1,message:"未加载信号控制区"},Ne=e=>(d||(d=new O.default(o)),d.addGreenWaveBand(e)),Ee=()=>{if(!d)return{status:-1,message:"未加载绿波带"};d.stopAddGreenWaveBand()},He=async e=>(d||(d=new O.default(o)),await d.showGreenWaveBand(e)),k=_,w=q;return B({mapViewer:I,setLayerVisibility:W,setMapCenter:H,lookAt:G,setMapCamera:P,setMapZoomRange:Q,requestCoordinateTransform:z,cancelCoordinateTransform:j,addOverlays:oe,addMask:ie,removeMask:ce,showAllOverlays:ge,removeOverlaysByType:le,removeOverlaysById:ue,removeAllOverlays:de,showLaneNumber:Z,clearLaneNumber:K,initializeAreaTool:U,calCrossIndicatorArea:J,calRoadIndicatorArea:X,connectCarFlow:Y,disconnectCarFlow:F,handleHoloVehicleTraceData:R,clearHoloTrace:$,handleHoloSignalData:te,clearHoloSignal:ne,setInterpolate:ee,toggleTrafficInfo:ae,toggleTrafficObject:se,toggleVehicleInfo:v,togglePause:re,updateQueueLength:me,removeQueueLength:pe,showOpenDriveFromServer:fe,showOpenDriveFromFile:Se,clearOpenDrive:ve,geometrySearchInOpenDrive:Ce,findSumoInOpenDrive:we,selectSumoInOpenDrive:ye,unselectSumoInOpenDrive:he,getSumoInfo:be,splitOpenDriveLane:ke,clearSplitOpenDriveLane:Oe,showSignalControlArea:Ae,clearSignalControlArea:Le,locateSignalControlArea:De,highlightSignalControlArea:Te,resetHighlightSignalControlArea:_e,showSubSignalControlArea:Be,editSubSignalControlArea:qe,stopEditSubSignalControlArea:xe,selectSubSignalControlAreaCross:Ie,unselectSubSignalControlAreaCross:Ve,changeSubSignalControlAreaBorderVisibility:Me,addGreenWaveBand:Ne,stopAddGreenWaveBand:Ee,showGreenWaveBand:He}),(e,g)=>(a.openBlock(),a.createElementBlock("div",Ke,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:f},[a.withDirectives(a.createElementVNode("div",Ue,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:V}," 开始记录 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 下载日志 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:N}," 显示车辆id "),a.createElementVNode("button",{onClick:E},"显示车辆号牌")],512),[[a.vShow,S.value]])],512),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b,(c,m)=>(a.openBlock(),a.createBlock(ze.default,{key:m,"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=Je;
|
|
@@ -134,7 +134,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
134
134
|
status: number;
|
|
135
135
|
message: string;
|
|
136
136
|
} | undefined;
|
|
137
|
-
showGreenWaveBand: (params: import("../types").IShowGreenWaveBandParams) => void
|
|
137
|
+
showGreenWaveBand: (params: import("../types").IShowGreenWaveBandParams) => Promise<void>;
|
|
138
138
|
props: any;
|
|
139
139
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
140
140
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=e=>{const r=[],o=e.split("");for(let t=0;t<o.length;t++)if(o[t]==="(")r.push(t);else if(o[t]===")"){const n=r.pop();n!==void 0&&(o.splice(n,t-n+1),t=n-1)}return o.join("")},i=e=>s(e).replace(/\/PCIe\/SSE2/g,"").replace(/\s+/g," ").trim(),c=()=>{try{const e=document.createElement("canvas"),r=e.getContext("webgl")||e.getContext("experimental-webgl");if(!r)return"Unknown";const o=r.getExtension("WEBGL_debug_renderer_info");return o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)||"Unknown"}catch{return"Unknown"}},l=()=>{const e=c();try{if(/, or similar$/.test(e)||/SwiftShader/.test(e))return"Unknown";if(/^ANGLE/.test(e)){const r=e.match(/\((.+)\)$/);if(r){const o=r[1],t=o.split(/,\s*/g);let n=t[1];return/^ANGLE Metal Renderer: /.test(n)&&(n=e.split(": ")[1].split(",")[0]),t.length===1&&(n=t[0].split(" ").slice(1).join(" ")),/Direct3D/.test(n)&&(n=n.split("Direct3D")[0].trim()),n}}}catch{return"Unknown"}return i(e)},u=()=>{const e=l();return console.log("GPU:",e),localStorage.setItem("gpu",e),e};exports.default=u;
|
|
@@ -12,6 +12,7 @@ export default class GreenWaveBandController {
|
|
|
12
12
|
private selectedNodeIds;
|
|
13
13
|
private scaleWatcher?;
|
|
14
14
|
private readonly nodeScale;
|
|
15
|
+
private hasGpu;
|
|
15
16
|
private addNodeCallback;
|
|
16
17
|
private removeNodeCallback;
|
|
17
18
|
private removeAllNodeCallback;
|
|
@@ -22,7 +23,7 @@ export default class GreenWaveBandController {
|
|
|
22
23
|
*/
|
|
23
24
|
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
24
25
|
stopAddGreenWaveBand(): void;
|
|
25
|
-
showGreenWaveBand(params: IShowGreenWaveBandParams): void
|
|
26
|
+
showGreenWaveBand(params: IShowGreenWaveBandParams): Promise<void>;
|
|
26
27
|
/**
|
|
27
28
|
* 显示所有路口,进入待选状态
|
|
28
29
|
* @param nodeAttributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/core/reactiveUtils.js"),b=require("@arcgis/core/geometry"),n=require("@arcgis/core/Graphic"),y=require("@arcgis/core/layers/GraphicsLayer"),u=require("axios");function p(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const s in c)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(c,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>c[s]})}}return e.default=c,Object.freeze(e)}const g=p(m);class f{constructor(e){this.selectedNodeIds=[],this.nodeScale=5e3,this.view=e,this.roadsectLayer=new y({id:"roadsectLayer"}),this.view.map.add(this.roadsectLayer),this.allNodesLayer=new y({id:"allNodesLayer"}),this.view.map.add(this.allNodesLayer),this.bandLayer=new y({id:"bandLayer"}),this.view.map.add(this.bandLayer)}addGreenWaveBand(e){this.addNodeCallback=e.addCrossCallback,this.removeNodeCallback=e.removeCrossCallback,e.removeAllCrossCallback&&(this.removeAllNodeCallback=e.removeAllCrossCallback),this.selectedNodeIds=[],this.openDriveServer=e.odrServer,this.showAllNodes(e.crossesInArea),this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",s=>{this.handleViewClick(s)}))}stopAddGreenWaveBand(){var e;(e=this.viewClickWatcher)==null||e.remove(),this.viewClickWatcher=void 0,this.allNodesLayer.removeAll(),this.selectedNodeIds=[],this.roadsectLayer.removeAll(),this.bandLayer.removeAll()}showGreenWaveBand(e){this.scaleWatcher||(this.scaleWatcher=g.watch(()=>this.view.scale,(i,r)=>{i>this.nodeScale&&r<=this.nodeScale?this.bandLayer.graphics.forEach(l=>{l.geometry.type==="point"&&(l.symbol=this.getShowNodeSymbol("marker"))}):i<=this.nodeScale&&r>this.nodeScale&&this.bandLayer.graphics.forEach(l=>{l.geometry.type==="point"&&(l.symbol=this.getShowNodeSymbol("picture"))})}));const s=new b.Polyline({paths:[e.coordinates]}),a=new n({geometry:s,symbol:this.getLineSymbol(!0),attributes:{bandId:e.bandId}});this.roadsectLayer.add(a),this.view.goTo(a),e.nodeList.forEach(i=>{const r=new n({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getShowNodeSymbol("picture"),attributes:i});this.bandLayer.add(r)})}showAllNodes(e){const s=[];e.forEach(a=>{s.push(new n({geometry:{type:"point",x:a.longitude,y:a.latitude},symbol:this.getEditableNodeSymbol(!1),attributes:{...a,selected:!1}}))}),this.allNodesLayer.addMany(s)}async handleViewClick(e){var l;const a=(l=(await this.view.hitTest(e,{include:[this.allNodesLayer]})).results)==null?void 0:l.filter(d=>d.type==="graphic");if(a.length===0)return;const i=a[0].graphic,r=i.getAttribute("id");if(this.selectedNodeIds.includes(r)){const d=this.selectedNodeIds.indexOf(r)+1;if(d===1)this.removeAllNodeCallback&&this.removeAllNodeCallback(),this.selectedNodeIds=[],this.allNodesLayer.graphics.forEach(t=>{t.setAttribute("selected",!1),t.symbol=this.getEditableNodeSymbol(!1),t.visible=!0}),this.roadsectLayer.removeAll();else{for(let t=d;t<this.selectedNodeIds.length;t++){this.removeNodeCallback&&this.removeNodeCallback({id:this.selectedNodeIds[t]});for(let o=0;o<this.roadsectLayer.graphics.length;o++){const h=this.roadsectLayer.graphics.getItemAt(o);(h.getAttribute("id")===this.selectedNodeIds[t]||!h.getAttribute("selected"))&&(this.roadsectLayer.remove(h),o--)}}this.selectedNodeIds=this.selectedNodeIds.slice(0,d),this.allNodesLayer.graphics.forEach(t=>{const o=this.selectedNodeIds.includes(t.getAttribute("id"));t.setAttribute("selected",o),t.symbol=this.getEditableNodeSymbol(o),t.visible=o}),await this.showDownstreamNodes(r)}}else{i.setAttribute("selected",!0),i.symbol=this.getEditableNodeSymbol(!0),this.selectedNodeIds.push(r),this.allNodesLayer.graphics.forEach(t=>{t.visible=t.getAttribute("selected")});let d=[];for(let t=0;t<this.roadsectLayer.graphics.length;t++){const o=this.roadsectLayer.graphics.getItemAt(t);o.getAttribute("id")===r?(o.symbol=this.getLineSymbol(!0),o.setAttribute("selected",!0),d=o.geometry.paths[0]):o.getAttribute("selected")||(this.roadsectLayer.remove(o),t--)}this.addNodeCallback&&this.addNodeCallback({...i.attributes,roadsect:d}),await this.showDownstreamNodes(r)}}async showDownstreamNodes(e){this.view.container.style.cursor="progress";const s=await u.get(`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,{params:{nodeId:e}});if(s.status!==200||s.data.status!==0){this.view.container.style.cursor="default";return}s.data.result.forEach(i=>{this.allNodesLayer.graphics.forEach(r=>{if(r.getAttribute("nodeId")===i.id&&r.getAttribute("selected")===!1&&(r.visible=!0,i.coordinates)){const l=new n({geometry:{type:"polyline",paths:[i.coordinates]},symbol:this.getLineSymbol(!1),attributes:{...i,selected:!1}});this.roadsectLayer.add(l)}})}),this.view.container.style.cursor="default"}getLineSymbol(e){return e?{type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:4,markerPlacement:{type:"CIMMarkerPlacementAlongLineSameSize",endings:"WithMarkers",placementTemplate:[40],angleToLine:!0},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[4,-4],[12,0],[4,4]],[[-4,4],[-12,0],[-4,-4]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,width:1.5,color:[255,255,255,255]}]}}]},{type:"CIMSolidStroke",enable:!0,width:4,color:[55,125,34,255]}]}}}:{type:"simple-line",color:"gray",width:2}}getShowNodeSymbol(e){return e==="marker"?{type:"simple-marker",style:"circle",color:[61,139,249],size:8,outline:{color:"white",width:1}}:this.getEditableNodeSymbol(!0)}getEditableNodeSymbol(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=f;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/core/reactiveUtils.js"),b=require("@arcgis/core/geometry"),n=require("@arcgis/core/Graphic"),y=require("@arcgis/core/layers/GraphicsLayer"),u=require("axios");function p(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const s in c)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(c,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>c[s]})}}return e.default=c,Object.freeze(e)}const g=p(m);class f{constructor(e){this.selectedNodeIds=[],this.nodeScale=5e3,this.hasGpu=!1,this.hasGpu=localStorage.getItem("gpu")!=="Unknown",this.view=e,this.roadsectLayer=new y({id:"roadsectLayer"}),this.view.map.add(this.roadsectLayer),this.allNodesLayer=new y({id:"allNodesLayer"}),this.view.map.add(this.allNodesLayer),this.bandLayer=new y({id:"bandLayer"}),this.view.map.add(this.bandLayer)}addGreenWaveBand(e){this.addNodeCallback=e.addCrossCallback,this.removeNodeCallback=e.removeCrossCallback,e.removeAllCrossCallback&&(this.removeAllNodeCallback=e.removeAllCrossCallback),this.selectedNodeIds=[],this.openDriveServer=e.odrServer,this.showAllNodes(e.crossesInArea),this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",s=>{this.handleViewClick(s)}))}stopAddGreenWaveBand(){var e;(e=this.viewClickWatcher)==null||e.remove(),this.viewClickWatcher=void 0,this.allNodesLayer.removeAll(),this.selectedNodeIds=[],this.roadsectLayer.removeAll(),this.bandLayer.removeAll()}async showGreenWaveBand(e){this.scaleWatcher||(this.scaleWatcher=g.watch(()=>this.view.scale,(i,r)=>{i>this.nodeScale&&r<=this.nodeScale?this.bandLayer.graphics.forEach(l=>{l.geometry.type==="point"&&(l.symbol=this.getShowNodeSymbol("marker"))}):i<=this.nodeScale&&r>this.nodeScale&&this.bandLayer.graphics.forEach(l=>{l.geometry.type==="point"&&(l.symbol=this.getShowNodeSymbol("picture"))})}));const s=new b.Polyline({paths:[e.coordinates]}),a=new n({geometry:s,symbol:this.getLineSymbol(!0),attributes:{bandId:e.bandId}});this.roadsectLayer.add(a),await this.view.goTo(a),e.nodeList.forEach(i=>{const r=new n({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getShowNodeSymbol("picture"),attributes:i});this.bandLayer.add(r)})}showAllNodes(e){const s=[];e.forEach(a=>{s.push(new n({geometry:{type:"point",x:a.longitude,y:a.latitude},symbol:this.getEditableNodeSymbol(!1),attributes:{...a,selected:!1}}))}),this.allNodesLayer.addMany(s)}async handleViewClick(e){var l;const a=(l=(await this.view.hitTest(e,{include:[this.allNodesLayer]})).results)==null?void 0:l.filter(d=>d.type==="graphic");if(a.length===0)return;const i=a[0].graphic,r=i.getAttribute("id");if(this.selectedNodeIds.includes(r)){const d=this.selectedNodeIds.indexOf(r)+1;if(d===1)this.removeAllNodeCallback&&this.removeAllNodeCallback(),this.selectedNodeIds=[],this.allNodesLayer.graphics.forEach(t=>{t.setAttribute("selected",!1),t.symbol=this.getEditableNodeSymbol(!1),t.visible=!0}),this.roadsectLayer.removeAll();else{for(let t=d;t<this.selectedNodeIds.length;t++){this.removeNodeCallback&&this.removeNodeCallback({id:this.selectedNodeIds[t]});for(let o=0;o<this.roadsectLayer.graphics.length;o++){const h=this.roadsectLayer.graphics.getItemAt(o);(h.getAttribute("id")===this.selectedNodeIds[t]||!h.getAttribute("selected"))&&(this.roadsectLayer.remove(h),o--)}}this.selectedNodeIds=this.selectedNodeIds.slice(0,d),this.allNodesLayer.graphics.forEach(t=>{const o=this.selectedNodeIds.includes(t.getAttribute("id"));t.setAttribute("selected",o),t.symbol=this.getEditableNodeSymbol(o),t.visible=o}),await this.showDownstreamNodes(r)}}else{i.setAttribute("selected",!0),i.symbol=this.getEditableNodeSymbol(!0),this.selectedNodeIds.push(r),this.allNodesLayer.graphics.forEach(t=>{t.visible=t.getAttribute("selected")});let d=[];for(let t=0;t<this.roadsectLayer.graphics.length;t++){const o=this.roadsectLayer.graphics.getItemAt(t);o.getAttribute("id")===r?(o.symbol=this.getLineSymbol(!0),o.setAttribute("selected",!0),d=o.geometry.paths[0]):o.getAttribute("selected")||(this.roadsectLayer.remove(o),t--)}this.addNodeCallback&&this.addNodeCallback({...i.attributes,roadsect:d}),await this.showDownstreamNodes(r)}}async showDownstreamNodes(e){this.view.container.style.cursor="progress";const s=await u.get(`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,{params:{nodeId:e}});if(s.status!==200||s.data.status!==0){this.view.container.style.cursor="default";return}s.data.result.forEach(i=>{this.allNodesLayer.graphics.forEach(r=>{if(r.getAttribute("nodeId")===i.id&&r.getAttribute("selected")===!1&&(r.visible=!0,i.coordinates)){const l=new n({geometry:{type:"polyline",paths:[i.coordinates]},symbol:this.getLineSymbol(!1),attributes:{...i,selected:!1}});this.roadsectLayer.add(l)}})}),this.view.container.style.cursor="default"}getLineSymbol(e){return e?{type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:4,markerPlacement:{type:"CIMMarkerPlacementAlongLineSameSize",endings:"WithMarkers",placementTemplate:[40],angleToLine:!0},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[4,-4],[12,0],[4,4]],[[-4,4],[-12,0],[-4,-4]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,width:1.5,color:[255,255,255,255]}]}}]},{type:"CIMSolidStroke",enable:!0,width:4,color:[55,125,34,255]}]}}}:{type:"simple-line",color:"gray",width:2}}getShowNodeSymbol(e){return e==="marker"?{type:"simple-marker",style:"circle",color:[61,139,249],size:8,outline:{color:"white",width:1}}:this.getEditableNodeSymbol(!0)}getEditableNodeSymbol(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=f;
|
|
@@ -8,10 +8,6 @@ export default class TraceRendererLayer implements ITraceRendererInterface {
|
|
|
8
8
|
private appDataStore;
|
|
9
9
|
private logTable;
|
|
10
10
|
constructor(view: __esri.MapView);
|
|
11
|
-
private getRendererText;
|
|
12
|
-
private em;
|
|
13
|
-
private el;
|
|
14
|
-
private getGpuText;
|
|
15
11
|
getLog(): (string | number)[][];
|
|
16
12
|
init(): Promise<void>;
|
|
17
13
|
private needInterpolate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@arcgis/core/Graphic"),g=require("@arcgis/core/layers/GraphicsLayer"),m=require("vue"),u=require("../../stores/index.js");class y{constructor(i){this.hasGpu=!1,this.appDataStore=u.default.useAppDataStore,this.logTable=[["uuid","ptcId","plateno","timestamp","localTimestamp","timestamp_str","speed","laneNo","objHeight","objLength","latitude","longitude","ptcType","vehicleType","vehicleColor","plateColor","sbdm","heading","fixAngle","roadLayer","status","step","receiveTimestamp"]],this.needInterpolate=!0,this.isPaused=!1,this.showVehiclePlate=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.view=i,this.mapConfig=m.toRaw(this.appDataStore.mapConfig),this.vehicleLayer=new g({id:"vehicleLayer"}),this.view.map.add(this.vehicleLayer);const t=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@arcgis/core/Graphic"),g=require("@arcgis/core/layers/GraphicsLayer"),m=require("vue"),u=require("../../stores/index.js");class y{constructor(i){this.hasGpu=!1,this.appDataStore=u.default.useAppDataStore,this.logTable=[["uuid","ptcId","plateno","timestamp","localTimestamp","timestamp_str","speed","laneNo","objHeight","objLength","latitude","longitude","ptcType","vehicleType","vehicleColor","plateColor","sbdm","heading","fixAngle","roadLayer","status","step","receiveTimestamp"]],this.needInterpolate=!0,this.isPaused=!1,this.showVehiclePlate=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.view=i,this.mapConfig=m.toRaw(this.appDataStore.mapConfig),this.vehicleLayer=new g({id:"vehicleLayer"}),this.view.map.add(this.vehicleLayer);const t=localStorage.getItem("gpu");this.hasGpu=t!=="Unknown"}getLog(){return this.logTable}async init(){}addVehicles(i){return new Promise(t=>{if(this.isPaused){t();return}const e=i.map(s=>{const{vehicleId:o,heading:r,localTimestamp:h}=s,l=Number(s.x),n=Number(s.y),a=new p({geometry:{type:"point",x:l,y:n},attributes:{...s,type:"trackVehicle"},symbol:this.hasGpu?this.createCIMSymbol(s):this.createMarkerSymbol()});return this.hasGpu&&(a.visible=!1,this.historyPositionMap.set(o,[{pos:[l,n,0],heading:r,time:h}]),this.vehicleObjectMap.set(o,{graphic:a,data:s,waitForDelete:!1,isMoving:!1})),a});this.vehicleLayer.addMany(e),t()})}updateVehicles(i){return new Promise(t=>{if(this.isPaused){t();return}const e=[];i.forEach(s=>{const{vehicleId:o,heading:r,localTimestamp:h}=s,l=Number(s.x),n=Number(s.y);if(this.hasGpu){const a=this.vehicleObjectMap.get(o);a?(a.data=s,a.graphic.attributes={...s,type:"trackVehicle"},this.historyPositionMap.get(o).push({pos:[l,n,0],heading:r,time:h})):e.push(s)}else{const a=this.vehicleLayer.graphics.find(c=>c.getAttribute("vehicleId")==s.vehicleId);a?a.geometry={type:"point",x:l,y:n}:e.push(s)}}),this.addVehicles(e),t()})}deleteVehicles(i){this.isPaused||(this.hasGpu?i.forEach(t=>{const e=this.vehicleObjectMap.get(t);e&&(e.waitForDelete=!0)}):i.forEach(t=>{const e=this.vehicleLayer.graphics.find(s=>s.getAttribute("vehicleId")==t);e&&this.vehicleLayer.remove(e)}))}clearVehicles(){this.vehicleLayer.removeAll(),this.vehicleObjectMap.clear(),this.historyPositionMap.clear()}toggleGroundVehicle(i){this.showGroundVehicle=i}toggleElevatedVehicle(i){this.showElevatedVehicle=i}toggleTrafficInfo(i){i.name==="vehiclePlate"&&(this.showVehiclePlate=i.visible)}togglePause(i){this.isPaused=i,this.isPaused&&this.rafSignal?cancelAnimationFrame(this.rafSignal):this.rafSignal=requestAnimationFrame(()=>this.render())}updatePanelContent(i){console.log(i)}setInterpolate(i){this.needInterpolate=i}render(){this.isPaused||this.vehicleObjectMap.forEach((i,t)=>{this.updatePosition(t)}),this.rafSignal=requestAnimationFrame(()=>this.render())}updatePosition(i){const t=this.historyPositionMap.get(i),e=this.vehicleObjectMap.get(i);if(!t||!e||!e.isMoving&&t.length<=2)return;e.isMoving=!0,(e.graphic.getAttribute("roadLayer")||"1")==="1"?e.graphic.visible=this.showGroundVehicle:e.graphic.visible=this.showElevatedVehicle,e.segmentStartTime||(e.segmentStartTime=Date.now(),e.segmentTotalTime=t[1].time-t[0].time);const o=Date.now()-e.segmentStartTime,r=Math.min(1,o/e.segmentTotalTime);if(r===1)if(t.shift(),t.length===1){e.waitForDelete?(this.vehicleLayer.remove(e.graphic),this.vehicleObjectMap.delete(i),this.historyPositionMap.delete(i)):(e.segmentStartTime=void 0,e.segmentTotalTime=void 0,e.graphic.visible=!1,e.isMoving=!1);return}else e.segmentStartTime=Date.now(),e.segmentTotalTime=t[1].time-t[0].time,Math.abs(t[1].heading-t[0].heading)>180&&(t[1].heading>t[0].heading?t[0].heading+=360:t[1].heading+=360),e.graphic.geometry={type:"point",x:t[0].pos[0],y:t[0].pos[1]};else{const h=t[0].pos[0]+(t[1].pos[0]-t[0].pos[0])*r,l=t[0].pos[1]+(t[1].pos[1]-t[0].pos[1])*r,n=t[0].heading+(t[1].heading-t[0].heading)*r;e.graphic.geometry={type:"point",x:h,y:l},e.data.heading=n,e.graphic.symbol=this.hasGpu?this.createCIMSymbol(e.data):this.createMarkerSymbol()}}createCIMSymbol(i){const t=this.getPlateFontColor(i.plateColor),e=this.getCarPic(i.vehicleColor,i.speed);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:e.size,rotation:i.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/${e.pic}`}]}}}}createMarkerSymbol(){return{type:"simple-marker",color:"green",size:5,outline:{color:"white",width:1}}}getCarPic(i,t){if(this.view.scale>=1e3){let e="point_green.png";return t&&(t<=4.2?e="point_red.png":t<=8.4?e="point_yellow.png":e="point_green.png"),{pic:e,size:15}}else{let e="grey";switch(typeof i=="string"&&(i=i.toLowerCase()),i){case"a":case 1:e="white";break;case"b":case 2:e="grey";break;case"c":case 3:e="yellow";break;case"d":case 4:e="pink";break;case"e":case 5:e="red";break;case"f":case 10:e="purple";break;case"g":case 6:e="green";break;case"h":case 7:e="blue";break;case"i":case 8:e="brown";break;case"j":case 9:e="black";break}return{pic:"/car/"+e+".png",size:20}}}getPlateFontColor(i){let t=[255,255,255,255],e=[169,169,169,255];switch(i){case 0:t=[0,0,0,255],e=[255,255,255,255];break;case 1:t=[0,0,0,255],e=[244,164,96,255];break;case 2:t=[255,255,255,255],e=[65,105,225,255];break;case 3:t=[255,255,255,255],e=[0,0,0,255];break;case 15:t=[244,164,96,255],e=[0,250,154,255];break;case 16:t=[0,0,0,255],e=[0,250,154,255];break}return{fillColor:t,backgroundColor:e}}}exports.default=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../common-utils.js");class o{constructor(t,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../common-utils.js");class o{constructor(t,e){this.parentName="",this.crosses=[],this.subDistricts=[],this.crossCount=0,this.subDistrictCount=0,this.id=t.name,this.name=t.areaDesc,this.parentId=t.parentId,this.areaColor=e==="alarm"?[255,0,0]:[61,139,249];for(const s of t.children)if(s.children){const i=new o(s,e);i.id=s.id,i.name=`SS ${s.name}`,i.parentName=this.name,this.subDistricts.push(i),this.subDistrictCount++,this.crossCount+=i.crossCount}else if(r.default.isCoordinateValid(s)){const i={id:s.id,name:s.name,parentId:s.parentId,latitude:Number(s.latitude),longitude:Number(s.longitude),signalId:s.id,nodeId:s.nodeId,isKey:s.isKey===1};this.crosses.push(i),this.crossCount++}}getAllCrossCoordinates(){const t=[];for(const e of this.crosses)t.push([e.longitude,e.latitude]);for(const e of this.subDistricts)t.push(...e.getAllCrossCoordinates());return t}}exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),y=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),m=require("@turf/convex"),C=require("@turf/helpers"),v=require("axios"),S=require("concaveman"),I=require("../../stores/index.js"),A=require("./district-controller.js");function d(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const L=d(p),a=d(C);class w{constructor(e){var r;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;const i=I.default.useAppDataStore.mapConfig;this.openDriveServer=(r=i.openDriveServer)==null?void 0:r.url,this.districtControllerLayer=new y({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new y({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new y({id:"crossLayer",visible:!1}),this.highlightLayer=new y({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1,this.districtControllerLayer.visible=!0;for(const t of e.areaList){const i=new A.default(t,e.style||"");this.drawArea(i,!0)}return this.scaleWatcher=L.watch(()=>this.view.scale,(t,i)=>{t>this.crossScale&&i<=this.crossScale?(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker"))})):t<=this.crossScale&&i>this.crossScale&&(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e,t;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.scaleWatcher)==null||e.remove(),this.scaleWatcher=void 0,(t=this.viewClickWatcher)==null||t.remove(),this.viewClickWatcher=void 0,this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);return t?(t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry),{status:0,message:"ok"}):{status:1,message:"未找到"}}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>{const o=s.clone();return o.symbol.style="none",o}),i=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),r=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());if(i.length>0&&this.highlightLayer.addMany(i),r.length>0&&this.highlightLayer.addMany(r),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(i.length>0){const s=i[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else r.length>1?await this.view.goTo(r):await this.view.goTo({target:r[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){this.crossLayer.removeAll(),this.crossLayer.visible=!0;const i=e.children.map(r=>{const s={...r,selected:!0};return new c({geometry:{type:"point",x:r.longitude,y:r.latitude},symbol:this.getCrossSymbolInSubDistrict(s),attributes:s})});return this.crossLayer.addMany(i),this.view.goTo(i),{status:0,message:"ok"}}async handleViewClick(e){var s;const i=(s=(await this.view.hitTest(e,{include:[this.crossLayer]})).results)==null?void 0:s.filter(o=>o.type==="graphic");if(i.length===0)return;const r=i[0].graphic;r.getAttribute("selected")?r.getAttribute("signalId")&&(this.removeCrossCallback&&this.removeCrossCallback({id:r.getAttribute("id")}),r.setAttribute("selected",!1),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)):(r.getAttribute("signalId")&&(this.addCrossCallback&&this.addCrossCallback(r.attributes),r.setAttribute("selected",!0),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)),await this.showNearbyCrosses(r.getAttribute("id")))}async showNearbyCrosses(e){const t=await v.get(`http://${this.openDriveServer}/api/computable/getRelatedNodesForNode`,{params:{nodeIds:e}});if(t.status===200)if(t.data.status===0){const i=t.data.result,r=[];for(const s of i){const o=s.nodeId;if(o.startsWith("-"))continue;if(s.signalId&&!this.crossIdsInDistrict.includes(o)){console.log("不是此区控内的路口",o);continue}if(this.crossLayer.graphics.some(h=>h.getAttribute("id")===o))continue;const g=new c({geometry:{type:"point",x:s.lon,y:s.lat},symbol:this.getCrossSymbolInSubDistrict(s),attributes:{id:o,name:s.name,signalId:s.signalId,selected:!1}});r.push(g)}return this.crossLayer.addMany(r),{status:0,message:"ok"}}else return{status:-1,message:t.data.message};else return{status:-1,message:"请求失败"}}async editSubSignalControlArea(e){if(e.odrServer){this.openDriveServer=e.odrServer,this.crossIdsInDistrict=e.crossesInArea.map(s=>s.id);const t=a.featureCollection(e.crossesInArea.map(s=>a.point([s.longitude,s.latitude]))),i=m(t);i&&(this.districtControllerLayer.removeAll(),this.districtControllerLayer.add(new c({geometry:{type:"polygon",rings:i.geometry.coordinates},symbol:{type:"simple-fill",style:"none",outline:{color:[61,139,249],width:3,style:"long-dash"}}}))),this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",async s=>{await this.handleViewClick(s)}));const r=this.crossLayer.graphics.toArray().map(s=>s.getAttribute("id")).join(",");return await this.showNearbyCrosses(r)}else return{status:1,message:"未配置OpenDriveServer"}}stopEditSubSignalControlArea(){var t;(t=this.viewClickWatcher)==null||t.remove(),this.viewClickWatcher=void 0;const e=this.crossLayer.graphics.filter(i=>i.getAttribute("signalId")===""||!i.getAttribute("signalId")||!i.getAttribute("selected"));this.crossLayer.removeMany(e.toArray())}selectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&!t.getAttribute("selected"))return t.setAttribute("selected",!0),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}unselectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&t.getAttribute("selected"))return t.setAttribute("selected",!1),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}changeSubSignalControlAreaBorderVisibility(e){this.highlightLayer.graphics.forEach(t=>{t.getAttribute("type")==="signalControlArea"&&(t.visible=e)})}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(i=>i.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(i=>i.attributes.id===e)),t||(t=this.crossLayer.graphics.find(i=>i.attributes.id===e)),t}drawArea(e,t){const i=e.getAllCrossCoordinates();if(i.length>=2){let s=null;if(i.length===2)s=a.lineString(i);else{if(t){const u=a.featureCollection(i.map(b=>a.point(b)));s=m(u)}else{const u=S(i,.5);u.length>=4&&(s=a.polygon([u]))}s||(s=a.lineString(i))}const o=f(s.geometry,t?200:30,{units:"meters"});let n;t?n=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:n=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const g={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},h=new c({geometry:{type:"polygon",rings:o.geometry.coordinates},symbol:{type:"simple-fill",style:"none",color:[...e.areaColor,.3],outline:{color:e.areaColor,width:3,style:t?"long-dash":"solid"}},attributes:g,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:n}]}});t?this.districtControllerLayer.add(h):this.subDistrictControllerLayer.add(h)}for(const s of e.subDistricts)this.drawArea(s,!1);const r=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,nodeId:s.nodeId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:s.isKey},n=new c({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getCrossGraphicSymbol(o,"marker"),attributes:o,popupTemplate:{title:s.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]}});r.push(n)}),this.crossLayer.addMany(r)}getCrossSymbolInSubDistrict(e){return e.signalId&&e.signalId!==""?{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:32,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:1,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:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e.selected?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_lkcz.png",width:"20px",height:"20px"}}getCrossGraphicSymbol(e,t){const{isKey:i,color:r}=e;if(t==="marker")return i?{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:r,size:8,outline:{color:"white",width:1}};if(t==="picture")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:32,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:i?30:15,haloSize:1,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:i?40:20,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${i?"gis_gjxklk_orange":"gis_xhj_blue"}.png`}]}}}}}exports.default=w;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),y=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),d=require("@turf/convex"),C=require("@turf/helpers"),v=require("axios"),S=require("concaveman"),I=require("../../stores/index.js"),A=require("./district-controller.js");function m(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const L=m(b),a=m(C);class w{constructor(e){var i;this.crossScale=5e3,this.hasGpu=!1,this.crossIdsInDistrict=[],this.view=e,this.hasGpu=localStorage.getItem("gpu")!=="Unknown";const r=I.default.useAppDataStore.mapConfig;this.openDriveServer=(i=r.openDriveServer)==null?void 0:i.url,this.districtControllerLayer=new y({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new y({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new y({id:"crossLayer",visible:!1}),this.highlightLayer=new y({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1,this.districtControllerLayer.visible=!0;for(const t of e.areaList){const r=new A.default(t,e.style||"");this.drawArea(r,!0)}return this.scaleWatcher=L.watch(()=>this.view.scale,(t,r)=>{t>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(i=>{i.symbol=this.getCrossGraphicSymbol(i.attributes,"marker")}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol=this.getCrossGraphicSymbol(i.attributes,"marker"))})):t<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(i=>{i.symbol=this.getCrossGraphicSymbol(i.attributes,"picture")}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol=this.getCrossGraphicSymbol(i.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e,t;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.scaleWatcher)==null||e.remove(),this.scaleWatcher=void 0,(t=this.viewClickWatcher)==null||t.remove(),this.viewClickWatcher=void 0,this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);return t?(t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500},{duration:this.hasGpu?1e3:0}):await this.view.goTo(t.geometry,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到"}}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>{const o=s.clone();return o.symbol.style="none",o}),r=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),i=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());if(r.length>0&&this.highlightLayer.addMany(r),i.length>0&&this.highlightLayer.addMany(i),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t,{duration:this.hasGpu?1e3:0});else if(r.length>0){const s=r[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500},{duration:this.hasGpu?1e3:0})}else i.length>1?await this.view.goTo(i,{duration:this.hasGpu?1e3:0}):await this.view.goTo({target:i[0].geometry,scale:1500},{duration:this.hasGpu?1e3:0});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){this.crossLayer.removeAll(),this.crossLayer.visible=!0;const r=e.children.map(i=>{const s={...i,selected:!0};return new c({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getCrossSymbolInSubDistrict(s),attributes:s})});return this.crossLayer.addMany(r),this.view.goTo(r,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}async handleViewClick(e){var s;const r=(s=(await this.view.hitTest(e,{include:[this.crossLayer]})).results)==null?void 0:s.filter(o=>o.type==="graphic");if(r.length===0)return;const i=r[0].graphic;i.getAttribute("selected")?i.getAttribute("signalId")&&(this.removeCrossCallback&&this.removeCrossCallback({id:i.getAttribute("id")}),i.setAttribute("selected",!1),i.symbol=this.getCrossSymbolInSubDistrict(i.attributes)):(i.getAttribute("signalId")&&(this.addCrossCallback&&this.addCrossCallback(i.attributes),i.setAttribute("selected",!0),i.symbol=this.getCrossSymbolInSubDistrict(i.attributes)),await this.showNearbyCrosses(i.getAttribute("id")))}async showNearbyCrosses(e){const t=await v.get(`http://${this.openDriveServer}/api/computable/getRelatedNodesForNode`,{params:{nodeIds:e}});if(t.status===200)if(t.data.status===0){const r=t.data.result,i=[];for(const s of r){const o=s.nodeId;if(o.startsWith("-"))continue;if(s.signalId&&!this.crossIdsInDistrict.includes(o)){console.log("不是此区控内的路口",o);continue}if(this.crossLayer.graphics.some(h=>h.getAttribute("id")===o))continue;const g=new c({geometry:{type:"point",x:s.lon,y:s.lat},symbol:this.getCrossSymbolInSubDistrict(s),attributes:{id:o,name:s.name,signalId:s.signalId,selected:!1}});i.push(g)}return this.crossLayer.addMany(i),{status:0,message:"ok"}}else return{status:-1,message:t.data.message};else return{status:-1,message:"请求失败"}}async editSubSignalControlArea(e){if(e.odrServer){this.openDriveServer=e.odrServer,this.crossIdsInDistrict=e.crossesInArea.map(s=>s.id);const t=a.featureCollection(e.crossesInArea.map(s=>a.point([s.longitude,s.latitude]))),r=d(t);r&&(this.districtControllerLayer.removeAll(),this.districtControllerLayer.add(new c({geometry:{type:"polygon",rings:r.geometry.coordinates},symbol:{type:"simple-fill",style:"none",outline:{color:[61,139,249],width:3,style:"long-dash"}}}))),this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",async s=>{await this.handleViewClick(s)}));const i=this.crossLayer.graphics.toArray().map(s=>s.getAttribute("id")).join(",");return await this.showNearbyCrosses(i)}else return{status:1,message:"未配置OpenDriveServer"}}stopEditSubSignalControlArea(){var t;(t=this.viewClickWatcher)==null||t.remove(),this.viewClickWatcher=void 0;const e=this.crossLayer.graphics.filter(r=>r.getAttribute("signalId")===""||!r.getAttribute("signalId")||!r.getAttribute("selected"));this.crossLayer.removeMany(e.toArray())}selectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&!t.getAttribute("selected"))return t.setAttribute("selected",!0),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}unselectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&t.getAttribute("selected"))return t.setAttribute("selected",!1),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}changeSubSignalControlAreaBorderVisibility(e){this.highlightLayer.graphics.forEach(t=>{t.getAttribute("type")==="signalControlArea"&&(t.visible=e)})}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e)),t}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>=2){let s=null;if(r.length===2)s=a.lineString(r);else{if(t){const u=a.featureCollection(r.map(p=>a.point(p)));s=d(u)}else{const u=S(r,.5);u.length>=4&&(s=a.polygon([u]))}s||(s=a.lineString(r))}const o=f(s.geometry,t?200:30,{units:"meters"});let n;t?n=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:n=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const g={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},h=new c({geometry:{type:"polygon",rings:o.geometry.coordinates},symbol:{type:"simple-fill",style:"none",color:[...e.areaColor,.3],outline:{color:e.areaColor,width:3,style:t?"long-dash":"solid"}},attributes:g,popupTemplate:{title:`${e.name}`,content:[{type:"fields",fieldInfos:n}]}});t?this.districtControllerLayer.add(h):this.subDistrictControllerLayer.add(h)}for(const s of e.subDistricts)this.drawArea(s,!1);const i=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,nodeId:s.nodeId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:s.isKey},n=new c({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getCrossGraphicSymbol(o,"marker"),attributes:o,popupTemplate:{title:s.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]}});i.push(n)}),this.crossLayer.addMany(i)}getCrossSymbolInSubDistrict(e){return e.signalId&&e.signalId!==""?{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:32,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:1,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:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e.selected?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_lkcz.png",width:"20px",height:"20px"}}getCrossGraphicSymbol(e,t){const{isKey:r,color:i}=e;if(t==="marker")return r?{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:i,size:8,outline:{color:"white",width:1}};if(t==="picture")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:32,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:r?30:15,haloSize:1,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:r?40:20,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${r?"gis_gjxklk_orange":"gis_xhj_blue"}.png`}]}}}}}exports.default=w;
|