gisviewer-vue3-arcgis 1.0.153 → 1.0.155
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 +3 -1
- package/es/src/gis-map/gis-map.vue.mjs +120 -116
- package/es/src/gis-map/index.d.ts +2 -0
- package/es/src/gis-map/utils/holo-flow/index.d.ts +1 -2
- package/es/src/gis-map/utils/holo-flow/index.mjs +19 -12
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +9 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +43 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +3 -4
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +27 -21
- package/es/src/gis-map/utils/overlay.d.ts +3 -1
- package/es/src/gis-map/utils/overlay.mjs +75 -43
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +16 -4
- package/es/src/types/index.d.ts +5 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +3 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +2 -0
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +1 -2
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +9 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +3 -4
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/gis-map/utils/overlay.d.ts +3 -1
- package/lib/src/gis-map/utils/overlay.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
|
-
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
3
|
+
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
4
4
|
import HoloFlow from './utils/holo-flow';
|
|
5
5
|
import MapInitializer from './utils/map-initializer';
|
|
6
6
|
import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
@@ -63,6 +63,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
63
63
|
toggleTrafficObject: (params: IToggleTrafficInfoParams) => void;
|
|
64
64
|
toggleVehicleInfo: (contentType: string) => void;
|
|
65
65
|
addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
|
|
66
|
+
addMask: (params: IMaskParam) => void;
|
|
67
|
+
removeMask: () => void;
|
|
66
68
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
67
69
|
removeOverlaysById: (ids: string[]) => import("../types").IResult;
|
|
68
70
|
removeAllOverlays: () => import("../types").IResult;
|
|
@@ -1,176 +1,180 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import O, { registerStore as
|
|
1
|
+
import { defineComponent as Le, ref as S, onMounted as Ae, getCurrentInstance as Ie, onUnmounted as be, computed as Me, openBlock as _e, createElementBlock as He, createElementVNode as p, withDirectives as xe, vShow as Ve } from "vue";
|
|
2
|
+
import O, { registerStore as Be } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import ze from "./utils/holo-flow/index.mjs";
|
|
5
|
+
import Ne from "./utils/map-initializer.mjs";
|
|
6
6
|
import C from "./utils/open-drive-renderer/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
7
|
+
import k from "./utils/overlay.mjs";
|
|
8
|
+
import Qe from "./utils/queue-length.mjs";
|
|
9
|
+
import T from "./utils/road-config-tool/index.mjs";
|
|
10
|
+
import je from "./utils/signal-control-area-controller/index.mjs";
|
|
11
|
+
import Pe from "./utils/traffic-flow.mjs";
|
|
12
|
+
const Ee = { class: "gis-viewer" }, Fe = { style: { position: "absolute", bottom: "10px", left: "10px" } }, et = /* @__PURE__ */ Le({
|
|
13
13
|
__name: "gis-map",
|
|
14
14
|
props: {
|
|
15
15
|
config: {},
|
|
16
16
|
assetsRoot: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
19
|
-
setup(
|
|
19
|
+
setup(D, { expose: L, emit: A }) {
|
|
20
20
|
const g = S(null);
|
|
21
|
-
let
|
|
21
|
+
let s, c, i, r, n, a, u, t, o;
|
|
22
22
|
const f = S(!1);
|
|
23
|
-
|
|
24
|
-
if (
|
|
23
|
+
Ae(async () => {
|
|
24
|
+
if (Be(), !g.value)
|
|
25
25
|
return;
|
|
26
26
|
document.addEventListener("keydown", (m) => {
|
|
27
27
|
m.ctrlKey && m.key === "i" && (f.value = !f.value);
|
|
28
28
|
});
|
|
29
|
-
const e =
|
|
30
|
-
h.assetsRoot =
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const e = Ie(), { $gisviewerAssetsRoot: l } = e.appContext.config.globalProperties, h = await (await fetch(y.config)).json();
|
|
30
|
+
h.assetsRoot = y.assetsRoot || l;
|
|
31
|
+
const Te = O.useAppDataStore;
|
|
32
|
+
Te.mapConfig = h, c = new Ne(), s = await c.initialize({
|
|
33
33
|
container: g.value,
|
|
34
|
-
markerClickCallback: (m,
|
|
35
|
-
w("markerClick", m,
|
|
34
|
+
markerClickCallback: (m, d, v, De) => {
|
|
35
|
+
w("markerClick", m, d, v, De);
|
|
36
36
|
},
|
|
37
|
-
mapClickCallback: (m,
|
|
38
|
-
w("mapClick", m,
|
|
37
|
+
mapClickCallback: (m, d, v) => {
|
|
38
|
+
w("mapClick", m, d, v);
|
|
39
39
|
}
|
|
40
|
-
}),
|
|
41
|
-
}),
|
|
42
|
-
o == null || o.clearSignalControlArea(), t == null || t.clearOpenDrive(),
|
|
40
|
+
}), n = new ze(s), await n.init(), w("mapLoaded");
|
|
41
|
+
}), be(() => {
|
|
42
|
+
o == null || o.clearSignalControlArea(), t == null || t.clearOpenDrive(), n == null || n.clearHoloTrace(), n == null || n.clearHoloSignal(), r == null || r.disconnectTrafficFlow();
|
|
43
43
|
});
|
|
44
|
-
const
|
|
44
|
+
const I = Me(() => s), b = () => {
|
|
45
45
|
const e = O.useAppDataStore;
|
|
46
46
|
e.saveTrackLog = !0;
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
}, _ = async (e) => await c.setMapCenter(e), H = async (e) => await c.setMapCamera(e), x = async (e) => await c.lookAt(e),
|
|
47
|
+
}, M = () => {
|
|
48
|
+
n.downloadTrackLog();
|
|
49
|
+
}, _ = async (e) => await c.setMapCenter(e), H = async (e) => await c.setMapCamera(e), x = async (e) => await c.lookAt(e), V = (e) => c.setLayerVisibility(e), B = (e, l) => c.requestCoordinateTransform(e, l), z = (e) => {
|
|
50
50
|
c.cancelCoordinateTransform(e);
|
|
51
|
-
},
|
|
51
|
+
}, N = (e) => {
|
|
52
52
|
c.setMapZoomRange(e);
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
await
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
}, J = (e) => {
|
|
71
|
-
n == null || n.toggleTrafficInfo(e), a.toggleTrafficInfo(e);
|
|
53
|
+
}, Q = (e) => (i || (i = new T(s)), i.showLaneNumber(e)), j = () => {
|
|
54
|
+
i == null || i.clearLaneNumber();
|
|
55
|
+
}, P = async (e) => (i || (i = new T(s)), await i.initializeSearch(e)), E = async () => i == null ? void 0 : i.calCrossIndicatorArea(), F = async () => {
|
|
56
|
+
}, Z = async (e, l) => {
|
|
57
|
+
r || (r = new Pe(s)), r.connectTrafficFlow(e, l);
|
|
58
|
+
}, q = () => {
|
|
59
|
+
r == null || r.disconnectTrafficFlow();
|
|
60
|
+
}, K = (e) => {
|
|
61
|
+
n.handleVehicleTraceData(e);
|
|
62
|
+
}, U = () => {
|
|
63
|
+
n.clearHoloTrace();
|
|
64
|
+
}, $ = (e) => {
|
|
65
|
+
n.setInterpolate(e);
|
|
66
|
+
}, G = async (e) => {
|
|
67
|
+
await n.handleSignalData(e);
|
|
68
|
+
}, J = () => {
|
|
69
|
+
n.clearHoloSignal();
|
|
72
70
|
}, R = (e) => {
|
|
73
|
-
|
|
71
|
+
r == null || r.toggleTrafficInfo(e), n.toggleTrafficInfo(e);
|
|
74
72
|
}, W = (e) => {
|
|
75
|
-
n
|
|
73
|
+
n.togglePause(e);
|
|
76
74
|
}, X = (e) => {
|
|
77
|
-
|
|
78
|
-
}, Y =
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
}, oe = () => {
|
|
75
|
+
r == null || r.toggleTrafficObject(e), n.toggleTrafficObject(e);
|
|
76
|
+
}, Y = (e) => {
|
|
77
|
+
n.updatePanelContent(e);
|
|
78
|
+
}, ee = async (e) => (a || (a = new k(s)), a.addOverlays(e)), te = (e) => (a || (a = new k(s)), a.addMask(e)), ae = () => {
|
|
79
|
+
a == null || a.removeMask();
|
|
80
|
+
}, ne = (e) => a == null ? void 0 : a.removeOverlaysByType(e), re = (e) => a == null ? void 0 : a.removeOverlaysById(e), oe = () => a == null ? void 0 : a.removeAllOverlays(), se = () => {
|
|
81
|
+
a == null || a.showAllOverlays();
|
|
82
|
+
}, ie = (e) => {
|
|
83
|
+
u || (u = new Qe(s)), u.updateQueueLength(e);
|
|
84
|
+
}, ce = () => {
|
|
83
85
|
u == null || u.removeQueueLength();
|
|
84
|
-
},
|
|
86
|
+
}, le = async (e, l) => (t || (t = new C(s)), await t.showOpenDriveFromServer(e, l)), ue = async (e) => (t || (t = new C(s)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), me = async () => await (t == null ? void 0 : t.clearOpenDrive()), pe = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
85
87
|
status: -1,
|
|
86
88
|
message: "未加载OpenDrive地图"
|
|
87
|
-
},
|
|
89
|
+
}, ge = async (e) => t ? t.selectSumo(e) : {
|
|
88
90
|
status: -1,
|
|
89
91
|
message: "未加载OpenDrive地图"
|
|
90
|
-
},
|
|
92
|
+
}, fe = async (e) => t ? t.unselectSumo(e) : {
|
|
91
93
|
status: -1,
|
|
92
94
|
message: "未加载OpenDrive地图"
|
|
93
|
-
},
|
|
95
|
+
}, we = async (e) => t ? await t.geometrySearch(e) : {
|
|
94
96
|
status: -1,
|
|
95
97
|
message: "未加载OpenDrive地图"
|
|
96
|
-
},
|
|
98
|
+
}, de = async (e) => t ? await t.getSumoInfo(e) : {
|
|
97
99
|
status: -1,
|
|
98
100
|
message: "未加载OpenDrive地图"
|
|
99
|
-
},
|
|
101
|
+
}, ve = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
100
102
|
status: -1,
|
|
101
103
|
message: "未加载OpenDrive地图"
|
|
102
|
-
},
|
|
104
|
+
}, ye = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
|
|
103
105
|
status: -1,
|
|
104
106
|
message: "未加载OpenDrive地图"
|
|
105
|
-
},
|
|
107
|
+
}, he = (e) => (o || (o = new je(s)), o.showSignalControlArea(e)), Se = () => {
|
|
106
108
|
o == null || o.clearSignalControlArea();
|
|
107
|
-
},
|
|
108
|
-
return
|
|
109
|
-
mapViewer:
|
|
110
|
-
setLayerVisibility:
|
|
109
|
+
}, Oe = async (e) => o ? await o.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ce = async (e) => o ? await o.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, ke = () => o ? o.resetHighlight() : { status: -1, message: "未加载信号控制区" }, y = D, w = A;
|
|
110
|
+
return L({
|
|
111
|
+
mapViewer: I,
|
|
112
|
+
setLayerVisibility: V,
|
|
111
113
|
setMapCenter: _,
|
|
112
114
|
lookAt: x,
|
|
113
115
|
setMapCamera: H,
|
|
114
|
-
setMapZoomRange:
|
|
115
|
-
requestCoordinateTransform:
|
|
116
|
-
cancelCoordinateTransform:
|
|
117
|
-
addOverlays:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
116
|
+
setMapZoomRange: N,
|
|
117
|
+
requestCoordinateTransform: B,
|
|
118
|
+
cancelCoordinateTransform: z,
|
|
119
|
+
addOverlays: ee,
|
|
120
|
+
addMask: te,
|
|
121
|
+
removeMask: ae,
|
|
122
|
+
showAllOverlays: se,
|
|
123
|
+
removeOverlaysByType: ne,
|
|
124
|
+
removeOverlaysById: re,
|
|
125
|
+
removeAllOverlays: oe,
|
|
126
|
+
showLaneNumber: Q,
|
|
127
|
+
clearLaneNumber: j,
|
|
128
|
+
initializeAreaTool: P,
|
|
129
|
+
calCrossIndicatorArea: E,
|
|
130
|
+
calRoadIndicatorArea: F,
|
|
131
|
+
connectCarFlow: Z,
|
|
132
|
+
disconnectCarFlow: q,
|
|
133
|
+
handleHoloVehicleTraceData: K,
|
|
134
|
+
clearHoloTrace: U,
|
|
135
|
+
handleHoloSignalData: G,
|
|
136
|
+
clearHoloSignal: J,
|
|
137
|
+
setInterpolate: $,
|
|
138
|
+
toggleTrafficInfo: R,
|
|
139
|
+
toggleTrafficObject: X,
|
|
140
|
+
toggleVehicleInfo: Y,
|
|
141
|
+
togglePause: W,
|
|
142
|
+
updateQueueLength: ie,
|
|
143
|
+
removeQueueLength: ce,
|
|
144
|
+
showOpenDriveFromServer: le,
|
|
145
|
+
showOpenDriveFromFile: ue,
|
|
146
|
+
clearOpenDrive: me,
|
|
147
|
+
geometrySearchInOpenDrive: we,
|
|
148
|
+
findSumoInOpenDrive: pe,
|
|
149
|
+
selectSumoInOpenDrive: ge,
|
|
150
|
+
unselectSumoInOpenDrive: fe,
|
|
151
|
+
getSumoInfo: de,
|
|
152
|
+
splitOpenDriveLane: ve,
|
|
153
|
+
clearSplitOpenDriveLane: ye,
|
|
154
|
+
showSignalControlArea: he,
|
|
155
|
+
clearSignalControlArea: Se,
|
|
156
|
+
locateSignalControlArea: Oe,
|
|
157
|
+
highlightSignalControlArea: Ce,
|
|
158
|
+
resetHighlightSignalControlArea: ke
|
|
159
|
+
}), (e, l) => (_e(), He("div", Ee, [
|
|
156
160
|
p("div", {
|
|
157
161
|
class: "gis-viewer-main",
|
|
158
162
|
ref_key: "mapContainer",
|
|
159
163
|
ref: g
|
|
160
164
|
}, [
|
|
161
|
-
|
|
165
|
+
xe(p("div", Fe, [
|
|
162
166
|
p("button", {
|
|
163
167
|
style: { "margin-right": "10px" },
|
|
164
|
-
onClick:
|
|
168
|
+
onClick: b
|
|
165
169
|
}, " 开始记录 "),
|
|
166
|
-
p("button", { onClick:
|
|
170
|
+
p("button", { onClick: M }, "下载日志")
|
|
167
171
|
], 512), [
|
|
168
|
-
[
|
|
172
|
+
[Ve, f.value]
|
|
169
173
|
])
|
|
170
174
|
], 512)
|
|
171
175
|
]));
|
|
172
176
|
}
|
|
173
177
|
});
|
|
174
178
|
export {
|
|
175
|
-
|
|
179
|
+
et as default
|
|
176
180
|
};
|
|
@@ -52,6 +52,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
52
52
|
toggleTrafficObject: (params: import("../types").IToggleTrafficInfoParams) => void;
|
|
53
53
|
toggleVehicleInfo: (contentType: string) => void;
|
|
54
54
|
addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
|
|
55
|
+
addMask: (params: import("../types").IMaskParam) => void;
|
|
56
|
+
removeMask: () => void;
|
|
55
57
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
56
58
|
removeOverlaysById: (ids: string[]) => import("../types").IResult;
|
|
57
59
|
removeAllOverlays: () => import("../types").IResult;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import View from '@arcgis/core/views/View';
|
|
2
1
|
import { IToggleTrafficInfoParams } from '../../../types';
|
|
3
2
|
export default class Index {
|
|
4
3
|
private readonly view;
|
|
5
4
|
private traceHoloFlow;
|
|
6
5
|
private signalHoloFlow;
|
|
7
|
-
constructor(view:
|
|
6
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
8
7
|
init(): Promise<void>;
|
|
9
8
|
/**
|
|
10
9
|
* 处理全息流轨迹数据
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { EVehiclePlateState as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { EVehiclePlateState as a } from "../../../types/index.mjs";
|
|
2
|
+
import i from "../../stores/index.mjs";
|
|
3
|
+
import r from "./signal-holo-flow.mjs";
|
|
4
|
+
import s from "./signal-holo-flow-lsr.mjs";
|
|
5
|
+
import n from "./trace-holo-flow.mjs";
|
|
6
|
+
class p {
|
|
5
7
|
constructor(e) {
|
|
6
8
|
this.view = e;
|
|
7
9
|
}
|
|
8
10
|
async init() {
|
|
9
|
-
this.traceHoloFlow = new
|
|
11
|
+
this.traceHoloFlow = new n(this.view), await this.traceHoloFlow.init();
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* 处理全息流轨迹数据
|
|
@@ -37,25 +39,30 @@ class n {
|
|
|
37
39
|
this.traceHoloFlow.togglePause(e);
|
|
38
40
|
}
|
|
39
41
|
updatePanelContent(e) {
|
|
40
|
-
let o =
|
|
42
|
+
let o = a.None;
|
|
41
43
|
switch (e) {
|
|
42
44
|
case "none":
|
|
43
|
-
o =
|
|
45
|
+
o = a.None;
|
|
44
46
|
break;
|
|
45
47
|
case "plateNumber":
|
|
46
|
-
o =
|
|
48
|
+
o = a.PlateNumber;
|
|
47
49
|
break;
|
|
48
50
|
case "vehicleId":
|
|
49
|
-
o =
|
|
51
|
+
o = a.Id;
|
|
50
52
|
break;
|
|
51
53
|
case "mix":
|
|
52
|
-
o =
|
|
54
|
+
o = a.Mix;
|
|
53
55
|
break;
|
|
54
56
|
}
|
|
55
57
|
this.traceHoloFlow.updatePanelContent(o);
|
|
56
58
|
}
|
|
57
59
|
async handleSignalData(e) {
|
|
58
|
-
|
|
60
|
+
var o, l;
|
|
61
|
+
if (!this.signalHoloFlow) {
|
|
62
|
+
const t = i.useAppDataStore;
|
|
63
|
+
((l = (o = JSON.parse(JSON.stringify(t.mapConfig)).holoFlow) == null ? void 0 : o.signal) == null ? void 0 : l.style) === "LSR" ? this.signalHoloFlow = new s(this.view) : this.signalHoloFlow = new r(this.view), await this.signalHoloFlow.initializeLayer();
|
|
64
|
+
}
|
|
65
|
+
await this.signalHoloFlow.handleSignalData(e);
|
|
59
66
|
}
|
|
60
67
|
clearHoloSignal() {
|
|
61
68
|
var e;
|
|
@@ -69,5 +76,5 @@ class n {
|
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
export {
|
|
72
|
-
|
|
79
|
+
p as default
|
|
73
80
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
|
+
private stopLineLayer;
|
|
4
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
5
|
+
private stopLineMap;
|
|
6
|
+
initializeLayer(): Promise<void>;
|
|
7
|
+
handleSignalData(data: any): Promise<void>;
|
|
8
|
+
clearSignal(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import c from "@arcgis/core/Graphic";
|
|
2
|
+
import h from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import d from "./signal-holo-flow.mjs";
|
|
4
|
+
class f extends d {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(e), this.stopLineLayer = new h(), this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
|
|
7
|
+
}
|
|
8
|
+
async initializeLayer() {
|
|
9
|
+
var s, a;
|
|
10
|
+
console.time("初始化停止线图层");
|
|
11
|
+
let e = (a = (s = this.mapConfig.holoFlow) == null ? void 0 : s.signal) == null ? void 0 : a.stopLineLayer;
|
|
12
|
+
if (!e)
|
|
13
|
+
return;
|
|
14
|
+
e = this.mapConfig.assetsRoot + "/" + e;
|
|
15
|
+
const o = await (await fetch(e)).json();
|
|
16
|
+
console.log(o.features.length), o.features.forEach((t) => {
|
|
17
|
+
const { roadId: n, nodeId: r } = t.properties, { coordinates: p } = t.geometry, l = this.stopLineMap.get(r);
|
|
18
|
+
l ? l.set(n, p) : this.stopLineMap.set(r, /* @__PURE__ */ new Map([[n, p]]));
|
|
19
|
+
}), console.timeEnd("初始化停止线图层"), console.log(this.stopLineMap.size);
|
|
20
|
+
}
|
|
21
|
+
async handleSignalData(e) {
|
|
22
|
+
const { crossId: i } = e, o = this.stopLineMap.get(i);
|
|
23
|
+
o && o.forEach((s, a) => {
|
|
24
|
+
const t = new c({
|
|
25
|
+
geometry: {
|
|
26
|
+
type: "polyline",
|
|
27
|
+
paths: [s]
|
|
28
|
+
},
|
|
29
|
+
symbol: {
|
|
30
|
+
type: "simple-line",
|
|
31
|
+
color: [255, 0, 0],
|
|
32
|
+
width: 4
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
this.stopLineLayer.add(t);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
clearSignal() {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
f as default
|
|
43
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import View from '@arcgis/core/views/View';
|
|
2
1
|
export default class SignalHoloFlow {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
protected view: __esri.MapView | __esri.SceneView;
|
|
3
|
+
protected mapConfig: any;
|
|
5
4
|
/** 显示停止线的图层 */
|
|
6
5
|
private phaseLineLayer;
|
|
7
6
|
/** 每个路口的当前相位 */
|
|
@@ -11,7 +10,7 @@ export default class SignalHoloFlow {
|
|
|
11
10
|
private countdownWatchHandel;
|
|
12
11
|
private plateBackground;
|
|
13
12
|
private lastDataTime;
|
|
14
|
-
constructor(view:
|
|
13
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
15
14
|
/**
|
|
16
15
|
* 初始化相位线图层
|
|
17
16
|
* */
|
|
@@ -3,16 +3,17 @@ import * as j from "@arcgis/core/core/promiseUtils";
|
|
|
3
3
|
import { Polygon as N } from "@arcgis/core/geometry";
|
|
4
4
|
import * as L from "@arcgis/core/geometry/geometryEngine";
|
|
5
5
|
import k from "@arcgis/core/layers/FeatureLayer";
|
|
6
|
-
import
|
|
6
|
+
import I from "@arcgis/core/layers/GraphicsLayer";
|
|
7
7
|
import * as G from "@turf/helpers";
|
|
8
8
|
import { lineSliceAlong as C } from "@turf/line-slice-along";
|
|
9
9
|
import b from "axios";
|
|
10
|
-
import
|
|
10
|
+
import { XMLParser as x } from "fast-xml-parser";
|
|
11
|
+
import F from "md5";
|
|
11
12
|
import O from "pako";
|
|
12
|
-
import { watch as
|
|
13
|
+
import { watch as P } from "vue";
|
|
13
14
|
import J from "../../stores/index.mjs";
|
|
14
|
-
import
|
|
15
|
-
class
|
|
15
|
+
import E from "../common-utils.mjs";
|
|
16
|
+
class M {
|
|
16
17
|
constructor(e) {
|
|
17
18
|
this.junctionNames = /* @__PURE__ */ new Map(), this.projectName = "", this.openDriveServer = "", this.currentSectionCode = "", this.selectedSectionIds = [], this.currentJunctionId = "", this.view = e, this.laneLayer = new k({
|
|
18
19
|
id: "OpenDriveLane",
|
|
@@ -287,7 +288,7 @@ class F {
|
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
]
|
|
290
|
-
}), this.junctionLayer = new
|
|
291
|
+
}), this.junctionLayer = new I({ id: "OpenDriveJunction" }), this.sectionLayer = new I({ id: "OpenDriveSection" }), this.highlightLayer = new I({ id: "OpenDriveHighlight" }), this.flashLayer = new I({ id: "OpenDriveFlash" }), this.drawLayer = new I({ id: "Draw" }), this.splitLaneLayer = new I({ id: "SplitLane" }), this.borderLayer = new I({ id: "OpenDriveBorder" }), this.view.map.addMany([
|
|
291
292
|
this.laneLayer,
|
|
292
293
|
this.junctionLayer,
|
|
293
294
|
this.sectionLayer,
|
|
@@ -295,18 +296,23 @@ class F {
|
|
|
295
296
|
this.highlightLayer,
|
|
296
297
|
this.flashLayer,
|
|
297
298
|
this.drawLayer,
|
|
298
|
-
this.splitLaneLayer
|
|
299
|
+
this.splitLaneLayer,
|
|
300
|
+
this.borderLayer
|
|
299
301
|
]);
|
|
300
302
|
}
|
|
301
303
|
static getInstance(e) {
|
|
302
|
-
return this.instance || (this.instance = new
|
|
304
|
+
return this.instance || (this.instance = new M(e)), this.instance;
|
|
303
305
|
}
|
|
304
306
|
async makeMd5FromFile(e) {
|
|
307
|
+
var t;
|
|
305
308
|
try {
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
const r = await (await fetch(e)).text(), n = (t = new x({
|
|
310
|
+
ignoreAttributes: !1,
|
|
311
|
+
allowBooleanAttributes: !0
|
|
312
|
+
}).parse(r).OpenDRIVE.userData) == null ? void 0 : t.border;
|
|
313
|
+
return { status: 0, message: "ok", result: { md5: F(r), border: n } };
|
|
314
|
+
} catch (i) {
|
|
315
|
+
return { status: -1, message: i.message };
|
|
310
316
|
}
|
|
311
317
|
}
|
|
312
318
|
/**
|
|
@@ -320,7 +326,7 @@ class F {
|
|
|
320
326
|
const t = await this.makeMd5FromFile(e.file);
|
|
321
327
|
if (t.status !== 0)
|
|
322
328
|
return t;
|
|
323
|
-
this.projectName = t.result, console.timeEnd("md5用时"), this.openDriveServer = e.server
|
|
329
|
+
this.projectName = t.result.md5, console.timeEnd("md5用时"), console.log(t.result.border), this.openDriveServer = e.server;
|
|
324
330
|
const i = `http://${this.openDriveServer}/api/openDrive/uploadXodr`;
|
|
325
331
|
let r;
|
|
326
332
|
try {
|
|
@@ -341,7 +347,7 @@ class F {
|
|
|
341
347
|
return { status: -1, message: r.statusText };
|
|
342
348
|
console.time("渲染用时");
|
|
343
349
|
const s = r.data.result.geoSetting;
|
|
344
|
-
|
|
350
|
+
E.setGeoData(
|
|
345
351
|
s.geoReference,
|
|
346
352
|
s.offsetX,
|
|
347
353
|
s.offsetY
|
|
@@ -357,7 +363,7 @@ class F {
|
|
|
357
363
|
const d = r.data.result.junctions;
|
|
358
364
|
this.showJunction(d), e.options && e.options.centerMap !== !1 && await this.view.goTo(this.allLaneGraphics), this.mouseMoveHandler || this.monitorMouseMove(), this.mouseClickHandler || this.monitorMouseClick();
|
|
359
365
|
const h = J.useAppDataStore;
|
|
360
|
-
return
|
|
366
|
+
return P(
|
|
361
367
|
() => h.isSketching,
|
|
362
368
|
() => {
|
|
363
369
|
var m, f;
|
|
@@ -426,8 +432,8 @@ class F {
|
|
|
426
432
|
const w = Number(u.id);
|
|
427
433
|
if (w === 0)
|
|
428
434
|
continue;
|
|
429
|
-
const
|
|
430
|
-
|
|
435
|
+
const v = u.type, $ = [...u.outerPath], S = u.innerPath.concat(
|
|
436
|
+
$.reverse()
|
|
431
437
|
);
|
|
432
438
|
if (S.length <= 3) {
|
|
433
439
|
console.warn(`lane ${w} has less than 3 points`);
|
|
@@ -450,7 +456,7 @@ class F {
|
|
|
450
456
|
sectionId: String(f),
|
|
451
457
|
sectionIndex: p,
|
|
452
458
|
laneId: w,
|
|
453
|
-
type:
|
|
459
|
+
type: v,
|
|
454
460
|
sumoId: "",
|
|
455
461
|
// 记录左右边线的起始点,用于按长度高亮车道的一部分
|
|
456
462
|
leftLine: u.innerPath,
|
|
@@ -1021,11 +1027,11 @@ class F {
|
|
|
1021
1027
|
const r = Number(i[1]), s = i[0].split("#"), c = s.length === 2 ? Number(s[1]) : 0;
|
|
1022
1028
|
let n = s[0];
|
|
1023
1029
|
n.startsWith("-") && (n = n.slice(1));
|
|
1024
|
-
const a = this.allLaneGraphics.filter((
|
|
1030
|
+
const a = this.allLaneGraphics.filter((v) => v.getAttribute("roadId") === n && v.getAttribute("sectionIndex") === c);
|
|
1025
1031
|
if (a.length === 0)
|
|
1026
1032
|
return { status: -1, message: "未找到路段" };
|
|
1027
1033
|
const o = a.length - r, l = a.find(
|
|
1028
|
-
(
|
|
1034
|
+
(v) => Math.abs(v.getAttribute("laneId")) === o
|
|
1029
1035
|
);
|
|
1030
1036
|
if (!l)
|
|
1031
1037
|
return { status: -1, message: "未找到车道" };
|
|
@@ -1071,5 +1077,5 @@ class F {
|
|
|
1071
1077
|
}
|
|
1072
1078
|
}
|
|
1073
1079
|
export {
|
|
1074
|
-
|
|
1080
|
+
M as default
|
|
1075
1081
|
};
|
|
@@ -2,7 +2,7 @@ import Graphic from '@arcgis/core/Graphic';
|
|
|
2
2
|
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
3
|
import MapView from '@arcgis/core/views/MapView';
|
|
4
4
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
-
import { IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
|
|
5
|
+
import { IMaskParam, IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
|
|
6
6
|
interface IOverlayOptions {
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
@@ -11,6 +11,8 @@ export default class Overlay {
|
|
|
11
11
|
overlayLayer: GraphicsLayer;
|
|
12
12
|
constructor(view: MapView | SceneView, options?: IOverlayOptions);
|
|
13
13
|
private defaultPointSymbol;
|
|
14
|
+
addMask(params: IMaskParam): void;
|
|
15
|
+
removeMask(): void;
|
|
14
16
|
/**
|
|
15
17
|
* 添加覆盖物
|
|
16
18
|
* @param params
|