gisviewer-vue3-arcgis 1.0.193 → 1.0.195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/gis-map/gis-map.vue.d.ts +7 -0
- package/es/src/gis-map/gis-map.vue.mjs +126 -119
- package/es/src/gis-map/index.d.ts +6 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +35 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +194 -0
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +1 -0
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +7 -6
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +1 -1
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +20 -17
- package/es/src/types/index.d.ts +9 -5
- package/lib/src/gis-map/gis-map.vue.d.ts +7 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +6 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +35 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +1 -0
- 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 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +9 -5
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
3
|
import { IEditSignalControlAreaParams, IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, IShowSignalControlAreaParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
4
|
+
import GreenWaveBandController from './utils/green-wave-band-controller';
|
|
4
5
|
import HoloFlow from './utils/holo-flow';
|
|
5
6
|
import MapInitializer from './utils/map-initializer';
|
|
6
7
|
import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
@@ -29,6 +30,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
29
30
|
queueLength: QueueLength;
|
|
30
31
|
openDriveRenderer: OpenDriveRenderer;
|
|
31
32
|
signalControlAreaController: SignalControlAreaController;
|
|
33
|
+
greenWaveBandController: GreenWaveBandController;
|
|
32
34
|
showLogDiv: import("vue").Ref<boolean>;
|
|
33
35
|
appDataStore: import("pinia").Store<"appData", {
|
|
34
36
|
mapConfig: {};
|
|
@@ -139,6 +141,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
139
141
|
status: number;
|
|
140
142
|
message: string;
|
|
141
143
|
};
|
|
144
|
+
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
145
|
+
stopAddGreenWaveBand: () => {
|
|
146
|
+
status: number;
|
|
147
|
+
message: string;
|
|
148
|
+
} | undefined;
|
|
142
149
|
props: any;
|
|
143
150
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
144
151
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Ge, ref as b, reactive as Qe, onMounted as je, getCurrentInstance as Ze, onUnmounted as $e, computed as qe, openBlock as h, createElementBlock as k, createElementVNode as p, withDirectives as Ke, vShow as Ue, Fragment as Je, renderList as Re, createBlock as Xe } from "vue";
|
|
2
|
+
import D, { registerStore as Ye } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import L from "./utils/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import I from "./utils/
|
|
12
|
-
import
|
|
13
|
-
|
|
4
|
+
import Fe from "./utils/green-wave-band-controller/index.mjs";
|
|
5
|
+
import et from "./utils/holo-flow/index.mjs";
|
|
6
|
+
import tt from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
7
|
+
import at from "./utils/map-initializer.mjs";
|
|
8
|
+
import L from "./utils/open-drive-renderer/index.mjs";
|
|
9
|
+
import T from "./utils/overlay.mjs";
|
|
10
|
+
import nt from "./utils/queue-length.mjs";
|
|
11
|
+
import I from "./utils/road-config-tool/index.mjs";
|
|
12
|
+
import B from "./utils/signal-control-area-controller/index.mjs";
|
|
13
|
+
import rt from "./utils/traffic-flow.mjs";
|
|
14
|
+
const st = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, wt = /* @__PURE__ */ Ge({
|
|
14
15
|
__name: "gis-map",
|
|
15
16
|
props: {
|
|
16
17
|
config: {},
|
|
@@ -18,183 +19,189 @@ const tt = { class: "gis-viewer" }, at = { style: { position: "absolute", bottom
|
|
|
18
19
|
},
|
|
19
20
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
20
21
|
setup(M, { expose: _, emit: x }) {
|
|
21
|
-
const
|
|
22
|
-
let o, l, c, s, n, r, g, t, a;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const H =
|
|
26
|
-
|
|
27
|
-
if (!
|
|
22
|
+
const S = b(null);
|
|
23
|
+
let o, l, c, s, n, r, g, t, a, d;
|
|
24
|
+
const f = b(!1);
|
|
25
|
+
Ye();
|
|
26
|
+
const H = D.useAppDataStore, O = Qe([]);
|
|
27
|
+
je(async () => {
|
|
28
|
+
if (!S.value)
|
|
28
29
|
return;
|
|
29
30
|
document.addEventListener("keydown", (m) => {
|
|
30
|
-
m.ctrlKey && m.key === "i" && (
|
|
31
|
+
m.ctrlKey && m.key === "i" && (f.value = !f.value);
|
|
31
32
|
});
|
|
32
|
-
const e =
|
|
33
|
-
i.assetsRoot =
|
|
34
|
-
container:
|
|
33
|
+
const e = Ze(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(A.config)).json();
|
|
34
|
+
i.assetsRoot = A.assetsRoot || u, H.mapConfig = i, l = new at(), o = await l.initialize({
|
|
35
|
+
container: S.value,
|
|
35
36
|
mapConfig: i,
|
|
36
|
-
markerClickCallback: (m,
|
|
37
|
-
|
|
37
|
+
markerClickCallback: (m, y, w, Ee) => {
|
|
38
|
+
v("markerClick", m, y, w, Ee);
|
|
38
39
|
},
|
|
39
|
-
mapClickCallback: (m,
|
|
40
|
-
|
|
40
|
+
mapClickCallback: (m, y, w) => {
|
|
41
|
+
v("mapClick", m, y, w);
|
|
41
42
|
}
|
|
42
|
-
}), n = new
|
|
43
|
-
}),
|
|
43
|
+
}), n = new et(o, O), await n.init(), v("mapLoaded");
|
|
44
|
+
}), $e(() => {
|
|
44
45
|
a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(), s == null || s.disconnectTrafficFlow();
|
|
45
46
|
});
|
|
46
|
-
const V =
|
|
47
|
-
const e =
|
|
47
|
+
const V = qe(() => o), P = () => {
|
|
48
|
+
const e = D.useAppDataStore;
|
|
48
49
|
e.saveTrackLog = !0;
|
|
49
|
-
}, P = () => {
|
|
50
|
-
n.downloadTrackLog();
|
|
51
50
|
}, N = () => {
|
|
52
|
-
|
|
51
|
+
n.downloadTrackLog();
|
|
53
52
|
}, z = () => {
|
|
54
|
-
|
|
55
|
-
},
|
|
53
|
+
C("vehicleId");
|
|
54
|
+
}, W = () => {
|
|
55
|
+
C("plateNumber");
|
|
56
|
+
}, E = async (e) => await l.setMapCenter(e), G = async (e) => await l.setMapCamera(e), Q = async (e) => await l.lookAt(e), j = (e) => l.setLayerVisibility(e), Z = (e, u) => l.requestCoordinateTransform(e, u), $ = (e) => {
|
|
56
57
|
l.cancelCoordinateTransform(e);
|
|
57
|
-
},
|
|
58
|
+
}, q = (e) => {
|
|
58
59
|
l.setMapZoomRange(e);
|
|
59
|
-
},
|
|
60
|
+
}, K = (e) => (c || (c = new I(o)), c.showLaneNumber(e)), U = () => {
|
|
60
61
|
c == null || c.clearLaneNumber();
|
|
61
|
-
}, J = async (e) => (c || (c = new
|
|
62
|
-
},
|
|
63
|
-
s || (s = new
|
|
64
|
-
},
|
|
62
|
+
}, J = async (e) => (c || (c = new I(o)), await c.initializeSearch(e)), R = async () => c == null ? void 0 : c.calCrossIndicatorArea(), X = async () => {
|
|
63
|
+
}, Y = async (e, u) => {
|
|
64
|
+
s || (s = new rt(o)), s.connectTrafficFlow(e, u);
|
|
65
|
+
}, F = () => {
|
|
65
66
|
s == null || s.disconnectTrafficFlow();
|
|
66
|
-
},
|
|
67
|
+
}, ee = async (e) => {
|
|
67
68
|
n.handleVehicleTraceData(e);
|
|
68
|
-
},
|
|
69
|
+
}, te = () => {
|
|
69
70
|
n.clearHoloTrace();
|
|
70
|
-
},
|
|
71
|
+
}, ae = (e) => {
|
|
71
72
|
n.setInterpolate(e);
|
|
72
|
-
},
|
|
73
|
+
}, ne = async (e) => {
|
|
73
74
|
await n.handleSignalData(e);
|
|
74
|
-
},
|
|
75
|
+
}, re = () => {
|
|
75
76
|
n.clearHoloSignal();
|
|
76
|
-
}, re = (e) => {
|
|
77
|
-
s == null || s.toggleTrafficInfo(e), n == null || n.toggleTrafficInfo(e);
|
|
78
77
|
}, se = (e) => {
|
|
79
|
-
n == null || n.
|
|
78
|
+
s == null || s.toggleTrafficInfo(e), n == null || n.toggleTrafficInfo(e);
|
|
80
79
|
}, oe = (e) => {
|
|
80
|
+
n == null || n.togglePause(e);
|
|
81
|
+
}, ie = (e) => {
|
|
81
82
|
s == null || s.toggleTrafficObject(e), n == null || n.toggleTrafficObject(e);
|
|
82
|
-
},
|
|
83
|
+
}, C = (e) => {
|
|
83
84
|
n == null || n.updatePanelContent(e);
|
|
84
|
-
},
|
|
85
|
+
}, ce = async (e) => (r || (r = new T(o)), r.addOverlays(e)), le = (e) => (r || (r = new T(o)), r.addMask(e)), ue = () => {
|
|
85
86
|
r == null || r.removeMask();
|
|
86
|
-
},
|
|
87
|
+
}, me = (e) => r == null ? void 0 : r.removeOverlaysByType(e), ge = (e) => r == null ? void 0 : r.removeOverlaysById(e), pe = () => r == null ? void 0 : r.removeAllOverlays(), de = () => {
|
|
87
88
|
r == null || r.showAllOverlays();
|
|
88
|
-
},
|
|
89
|
-
g || (g = new
|
|
90
|
-
},
|
|
89
|
+
}, Se = (e) => {
|
|
90
|
+
g || (g = new nt(o)), g.updateQueueLength(e);
|
|
91
|
+
}, fe = () => {
|
|
91
92
|
g == null || g.removeQueueLength();
|
|
92
|
-
},
|
|
93
|
+
}, Ce = async (e, u) => (t || (t = new L(o)), await t.showOpenDriveFromServer(e, u)), ve = async (e) => (t || (t = new L(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ye = async () => await (t == null ? void 0 : t.clearOpenDrive()), we = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
93
94
|
status: -1,
|
|
94
95
|
message: "未加载OpenDrive地图"
|
|
95
|
-
},
|
|
96
|
+
}, he = async (e) => t ? t.selectSumo(e) : {
|
|
96
97
|
status: -1,
|
|
97
98
|
message: "未加载OpenDrive地图"
|
|
98
|
-
},
|
|
99
|
+
}, Oe = async (e) => t ? t.unselectSumo(e) : {
|
|
99
100
|
status: -1,
|
|
100
101
|
message: "未加载OpenDrive地图"
|
|
101
|
-
},
|
|
102
|
+
}, Ae = async (e) => t ? await t.geometrySearch(e) : {
|
|
102
103
|
status: -1,
|
|
103
104
|
message: "未加载OpenDrive地图"
|
|
104
105
|
}, be = async (e) => t ? await t.getSumoInfo(e) : {
|
|
105
106
|
status: -1,
|
|
106
107
|
message: "未加载OpenDrive地图"
|
|
107
|
-
},
|
|
108
|
+
}, ke = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
108
109
|
status: -1,
|
|
109
110
|
message: "未加载OpenDrive地图"
|
|
110
|
-
},
|
|
111
|
+
}, De = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
|
|
111
112
|
status: -1,
|
|
112
113
|
message: "未加载OpenDrive地图"
|
|
113
|
-
},
|
|
114
|
+
}, Le = (e) => (a || (a = new B(o)), a.showSignalControlArea(e)), Te = () => {
|
|
114
115
|
a == null || a.clearSignalControlArea();
|
|
115
|
-
},
|
|
116
|
+
}, Ie = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Be = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new B(o)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = () => a ? a.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Ve = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Ne = (e) => a ? a.changeSubSignalControlAreaBorderVisibility(
|
|
116
117
|
e
|
|
117
|
-
) : { status: -1, message: "未加载信号控制区" },
|
|
118
|
+
) : { status: -1, message: "未加载信号控制区" }, ze = (e) => (d || (d = new Fe(o)), d.addGreenWaveBand(e)), We = () => {
|
|
119
|
+
if (!d)
|
|
120
|
+
return { status: -1, message: "未加载绿波带" };
|
|
121
|
+
d.stopAddGreenWaveBand();
|
|
122
|
+
}, A = M, v = x;
|
|
118
123
|
return _({
|
|
119
124
|
mapViewer: V,
|
|
120
|
-
setLayerVisibility:
|
|
125
|
+
setLayerVisibility: j,
|
|
121
126
|
setMapCenter: E,
|
|
122
|
-
lookAt:
|
|
123
|
-
setMapCamera:
|
|
124
|
-
setMapZoomRange:
|
|
125
|
-
requestCoordinateTransform:
|
|
126
|
-
cancelCoordinateTransform:
|
|
127
|
-
addOverlays:
|
|
128
|
-
addMask:
|
|
129
|
-
removeMask:
|
|
130
|
-
showAllOverlays:
|
|
131
|
-
removeOverlaysByType:
|
|
132
|
-
removeOverlaysById:
|
|
133
|
-
removeAllOverlays:
|
|
134
|
-
showLaneNumber:
|
|
135
|
-
clearLaneNumber:
|
|
127
|
+
lookAt: Q,
|
|
128
|
+
setMapCamera: G,
|
|
129
|
+
setMapZoomRange: q,
|
|
130
|
+
requestCoordinateTransform: Z,
|
|
131
|
+
cancelCoordinateTransform: $,
|
|
132
|
+
addOverlays: ce,
|
|
133
|
+
addMask: le,
|
|
134
|
+
removeMask: ue,
|
|
135
|
+
showAllOverlays: de,
|
|
136
|
+
removeOverlaysByType: me,
|
|
137
|
+
removeOverlaysById: ge,
|
|
138
|
+
removeAllOverlays: pe,
|
|
139
|
+
showLaneNumber: K,
|
|
140
|
+
clearLaneNumber: U,
|
|
136
141
|
initializeAreaTool: J,
|
|
137
142
|
calCrossIndicatorArea: R,
|
|
138
|
-
calRoadIndicatorArea:
|
|
139
|
-
connectCarFlow:
|
|
140
|
-
disconnectCarFlow:
|
|
141
|
-
handleHoloVehicleTraceData:
|
|
142
|
-
clearHoloTrace:
|
|
143
|
-
handleHoloSignalData:
|
|
144
|
-
clearHoloSignal:
|
|
145
|
-
setInterpolate:
|
|
146
|
-
toggleTrafficInfo:
|
|
147
|
-
toggleTrafficObject:
|
|
148
|
-
toggleVehicleInfo:
|
|
149
|
-
togglePause:
|
|
150
|
-
updateQueueLength:
|
|
151
|
-
removeQueueLength:
|
|
152
|
-
showOpenDriveFromServer:
|
|
153
|
-
showOpenDriveFromFile:
|
|
154
|
-
clearOpenDrive:
|
|
155
|
-
geometrySearchInOpenDrive:
|
|
156
|
-
findSumoInOpenDrive:
|
|
157
|
-
selectSumoInOpenDrive:
|
|
158
|
-
unselectSumoInOpenDrive:
|
|
143
|
+
calRoadIndicatorArea: X,
|
|
144
|
+
connectCarFlow: Y,
|
|
145
|
+
disconnectCarFlow: F,
|
|
146
|
+
handleHoloVehicleTraceData: ee,
|
|
147
|
+
clearHoloTrace: te,
|
|
148
|
+
handleHoloSignalData: ne,
|
|
149
|
+
clearHoloSignal: re,
|
|
150
|
+
setInterpolate: ae,
|
|
151
|
+
toggleTrafficInfo: se,
|
|
152
|
+
toggleTrafficObject: ie,
|
|
153
|
+
toggleVehicleInfo: C,
|
|
154
|
+
togglePause: oe,
|
|
155
|
+
updateQueueLength: Se,
|
|
156
|
+
removeQueueLength: fe,
|
|
157
|
+
showOpenDriveFromServer: Ce,
|
|
158
|
+
showOpenDriveFromFile: ve,
|
|
159
|
+
clearOpenDrive: ye,
|
|
160
|
+
geometrySearchInOpenDrive: Ae,
|
|
161
|
+
findSumoInOpenDrive: we,
|
|
162
|
+
selectSumoInOpenDrive: he,
|
|
163
|
+
unselectSumoInOpenDrive: Oe,
|
|
159
164
|
getSumoInfo: be,
|
|
160
|
-
splitOpenDriveLane:
|
|
161
|
-
clearSplitOpenDriveLane:
|
|
162
|
-
showSignalControlArea:
|
|
163
|
-
clearSignalControlArea:
|
|
164
|
-
locateSignalControlArea:
|
|
165
|
-
highlightSignalControlArea:
|
|
165
|
+
splitOpenDriveLane: ke,
|
|
166
|
+
clearSplitOpenDriveLane: De,
|
|
167
|
+
showSignalControlArea: Le,
|
|
168
|
+
clearSignalControlArea: Te,
|
|
169
|
+
locateSignalControlArea: Ie,
|
|
170
|
+
highlightSignalControlArea: Be,
|
|
166
171
|
resetHighlightSignalControlArea: Me,
|
|
167
172
|
showSubSignalControlArea: _e,
|
|
168
173
|
editSubSignalControlArea: xe,
|
|
169
174
|
stopEditSubSignalControlArea: He,
|
|
170
175
|
selectSubSignalControlAreaCross: Ve,
|
|
171
|
-
unselectSubSignalControlAreaCross:
|
|
172
|
-
changeSubSignalControlAreaBorderVisibility:
|
|
173
|
-
|
|
176
|
+
unselectSubSignalControlAreaCross: Pe,
|
|
177
|
+
changeSubSignalControlAreaBorderVisibility: Ne,
|
|
178
|
+
addGreenWaveBand: ze,
|
|
179
|
+
stopAddGreenWaveBand: We
|
|
180
|
+
}), (e, u) => (h(), k("div", st, [
|
|
174
181
|
p("div", {
|
|
175
182
|
class: "gis-viewer-main",
|
|
176
183
|
ref_key: "mapContainer",
|
|
177
|
-
ref:
|
|
184
|
+
ref: S
|
|
178
185
|
}, [
|
|
179
|
-
|
|
186
|
+
Ke(p("div", ot, [
|
|
180
187
|
p("button", {
|
|
181
188
|
style: { "margin-right": "10px" },
|
|
182
|
-
onClick:
|
|
189
|
+
onClick: P
|
|
183
190
|
}, " 开始记录 "),
|
|
184
191
|
p("button", {
|
|
185
192
|
style: { "margin-right": "10px" },
|
|
186
|
-
onClick:
|
|
193
|
+
onClick: N
|
|
187
194
|
}, " 下载日志 "),
|
|
188
195
|
p("button", {
|
|
189
196
|
style: { "margin-right": "10px" },
|
|
190
|
-
onClick:
|
|
197
|
+
onClick: z
|
|
191
198
|
}, " 显示车辆id "),
|
|
192
|
-
p("button", { onClick:
|
|
199
|
+
p("button", { onClick: W }, "显示车辆号牌")
|
|
193
200
|
], 512), [
|
|
194
|
-
[
|
|
201
|
+
[Ue, f.value]
|
|
195
202
|
])
|
|
196
203
|
], 512),
|
|
197
|
-
(
|
|
204
|
+
(h(!0), k(Je, null, Re(O, (i, m) => (h(), Xe(tt, {
|
|
198
205
|
key: m,
|
|
199
206
|
"display-mode": i.displayMode,
|
|
200
207
|
"road-id": i.crossId,
|
|
@@ -210,5 +217,5 @@ const tt = { class: "gis-viewer" }, at = { style: { position: "absolute", bottom
|
|
|
210
217
|
}
|
|
211
218
|
});
|
|
212
219
|
export {
|
|
213
|
-
|
|
220
|
+
wt as default
|
|
214
221
|
};
|
|
@@ -18,6 +18,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
18
18
|
queueLength: import("./utils/queue-length").default;
|
|
19
19
|
openDriveRenderer: import("./utils/open-drive-renderer").default;
|
|
20
20
|
signalControlAreaController: import("./utils/signal-control-area-controller").default;
|
|
21
|
+
greenWaveBandController: import("./utils/green-wave-band-controller").default;
|
|
21
22
|
showLogDiv: import("vue").Ref<boolean>;
|
|
22
23
|
appDataStore: import("pinia").Store<"appData", {
|
|
23
24
|
mapConfig: {};
|
|
@@ -128,6 +129,11 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
128
129
|
status: number;
|
|
129
130
|
message: string;
|
|
130
131
|
};
|
|
132
|
+
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
133
|
+
stopAddGreenWaveBand: () => {
|
|
134
|
+
status: number;
|
|
135
|
+
message: string;
|
|
136
|
+
} | undefined;
|
|
131
137
|
props: any;
|
|
132
138
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
133
139
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
|
+
export default class GreenWaveBandController {
|
|
3
|
+
private view;
|
|
4
|
+
private allNodesLayer;
|
|
5
|
+
private viewClickWatcher?;
|
|
6
|
+
private openDriveServer;
|
|
7
|
+
private selectedNodeIds;
|
|
8
|
+
private addCrossCallback;
|
|
9
|
+
private removeCrossCallback;
|
|
10
|
+
private removeAllCrossCallback;
|
|
11
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
12
|
+
/**
|
|
13
|
+
* 新增绿波带
|
|
14
|
+
* @param params
|
|
15
|
+
*/
|
|
16
|
+
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
17
|
+
stopAddGreenWaveBand(): void;
|
|
18
|
+
/**
|
|
19
|
+
* 显示所有路口,进去待选状态
|
|
20
|
+
* @param nodeAttributes
|
|
21
|
+
*/
|
|
22
|
+
private showAllNodes;
|
|
23
|
+
/**
|
|
24
|
+
* 点击待选/已选路口
|
|
25
|
+
* @param event
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
private handleViewClick;
|
|
29
|
+
/**
|
|
30
|
+
* 显示下游节点
|
|
31
|
+
* @param nodeId
|
|
32
|
+
*/
|
|
33
|
+
private showDownstreamNodes;
|
|
34
|
+
private getSymbol;
|
|
35
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import d from "@arcgis/core/Graphic";
|
|
2
|
+
import c from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import n from "axios";
|
|
4
|
+
class u {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.selectedNodeIds = [], this.view = e, this.allNodesLayer = new c({
|
|
7
|
+
id: "allNodesLayer"
|
|
8
|
+
}), this.view.map.add(this.allNodesLayer);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 新增绿波带
|
|
12
|
+
* @param params
|
|
13
|
+
*/
|
|
14
|
+
addGreenWaveBand(e) {
|
|
15
|
+
this.addCrossCallback = e.addCrossCallback, this.removeCrossCallback = e.removeCrossCallback, e.removeAllCrossCallback && (this.removeAllCrossCallback = e.removeAllCrossCallback), this.selectedNodeIds = [], this.openDriveServer = e.odrServer, this.showAllNodes(e.crossesInArea), this.viewClickWatcher || (this.viewClickWatcher = this.view.on("click", (l) => {
|
|
16
|
+
this.handleViewClick(l);
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
stopAddGreenWaveBand() {
|
|
20
|
+
var e;
|
|
21
|
+
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0, this.allNodesLayer.removeAll(), this.selectedNodeIds = [];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 显示所有路口,进去待选状态
|
|
25
|
+
* @param nodeAttributes
|
|
26
|
+
*/
|
|
27
|
+
showAllNodes(e) {
|
|
28
|
+
const l = [];
|
|
29
|
+
e.forEach((o) => {
|
|
30
|
+
l.push(
|
|
31
|
+
new d({
|
|
32
|
+
geometry: {
|
|
33
|
+
type: "point",
|
|
34
|
+
x: o.longitude,
|
|
35
|
+
y: o.latitude
|
|
36
|
+
},
|
|
37
|
+
symbol: this.getSymbol(!1),
|
|
38
|
+
attributes: { ...o, selected: !1 }
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}), this.allNodesLayer.addMany(l);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 点击待选/已选路口
|
|
45
|
+
* @param event
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
async handleViewClick(e) {
|
|
49
|
+
var a;
|
|
50
|
+
const o = (a = (await this.view.hitTest(e, {
|
|
51
|
+
include: [this.allNodesLayer]
|
|
52
|
+
})).results) == null ? void 0 : a.filter(
|
|
53
|
+
(i) => i.type === "graphic"
|
|
54
|
+
);
|
|
55
|
+
if (o.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const r = o[0].graphic, s = r.getAttribute("id");
|
|
58
|
+
if (!this.selectedNodeIds.includes(s))
|
|
59
|
+
r.setAttribute("selected", !0), this.addCrossCallback && this.addCrossCallback({
|
|
60
|
+
id: s,
|
|
61
|
+
name: r.getAttribute("name")
|
|
62
|
+
}), r.symbol = this.getSymbol(!0), this.selectedNodeIds.push(s), this.allNodesLayer.graphics.forEach((i) => {
|
|
63
|
+
this.selectedNodeIds.length === 0 ? i !== r && (i.visible = !1) : i.getAttribute("selected") === !1 && (i.visible = !1);
|
|
64
|
+
}), await this.showDownstreamNodes(s);
|
|
65
|
+
else {
|
|
66
|
+
const i = this.selectedNodeIds.indexOf(s) + 1;
|
|
67
|
+
if (i === 1)
|
|
68
|
+
this.removeAllCrossCallback && this.removeAllCrossCallback(), this.selectedNodeIds = [], this.allNodesLayer.graphics.forEach((t) => {
|
|
69
|
+
t.setAttribute("selected", !1), t.symbol = this.getSymbol(!1), t.visible = !0;
|
|
70
|
+
});
|
|
71
|
+
else {
|
|
72
|
+
for (let t = i; t < this.selectedNodeIds.length; t++)
|
|
73
|
+
this.removeCrossCallback && this.removeCrossCallback({
|
|
74
|
+
id: this.selectedNodeIds[t]
|
|
75
|
+
});
|
|
76
|
+
this.selectedNodeIds = this.selectedNodeIds.slice(0, i), this.allNodesLayer.graphics.forEach((t) => {
|
|
77
|
+
this.selectedNodeIds.includes(t.getAttribute("id")) ? (t.setAttribute("selected", !0), t.symbol = this.getSymbol(!0)) : (t.setAttribute("selected", !1), t.symbol = this.getSymbol(!1), t.visible = !1);
|
|
78
|
+
}), await this.showDownstreamNodes(s);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
console.log(this.selectedNodeIds);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 显示下游节点
|
|
85
|
+
* @param nodeId
|
|
86
|
+
*/
|
|
87
|
+
async showDownstreamNodes(e) {
|
|
88
|
+
this.view.container.style.cursor = "progress";
|
|
89
|
+
const l = await n.get(
|
|
90
|
+
`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,
|
|
91
|
+
{ params: { nodeId: e } }
|
|
92
|
+
);
|
|
93
|
+
if (l.status !== 200 || l.data.status !== 0) {
|
|
94
|
+
this.view.container.style.cursor = "default";
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
l.data.result.forEach((r) => {
|
|
98
|
+
this.allNodesLayer.graphics.forEach((s) => {
|
|
99
|
+
s.getAttribute("nodeId") === r.id && s.getAttribute("selected") === !1 && (s.visible = !0);
|
|
100
|
+
});
|
|
101
|
+
}), this.view.container.style.cursor = "default";
|
|
102
|
+
}
|
|
103
|
+
getSymbol(e) {
|
|
104
|
+
return {
|
|
105
|
+
type: "cim",
|
|
106
|
+
data: {
|
|
107
|
+
type: "CIMSymbolReference",
|
|
108
|
+
primitiveOverrides: [
|
|
109
|
+
{
|
|
110
|
+
// 将textGraphic的TextString替换为graphic.attributes.name
|
|
111
|
+
type: "CIMPrimitiveOverride",
|
|
112
|
+
primitiveName: "textGraphic",
|
|
113
|
+
propertyName: "TextString",
|
|
114
|
+
valueExpressionInfo: {
|
|
115
|
+
type: "CIMExpressionInfo",
|
|
116
|
+
title: "Custom",
|
|
117
|
+
expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
|
|
118
|
+
returnType: "Default"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
symbol: {
|
|
123
|
+
type: "CIMPointSymbol",
|
|
124
|
+
symbolLayers: [
|
|
125
|
+
// 路口名称
|
|
126
|
+
{
|
|
127
|
+
type: "CIMVectorMarker",
|
|
128
|
+
size: 30,
|
|
129
|
+
colorLocked: !0,
|
|
130
|
+
anchorPointUnits: "Relative",
|
|
131
|
+
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
132
|
+
markerGraphics: [
|
|
133
|
+
{
|
|
134
|
+
type: "CIMMarkerGraphic",
|
|
135
|
+
primitiveName: "textGraphic",
|
|
136
|
+
geometry: { x: 0, y: 0 },
|
|
137
|
+
symbol: {
|
|
138
|
+
type: "CIMTextSymbol",
|
|
139
|
+
height: 12,
|
|
140
|
+
horizontalAlignment: "Center",
|
|
141
|
+
offsetX: 0,
|
|
142
|
+
offsetY: 20,
|
|
143
|
+
haloSize: 2,
|
|
144
|
+
haloSymbol: {
|
|
145
|
+
type: "CIMPolygonSymbol",
|
|
146
|
+
symbolLayers: [
|
|
147
|
+
{
|
|
148
|
+
type: "CIMSolidFill",
|
|
149
|
+
enable: !0,
|
|
150
|
+
color: [255, 255, 255, 255]
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
symbol: {
|
|
155
|
+
type: "CIMPolygonSymbol",
|
|
156
|
+
symbolLayers: [
|
|
157
|
+
{
|
|
158
|
+
type: "CIMSolidFill",
|
|
159
|
+
enable: !0,
|
|
160
|
+
color: [0, 0, 0, 255]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
verticalAlignment: "Center"
|
|
165
|
+
},
|
|
166
|
+
textString: ""
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
scaleSymbolsProportionally: !0,
|
|
170
|
+
respectFrame: !0
|
|
171
|
+
},
|
|
172
|
+
// 路口图标
|
|
173
|
+
{
|
|
174
|
+
type: "CIMPictureMarker",
|
|
175
|
+
enable: !0,
|
|
176
|
+
anchorPoint: {
|
|
177
|
+
x: 0,
|
|
178
|
+
y: 0
|
|
179
|
+
},
|
|
180
|
+
anchorPointUnits: "Relative",
|
|
181
|
+
size: 25,
|
|
182
|
+
rotateClockwise: !0,
|
|
183
|
+
textureFilter: "Picture",
|
|
184
|
+
url: `/GisViewerAssets/Images/cross/${e ? "gis_xhj_blue" : "gis_xhj_gray"}.png`
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
u as default
|
|
194
|
+
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
class
|
|
1
|
+
import r from "../common-utils.mjs";
|
|
2
|
+
class e {
|
|
3
3
|
constructor(t, i) {
|
|
4
4
|
this.parentName = "", this.crosses = [], this.subDistricts = [], this.crossCount = 0, this.subDistrictCount = 0, this.id = t.id, this.name = t.name, 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
|
-
const o = new
|
|
7
|
+
const o = new e(s, i);
|
|
8
8
|
o.parentName = this.name, this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
|
|
9
|
-
} else if (
|
|
9
|
+
} else if (r.isCoordinateValid(s)) {
|
|
10
10
|
const o = {
|
|
11
11
|
id: s.id,
|
|
12
12
|
name: s.name,
|
|
13
13
|
parentId: s.parentId,
|
|
14
14
|
latitude: Number(s.latitude),
|
|
15
15
|
longitude: Number(s.longitude),
|
|
16
|
-
signalId: s.
|
|
16
|
+
signalId: s.id,
|
|
17
|
+
nodeId: s.nodeId,
|
|
17
18
|
isKey: s.isKey === 1
|
|
18
19
|
};
|
|
19
20
|
this.crosses.push(o), this.crossCount++;
|
|
@@ -29,5 +30,5 @@ class r {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
e as default
|
|
33
34
|
};
|
|
@@ -6,7 +6,7 @@ export default class SignalControlAreaController {
|
|
|
6
6
|
private crossLayer;
|
|
7
7
|
private highlightLayer;
|
|
8
8
|
private scaleWatcher?;
|
|
9
|
-
private
|
|
9
|
+
private viewClickWatcher?;
|
|
10
10
|
private readonly crossScale;
|
|
11
11
|
private openDriveServer;
|
|
12
12
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as d 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
|
|
4
|
+
import p from "@turf/buffer";
|
|
5
5
|
import u 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 N {
|
|
12
12
|
constructor(e) {
|
|
13
13
|
var i;
|
|
14
14
|
this.crossScale = 5e3, this.crossIdsInDistrict = [], this.view = e;
|
|
@@ -48,7 +48,7 @@ class P {
|
|
|
48
48
|
);
|
|
49
49
|
this.drawArea(r, !0);
|
|
50
50
|
}
|
|
51
|
-
return this.scaleWatcher =
|
|
51
|
+
return this.scaleWatcher = d.watch(
|
|
52
52
|
() => this.view.scale,
|
|
53
53
|
(t, r) => {
|
|
54
54
|
t > this.crossScale && r <= this.crossScale ? (this.crossLayer.graphics.forEach((i) => {
|
|
@@ -77,7 +77,7 @@ class P {
|
|
|
77
77
|
}
|
|
78
78
|
clearSignalControlArea() {
|
|
79
79
|
var e, t;
|
|
80
|
-
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.
|
|
80
|
+
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" };
|
|
81
81
|
}
|
|
82
82
|
async locateSignalControlArea(e) {
|
|
83
83
|
const t = this.findAreaGraphic(e.id);
|
|
@@ -165,14 +165,14 @@ class P {
|
|
|
165
165
|
*/
|
|
166
166
|
async showNearbyCrosses(e) {
|
|
167
167
|
const t = await b.get(
|
|
168
|
-
`http://${this.openDriveServer}/api/computable/
|
|
169
|
-
{ params: {
|
|
168
|
+
`http://${this.openDriveServer}/api/computable/getRelatedNodesForNode`,
|
|
169
|
+
{ params: { nodeIds: e } }
|
|
170
170
|
);
|
|
171
171
|
if (t.status === 200)
|
|
172
172
|
if (t.data.status === 0) {
|
|
173
173
|
const r = t.data.result, i = [];
|
|
174
174
|
for (const s of r) {
|
|
175
|
-
const o = s.
|
|
175
|
+
const o = s.nodeId;
|
|
176
176
|
if (o.startsWith("-"))
|
|
177
177
|
continue;
|
|
178
178
|
if (s.signalId && !this.crossIdsInDistrict.includes(o)) {
|
|
@@ -213,7 +213,9 @@ class P {
|
|
|
213
213
|
if (e.odrServer) {
|
|
214
214
|
this.openDriveServer = e.odrServer, this.crossIdsInDistrict = e.crossesInArea.map((s) => s.id);
|
|
215
215
|
const t = a.featureCollection(
|
|
216
|
-
e.crossesInArea.map(
|
|
216
|
+
e.crossesInArea.map(
|
|
217
|
+
(s) => a.point([s.longitude, s.latitude])
|
|
218
|
+
)
|
|
217
219
|
), r = u(t);
|
|
218
220
|
r && (this.districtControllerLayer.removeAll(), this.districtControllerLayer.add(
|
|
219
221
|
new n({
|
|
@@ -231,7 +233,7 @@ class P {
|
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
235
|
})
|
|
234
|
-
)), this.addCrossCallback = e.addCrossCallback, this.removeCrossCallback = e.removeCrossCallback, this.
|
|
236
|
+
)), this.addCrossCallback = e.addCrossCallback, this.removeCrossCallback = e.removeCrossCallback, this.viewClickWatcher || (this.viewClickWatcher = this.view.on("click", async (s) => {
|
|
235
237
|
await this.handleViewClick(s);
|
|
236
238
|
}));
|
|
237
239
|
const i = this.crossLayer.graphics.toArray().map((s) => s.getAttribute("id")).join(",");
|
|
@@ -241,7 +243,7 @@ class P {
|
|
|
241
243
|
}
|
|
242
244
|
stopEditSubSignalControlArea() {
|
|
243
245
|
var t;
|
|
244
|
-
(t = this.
|
|
246
|
+
(t = this.viewClickWatcher) == null || t.remove(), this.viewClickWatcher = void 0;
|
|
245
247
|
const e = this.crossLayer.graphics.filter(
|
|
246
248
|
(r) => r.getAttribute("signalId") === "" || !r.getAttribute("signalId") || !r.getAttribute("selected")
|
|
247
249
|
);
|
|
@@ -313,7 +315,7 @@ class P {
|
|
|
313
315
|
}
|
|
314
316
|
s || (s = a.lineString(r));
|
|
315
317
|
}
|
|
316
|
-
const o =
|
|
318
|
+
const o = p(
|
|
317
319
|
s.geometry,
|
|
318
320
|
// 区控面积更大,需要更大的缓冲半径
|
|
319
321
|
t ? 200 : 30,
|
|
@@ -391,6 +393,7 @@ class P {
|
|
|
391
393
|
name: s.name,
|
|
392
394
|
color: e.areaColor,
|
|
393
395
|
signalId: s.signalId,
|
|
396
|
+
nodeId: s.nodeId,
|
|
394
397
|
districtId: t ? e.id : e.parentId,
|
|
395
398
|
districtName: t ? e.name : e.parentName,
|
|
396
399
|
subDistrictId: t ? "" : e.id,
|
|
@@ -418,13 +421,13 @@ class P {
|
|
|
418
421
|
fieldName: "subDistrictName",
|
|
419
422
|
label: "子区名称"
|
|
420
423
|
},
|
|
421
|
-
{
|
|
422
|
-
fieldName: "id",
|
|
423
|
-
label: "路口编号"
|
|
424
|
-
},
|
|
425
424
|
{
|
|
426
425
|
fieldName: "signalId",
|
|
427
426
|
label: "信号机编号"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
fieldName: "nodeId",
|
|
430
|
+
label: "路口编号"
|
|
428
431
|
}
|
|
429
432
|
]
|
|
430
433
|
}
|
|
@@ -645,5 +648,5 @@ class P {
|
|
|
645
648
|
}
|
|
646
649
|
}
|
|
647
650
|
export {
|
|
648
|
-
|
|
651
|
+
N as default
|
|
649
652
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -274,12 +274,15 @@ export interface IShowSignalControlAreaParams {
|
|
|
274
274
|
areaList: any[];
|
|
275
275
|
style?: string;
|
|
276
276
|
}
|
|
277
|
+
export interface INode {
|
|
278
|
+
id: string;
|
|
279
|
+
longitude: number;
|
|
280
|
+
latitude: number;
|
|
281
|
+
name: string;
|
|
282
|
+
signalId?: string;
|
|
283
|
+
}
|
|
277
284
|
export interface IEditSignalControlAreaParams {
|
|
278
|
-
crossesInArea:
|
|
279
|
-
id: string;
|
|
280
|
-
x: number;
|
|
281
|
-
y: number;
|
|
282
|
-
}[];
|
|
285
|
+
crossesInArea: INode[];
|
|
283
286
|
addCrossCallback: (params: {
|
|
284
287
|
id: string;
|
|
285
288
|
name: string;
|
|
@@ -287,5 +290,6 @@ export interface IEditSignalControlAreaParams {
|
|
|
287
290
|
removeCrossCallback: (params: {
|
|
288
291
|
id: string;
|
|
289
292
|
}) => void;
|
|
293
|
+
removeAllCrossCallback?: () => void;
|
|
290
294
|
odrServer: string;
|
|
291
295
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
3
|
import { IEditSignalControlAreaParams, IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, IShowSignalControlAreaParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
4
|
+
import GreenWaveBandController from './utils/green-wave-band-controller';
|
|
4
5
|
import HoloFlow from './utils/holo-flow';
|
|
5
6
|
import MapInitializer from './utils/map-initializer';
|
|
6
7
|
import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
@@ -29,6 +30,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
29
30
|
queueLength: QueueLength;
|
|
30
31
|
openDriveRenderer: OpenDriveRenderer;
|
|
31
32
|
signalControlAreaController: SignalControlAreaController;
|
|
33
|
+
greenWaveBandController: GreenWaveBandController;
|
|
32
34
|
showLogDiv: import("vue").Ref<boolean>;
|
|
33
35
|
appDataStore: import("pinia").Store<"appData", {
|
|
34
36
|
mapConfig: {};
|
|
@@ -139,6 +141,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
139
141
|
status: number;
|
|
140
142
|
message: string;
|
|
141
143
|
};
|
|
144
|
+
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
145
|
+
stopAddGreenWaveBand: () => {
|
|
146
|
+
status: number;
|
|
147
|
+
message: string;
|
|
148
|
+
} | undefined;
|
|
142
149
|
props: any;
|
|
143
150
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
144
151
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),h=require("./stores/index.js");require("./style/index.css");const He=require("./utils/green-wave-band-controller/index.js"),Pe=require("./utils/holo-flow/index.js"),ze=require("./utils/holo-flow/signal-countdown-panel.vue.js"),je=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),A=require("./utils/overlay.js"),We=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),D=require("./utils/signal-control-area-controller/index.js"),Ge=require("./utils/traffic-flow.js"),Qe={class:"gis-viewer"},Ze={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},Ke=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:_,emit:B}){const f=a.ref(null);let i,u,l,o,r,s,m,t,n,p;const S=a.ref(!1);h.registerStore();const x=h.default.useAppDataStore,b=a.reactive([]);a.onMounted(async()=>{if(!f.value)return;document.addEventListener("keydown",g=>{g.ctrlKey&&g.key==="i"&&(S.value=!S.value)});const e=a.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(k.config)).json();c.assetsRoot=k.assetsRoot||d,x.mapConfig=c,u=new je.default,i=await u.initialize({container:f.value,mapConfig:c,markerClickCallback:(g,w,C,Ee)=>{y("markerClick",g,w,C,Ee)},mapClickCallback:(g,w,C)=>{y("mapClick",g,w,C)}}),r=new Pe.default(i,b),await r.init(),y("mapLoaded")}),a.onUnmounted(()=>{n==null||n.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const I=a.computed(()=>i),q=()=>{const e=h.default.useAppDataStore;e.saveTrackLog=!0},V=()=>{r.downloadTrackLog()},M=()=>{v("vehicleId")},N=()=>{v("plateNumber")},E=async e=>await u.setMapCenter(e),H=async e=>await u.setMapCamera(e),P=async e=>await u.lookAt(e),z=e=>u.setLayerVisibility(e),j=(e,d)=>u.requestCoordinateTransform(e,d),W=e=>{u.cancelCoordinateTransform(e)},G=e=>{u.setMapZoomRange(e)},Q=e=>(l||(l=new L.default(i)),l.showLaneNumber(e)),Z=()=>{l==null||l.clearLaneNumber()},K=async e=>(l||(l=new L.default(i)),await l.initializeSearch(e)),U=async()=>l==null?void 0:l.calCrossIndicatorArea(),J=async()=>{},X=async(e,d)=>{o||(o=new Ge.default(i)),o.connectTrafficFlow(e,d)},Y=()=>{o==null||o.disconnectTrafficFlow()},F=async e=>{r.handleVehicleTraceData(e)},R=()=>{r.clearHoloTrace()},$=e=>{r.setInterpolate(e)},ee=async e=>{await r.handleSignalData(e)},te=()=>{r.clearHoloSignal()},ne=e=>{o==null||o.toggleTrafficInfo(e),r==null||r.toggleTrafficInfo(e)},ae=e=>{r==null||r.togglePause(e)},re=e=>{o==null||o.toggleTrafficObject(e),r==null||r.toggleTrafficObject(e)},v=e=>{r==null||r.updatePanelContent(e)},se=async e=>(s||(s=new A.default(i)),s.addOverlays(e)),oe=e=>(s||(s=new A.default(i)),s.addMask(e)),ie=()=>{s==null||s.removeMask()},ce=e=>s==null?void 0:s.removeOverlaysByType(e),le=e=>s==null?void 0:s.removeOverlaysById(e),ue=()=>s==null?void 0:s.removeAllOverlays(),de=()=>{s==null||s.showAllOverlays()},ge=e=>{m||(m=new We.default(i)),m.updateQueueLength(e)},me=()=>{m==null||m.removeQueueLength()},pe=async(e,d)=>(t||(t=new O.default(i)),await t.showOpenDriveFromServer(e,d)),fe=async e=>(t||(t=new O.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),Se=async()=>await(t==null?void 0:t.clearOpenDrive()),ve=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Ce=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},be=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},ke=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Oe=e=>(n||(n=new D.default(i)),n.showSignalControlArea(e)),Ae=()=>{n==null||n.clearSignalControlArea()},Le=async e=>n?await n.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},De=async e=>n?await n.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Te=()=>n?n.resetHighlight():{status:-1,message:"未加载信号控制区"},_e=e=>(n||(n=new D.default(i)),n.showSubSignalControlArea(e)),Be=e=>n?n.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},xe=()=>n?n.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ie=e=>n?n.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},qe=e=>n?n.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ve=e=>n?n.changeSubSignalControlAreaBorderVisibility(e):{status:-1,message:"未加载信号控制区"},Me=e=>(p||(p=new He.default(i)),p.addGreenWaveBand(e)),Ne=()=>{if(!p)return{status:-1,message:"未加载绿波带"};p.stopAddGreenWaveBand()},k=T,y=B;return _({mapViewer:I,setLayerVisibility:z,setMapCenter:E,lookAt:P,setMapCamera:H,setMapZoomRange:G,requestCoordinateTransform:j,cancelCoordinateTransform:W,addOverlays:se,addMask:oe,removeMask:ie,showAllOverlays:de,removeOverlaysByType:ce,removeOverlaysById:le,removeAllOverlays:ue,showLaneNumber:Q,clearLaneNumber:Z,initializeAreaTool:K,calCrossIndicatorArea:U,calRoadIndicatorArea:J,connectCarFlow:X,disconnectCarFlow:Y,handleHoloVehicleTraceData:F,clearHoloTrace:R,handleHoloSignalData:ee,clearHoloSignal:te,setInterpolate:$,toggleTrafficInfo:ne,toggleTrafficObject:re,toggleVehicleInfo:v,togglePause:ae,updateQueueLength:ge,removeQueueLength:me,showOpenDriveFromServer:pe,showOpenDriveFromFile:fe,clearOpenDrive:Se,geometrySearchInOpenDrive:Ce,findSumoInOpenDrive:ve,selectSumoInOpenDrive:ye,unselectSumoInOpenDrive:we,getSumoInfo:he,splitOpenDriveLane:be,clearSplitOpenDriveLane:ke,showSignalControlArea:Oe,clearSignalControlArea:Ae,locateSignalControlArea:Le,highlightSignalControlArea:De,resetHighlightSignalControlArea:Te,showSubSignalControlArea:_e,editSubSignalControlArea:Be,stopEditSubSignalControlArea:xe,selectSubSignalControlAreaCross:Ie,unselectSubSignalControlAreaCross:qe,changeSubSignalControlAreaBorderVisibility:Ve,addGreenWaveBand:Me,stopAddGreenWaveBand:Ne}),(e,d)=>(a.openBlock(),a.createElementBlock("div",Qe,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:f},[a.withDirectives(a.createElementVNode("div",Ze,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 开始记录 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:V}," 下载日志 "),a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 显示车辆id "),a.createElementVNode("button",{onClick:N},"显示车辆号牌")],512),[[a.vShow,S.value]])],512),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b,(c,g)=>(a.openBlock(),a.createBlock(ze.default,{key:g,"display-mode":c.displayMode,"road-id":c.crossId,"cross-id":c.roadId,"map-point":c.mapPoint,"stop-line":c.stopLine,position:c.position,rotation:c.rotation,scale:c.scale,"lamp-status":c.lampStatus},null,8,["display-mode","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=Ke;
|
|
@@ -18,6 +18,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
18
18
|
queueLength: import("./utils/queue-length").default;
|
|
19
19
|
openDriveRenderer: import("./utils/open-drive-renderer").default;
|
|
20
20
|
signalControlAreaController: import("./utils/signal-control-area-controller").default;
|
|
21
|
+
greenWaveBandController: import("./utils/green-wave-band-controller").default;
|
|
21
22
|
showLogDiv: import("vue").Ref<boolean>;
|
|
22
23
|
appDataStore: import("pinia").Store<"appData", {
|
|
23
24
|
mapConfig: {};
|
|
@@ -128,6 +129,11 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
128
129
|
status: number;
|
|
129
130
|
message: string;
|
|
130
131
|
};
|
|
132
|
+
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
133
|
+
stopAddGreenWaveBand: () => {
|
|
134
|
+
status: number;
|
|
135
|
+
message: string;
|
|
136
|
+
} | undefined;
|
|
131
137
|
props: any;
|
|
132
138
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
133
139
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
|
+
export default class GreenWaveBandController {
|
|
3
|
+
private view;
|
|
4
|
+
private allNodesLayer;
|
|
5
|
+
private viewClickWatcher?;
|
|
6
|
+
private openDriveServer;
|
|
7
|
+
private selectedNodeIds;
|
|
8
|
+
private addCrossCallback;
|
|
9
|
+
private removeCrossCallback;
|
|
10
|
+
private removeAllCrossCallback;
|
|
11
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
12
|
+
/**
|
|
13
|
+
* 新增绿波带
|
|
14
|
+
* @param params
|
|
15
|
+
*/
|
|
16
|
+
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
17
|
+
stopAddGreenWaveBand(): void;
|
|
18
|
+
/**
|
|
19
|
+
* 显示所有路口,进去待选状态
|
|
20
|
+
* @param nodeAttributes
|
|
21
|
+
*/
|
|
22
|
+
private showAllNodes;
|
|
23
|
+
/**
|
|
24
|
+
* 点击待选/已选路口
|
|
25
|
+
* @param event
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
private handleViewClick;
|
|
29
|
+
/**
|
|
30
|
+
* 显示下游节点
|
|
31
|
+
* @param nodeId
|
|
32
|
+
*/
|
|
33
|
+
private showDownstreamNodes;
|
|
34
|
+
private getSymbol;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/Graphic"),c=require("@arcgis/core/layers/GraphicsLayer"),n=require("axios");class h{constructor(e){this.selectedNodeIds=[],this.view=e,this.allNodesLayer=new c({id:"allNodesLayer"}),this.view.map.add(this.allNodesLayer)}addGreenWaveBand(e){this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,e.removeAllCrossCallback&&(this.removeAllCrossCallback=e.removeAllCrossCallback),this.selectedNodeIds=[],this.openDriveServer=e.odrServer,this.showAllNodes(e.crossesInArea),this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",l=>{this.handleViewClick(l)}))}stopAddGreenWaveBand(){var e;(e=this.viewClickWatcher)==null||e.remove(),this.viewClickWatcher=void 0,this.allNodesLayer.removeAll(),this.selectedNodeIds=[]}showAllNodes(e){const l=[];e.forEach(o=>{l.push(new d({geometry:{type:"point",x:o.longitude,y:o.latitude},symbol:this.getSymbol(!1),attributes:{...o,selected:!1}}))}),this.allNodesLayer.addMany(l)}async handleViewClick(e){var a;const o=(a=(await this.view.hitTest(e,{include:[this.allNodesLayer]})).results)==null?void 0:a.filter(i=>i.type==="graphic");if(o.length===0)return;const r=o[0].graphic,s=r.getAttribute("id");if(!this.selectedNodeIds.includes(s))r.setAttribute("selected",!0),this.addCrossCallback&&this.addCrossCallback({id:s,name:r.getAttribute("name")}),r.symbol=this.getSymbol(!0),this.selectedNodeIds.push(s),this.allNodesLayer.graphics.forEach(i=>{this.selectedNodeIds.length===0?i!==r&&(i.visible=!1):i.getAttribute("selected")===!1&&(i.visible=!1)}),await this.showDownstreamNodes(s);else{const i=this.selectedNodeIds.indexOf(s)+1;if(i===1)this.removeAllCrossCallback&&this.removeAllCrossCallback(),this.selectedNodeIds=[],this.allNodesLayer.graphics.forEach(t=>{t.setAttribute("selected",!1),t.symbol=this.getSymbol(!1),t.visible=!0});else{for(let t=i;t<this.selectedNodeIds.length;t++)this.removeCrossCallback&&this.removeCrossCallback({id:this.selectedNodeIds[t]});this.selectedNodeIds=this.selectedNodeIds.slice(0,i),this.allNodesLayer.graphics.forEach(t=>{this.selectedNodeIds.includes(t.getAttribute("id"))?(t.setAttribute("selected",!0),t.symbol=this.getSymbol(!0)):(t.setAttribute("selected",!1),t.symbol=this.getSymbol(!1),t.visible=!1)}),await this.showDownstreamNodes(s)}}console.log(this.selectedNodeIds)}async showDownstreamNodes(e){this.view.container.style.cursor="progress";const l=await n.get(`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,{params:{nodeId:e}});if(l.status!==200||l.data.status!==0){this.view.container.style.cursor="default";return}l.data.result.forEach(r=>{this.allNodesLayer.graphics.forEach(s=>{s.getAttribute("nodeId")===r.id&&s.getAttribute("selected")===!1&&(s.visible=!0)})}),this.view.container.style.cursor="default"}getSymbol(e){return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:30,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:2,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:25,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}}}exports.default=h;
|
|
@@ -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,i){this.parentName="",this.crosses=[],this.subDistricts=[],this.crossCount=0,this.subDistrictCount=0,this.id=t.id,this.name=t.name,this.parentId=t.parentId,this.areaColor=i==="alarm"?[255,0,0]:[61,139,249];for(const s of t.children)if(s.children){const e=new o(s,i);e.parentName=this.name,this.subDistricts.push(e),this.subDistrictCount++,this.crossCount+=e.crossCount}else if(r.default.isCoordinateValid(s)){const e={id:s.id,name:s.name,parentId:s.parentId,latitude:Number(s.latitude),longitude:Number(s.longitude),signalId:s.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../common-utils.js");class o{constructor(t,i){this.parentName="",this.crosses=[],this.subDistricts=[],this.crossCount=0,this.subDistrictCount=0,this.id=t.id,this.name=t.name,this.parentId=t.parentId,this.areaColor=i==="alarm"?[255,0,0]:[61,139,249];for(const s of t.children)if(s.children){const e=new o(s,i);e.parentName=this.name,this.subDistricts.push(e),this.subDistrictCount++,this.crossCount+=e.crossCount}else if(r.default.isCoordinateValid(s)){const e={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(e),this.crossCount++}}getAllCrossCoordinates(){const t=[];for(const i of this.crosses)t.push([i.longitude,i.latitude]);for(const i of this.subDistricts)t.push(...i.getAllCrossCoordinates());return t}}exports.default=o;
|
|
@@ -6,7 +6,7 @@ export default class SignalControlAreaController {
|
|
|
6
6
|
private crossLayer;
|
|
7
7
|
private highlightLayer;
|
|
8
8
|
private scaleWatcher?;
|
|
9
|
-
private
|
|
9
|
+
private viewClickWatcher?;
|
|
10
10
|
private readonly crossScale;
|
|
11
11
|
private openDriveServer;
|
|
12
12
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
@@ -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"),A=require("../../stores/index.js"),I=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 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=d(p),a=d(C);class w{constructor(e){var i;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;const r=A.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 I.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.clickWatcher)==null||t.remove(),this.clickWatcher=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}),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(t.length>0&&this.highlightLayer.addMany(t),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);else if(r.length>0){const s=r[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else i.length>1?await this.view.goTo(i):await this.view.goTo({target:i[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 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),{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({id:i.getAttribute("id"),name:i.getAttribute("name")}),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/getRelatedJunctionsForJunction`,{params:{junctionIds:e}});if(t.status===200)if(t.data.status===0){const r=t.data.result,i=[];for(const s of r){const o=s.junctionId;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.x,s.y]))),r=m(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.clickWatcher||(this.clickWatcher=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.clickWatcher)==null||t.remove(),this.clickWatcher=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(b=>a.point(b)));s=m(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:`${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 i=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,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:"id",label:"路口编号"},{fieldName:"signalId",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;
|
|
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"),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(p),a=m(C);class w{constructor(e){var i;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;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}):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}),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(t.length>0&&this.highlightLayer.addMany(t),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);else if(r.length>0){const s=r[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else i.length>1?await this.view.goTo(i):await this.view.goTo({target:i[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 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),{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({id:i.getAttribute("id"),name:i.getAttribute("name")}),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(b=>a.point(b)));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:`${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 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;
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -274,12 +274,15 @@ export interface IShowSignalControlAreaParams {
|
|
|
274
274
|
areaList: any[];
|
|
275
275
|
style?: string;
|
|
276
276
|
}
|
|
277
|
+
export interface INode {
|
|
278
|
+
id: string;
|
|
279
|
+
longitude: number;
|
|
280
|
+
latitude: number;
|
|
281
|
+
name: string;
|
|
282
|
+
signalId?: string;
|
|
283
|
+
}
|
|
277
284
|
export interface IEditSignalControlAreaParams {
|
|
278
|
-
crossesInArea:
|
|
279
|
-
id: string;
|
|
280
|
-
x: number;
|
|
281
|
-
y: number;
|
|
282
|
-
}[];
|
|
285
|
+
crossesInArea: INode[];
|
|
283
286
|
addCrossCallback: (params: {
|
|
284
287
|
id: string;
|
|
285
288
|
name: string;
|
|
@@ -287,5 +290,6 @@ export interface IEditSignalControlAreaParams {
|
|
|
287
290
|
removeCrossCallback: (params: {
|
|
288
291
|
id: string;
|
|
289
292
|
}) => void;
|
|
293
|
+
removeAllCrossCallback?: () => void;
|
|
290
294
|
odrServer: string;
|
|
291
295
|
}
|