gisviewer-vue3-arcgis 1.0.192 → 1.0.194
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 -121
- package/es/src/gis-map/index.d.ts +6 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +23 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +161 -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 +2 -1
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +41 -33
- package/es/src/types/index.d.ts +8 -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 +23 -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 +2 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +8 -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: {};
|
|
@@ -135,6 +137,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
135
137
|
};
|
|
136
138
|
selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
137
139
|
unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
140
|
+
changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
|
|
141
|
+
status: number;
|
|
142
|
+
message: string;
|
|
143
|
+
};
|
|
144
|
+
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
138
145
|
props: any;
|
|
139
146
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
140
147
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Qe, ref as A, reactive as je, onMounted as We, getCurrentInstance as Ge, onUnmounted as Ze, computed as $e, openBlock as h, createElementBlock as k, createElementVNode as p, withDirectives as qe, vShow as Ke, Fragment as Ue, renderList as Je, createBlock as Re } from "vue";
|
|
2
|
+
import D, { registerStore as Xe } 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 Ye from "./utils/green-wave-band-controller/index.mjs";
|
|
5
|
+
import Fe from "./utils/holo-flow/index.mjs";
|
|
6
|
+
import et from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
7
|
+
import tt from "./utils/map-initializer.mjs";
|
|
8
|
+
import L from "./utils/open-drive-renderer/index.mjs";
|
|
9
|
+
import T from "./utils/overlay.mjs";
|
|
10
|
+
import at 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 nt from "./utils/traffic-flow.mjs";
|
|
14
|
+
const rt = { class: "gis-viewer" }, ot = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, vt = /* @__PURE__ */ Qe({
|
|
14
15
|
__name: "gis-map",
|
|
15
16
|
props: {
|
|
16
17
|
config: {},
|
|
@@ -18,180 +19,184 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
|
|
|
18
19
|
},
|
|
19
20
|
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
20
21
|
setup(M, { expose: _, emit: x }) {
|
|
21
|
-
const d =
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const H =
|
|
26
|
-
|
|
22
|
+
const d = A(null);
|
|
23
|
+
let s, l, c, o, n, r, g, t, a, S;
|
|
24
|
+
const f = A(!1);
|
|
25
|
+
Xe();
|
|
26
|
+
const H = D.useAppDataStore, O = je([]);
|
|
27
|
+
We(async () => {
|
|
27
28
|
if (!d.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 =
|
|
33
|
+
const e = Ge(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(b.config)).json();
|
|
34
|
+
i.assetsRoot = b.assetsRoot || u, H.mapConfig = i, l = new tt(), s = await l.initialize({
|
|
34
35
|
container: d.value,
|
|
35
36
|
mapConfig: i,
|
|
36
|
-
markerClickCallback: (m,
|
|
37
|
-
y("markerClick", m,
|
|
37
|
+
markerClickCallback: (m, v, w, Ee) => {
|
|
38
|
+
y("markerClick", m, v, w, Ee);
|
|
38
39
|
},
|
|
39
|
-
mapClickCallback: (m,
|
|
40
|
-
y("mapClick", m,
|
|
40
|
+
mapClickCallback: (m, v, w) => {
|
|
41
|
+
y("mapClick", m, v, w);
|
|
41
42
|
}
|
|
42
|
-
}), n = new
|
|
43
|
-
}),
|
|
44
|
-
a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(),
|
|
43
|
+
}), n = new Fe(s, O), await n.init(), y("mapLoaded");
|
|
44
|
+
}), Ze(() => {
|
|
45
|
+
a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(), o == null || o.disconnectTrafficFlow();
|
|
45
46
|
});
|
|
46
|
-
const
|
|
47
|
-
const e =
|
|
47
|
+
const V = $e(() => s), P = () => {
|
|
48
|
+
const e = D.useAppDataStore;
|
|
48
49
|
e.saveTrackLog = !0;
|
|
49
|
-
}, B = () => {
|
|
50
|
-
n.downloadTrackLog();
|
|
51
50
|
}, N = () => {
|
|
52
|
-
|
|
51
|
+
n.downloadTrackLog();
|
|
53
52
|
}, z = () => {
|
|
54
|
-
|
|
55
|
-
}, E =
|
|
53
|
+
C("vehicleId");
|
|
54
|
+
}, E = () => {
|
|
55
|
+
C("plateNumber");
|
|
56
|
+
}, Q = async (e) => await l.setMapCenter(e), j = async (e) => await l.setMapCamera(e), W = async (e) => await l.lookAt(e), G = (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(s)), c.showLaneNumber(e)), U = () => {
|
|
60
61
|
c == null || c.clearLaneNumber();
|
|
61
|
-
}, J = async (e) => (c || (c = new
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
},
|
|
62
|
+
}, J = async (e) => (c || (c = new I(s)), await c.initializeSearch(e)), R = async () => c == null ? void 0 : c.calCrossIndicatorArea(), X = async () => {
|
|
63
|
+
}, Y = async (e, u) => {
|
|
64
|
+
o || (o = new nt(s)), o.connectTrafficFlow(e, u);
|
|
65
|
+
}, F = () => {
|
|
66
|
+
o == null || o.disconnectTrafficFlow();
|
|
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
|
-
},
|
|
77
|
-
|
|
77
|
+
}, oe = (e) => {
|
|
78
|
+
o == null || o.toggleTrafficInfo(e), n == null || n.toggleTrafficInfo(e);
|
|
78
79
|
}, se = (e) => {
|
|
79
80
|
n == null || n.togglePause(e);
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
},
|
|
81
|
+
}, ie = (e) => {
|
|
82
|
+
o == null || o.toggleTrafficObject(e), n == null || n.toggleTrafficObject(e);
|
|
83
|
+
}, C = (e) => {
|
|
83
84
|
n == null || n.updatePanelContent(e);
|
|
84
|
-
},
|
|
85
|
+
}, ce = async (e) => (r || (r = new T(s)), r.addOverlays(e)), le = (e) => (r || (r = new T(s)), 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
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
89
|
+
}, Se = (e) => {
|
|
90
|
+
g || (g = new at(s)), g.updateQueueLength(e);
|
|
91
|
+
}, fe = () => {
|
|
92
|
+
g == null || g.removeQueueLength();
|
|
93
|
+
}, Ce = async (e, u) => (t || (t = new L(s)), await t.showOpenDriveFromServer(e, u)), ye = async (e) => (t || (t = new L(s)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), ve = async () => await (t == null ? void 0 : t.clearOpenDrive()), we = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
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
|
+
}, be = async (e) => t ? await t.geometrySearch(e) : {
|
|
102
103
|
status: -1,
|
|
103
104
|
message: "未加载OpenDrive地图"
|
|
104
|
-
},
|
|
105
|
+
}, Ae = 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(s)), 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(s)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = () => a ? a.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Ve = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Ne = (e) => a ? a.changeSubSignalControlAreaBorderVisibility(
|
|
117
|
+
e
|
|
118
|
+
) : { status: -1, message: "未加载信号控制区" }, ze = (e) => (S || (S = new Ye(s)), S.addGreenWaveBand(e)), b = M, y = x;
|
|
116
119
|
return _({
|
|
117
|
-
mapViewer:
|
|
118
|
-
setLayerVisibility:
|
|
119
|
-
setMapCenter:
|
|
120
|
-
lookAt:
|
|
121
|
-
setMapCamera:
|
|
122
|
-
setMapZoomRange:
|
|
123
|
-
requestCoordinateTransform:
|
|
124
|
-
cancelCoordinateTransform:
|
|
125
|
-
addOverlays:
|
|
126
|
-
addMask:
|
|
127
|
-
removeMask:
|
|
128
|
-
showAllOverlays:
|
|
129
|
-
removeOverlaysByType:
|
|
130
|
-
removeOverlaysById:
|
|
120
|
+
mapViewer: V,
|
|
121
|
+
setLayerVisibility: G,
|
|
122
|
+
setMapCenter: Q,
|
|
123
|
+
lookAt: W,
|
|
124
|
+
setMapCamera: j,
|
|
125
|
+
setMapZoomRange: q,
|
|
126
|
+
requestCoordinateTransform: Z,
|
|
127
|
+
cancelCoordinateTransform: $,
|
|
128
|
+
addOverlays: ce,
|
|
129
|
+
addMask: le,
|
|
130
|
+
removeMask: ue,
|
|
131
|
+
showAllOverlays: de,
|
|
132
|
+
removeOverlaysByType: me,
|
|
133
|
+
removeOverlaysById: ge,
|
|
131
134
|
removeAllOverlays: pe,
|
|
132
|
-
showLaneNumber:
|
|
133
|
-
clearLaneNumber:
|
|
135
|
+
showLaneNumber: K,
|
|
136
|
+
clearLaneNumber: U,
|
|
134
137
|
initializeAreaTool: J,
|
|
135
138
|
calCrossIndicatorArea: R,
|
|
136
|
-
calRoadIndicatorArea:
|
|
137
|
-
connectCarFlow:
|
|
138
|
-
disconnectCarFlow:
|
|
139
|
-
handleHoloVehicleTraceData:
|
|
140
|
-
clearHoloTrace:
|
|
141
|
-
handleHoloSignalData:
|
|
142
|
-
clearHoloSignal:
|
|
143
|
-
setInterpolate:
|
|
144
|
-
toggleTrafficInfo:
|
|
145
|
-
toggleTrafficObject:
|
|
146
|
-
toggleVehicleInfo:
|
|
139
|
+
calRoadIndicatorArea: X,
|
|
140
|
+
connectCarFlow: Y,
|
|
141
|
+
disconnectCarFlow: F,
|
|
142
|
+
handleHoloVehicleTraceData: ee,
|
|
143
|
+
clearHoloTrace: te,
|
|
144
|
+
handleHoloSignalData: ne,
|
|
145
|
+
clearHoloSignal: re,
|
|
146
|
+
setInterpolate: ae,
|
|
147
|
+
toggleTrafficInfo: oe,
|
|
148
|
+
toggleTrafficObject: ie,
|
|
149
|
+
toggleVehicleInfo: C,
|
|
147
150
|
togglePause: se,
|
|
148
|
-
updateQueueLength:
|
|
149
|
-
removeQueueLength:
|
|
150
|
-
showOpenDriveFromServer:
|
|
151
|
+
updateQueueLength: Se,
|
|
152
|
+
removeQueueLength: fe,
|
|
153
|
+
showOpenDriveFromServer: Ce,
|
|
151
154
|
showOpenDriveFromFile: ye,
|
|
152
|
-
clearOpenDrive:
|
|
153
|
-
geometrySearchInOpenDrive:
|
|
155
|
+
clearOpenDrive: ve,
|
|
156
|
+
geometrySearchInOpenDrive: be,
|
|
154
157
|
findSumoInOpenDrive: we,
|
|
155
158
|
selectSumoInOpenDrive: he,
|
|
156
|
-
unselectSumoInOpenDrive:
|
|
157
|
-
getSumoInfo:
|
|
158
|
-
splitOpenDriveLane:
|
|
159
|
-
clearSplitOpenDriveLane:
|
|
160
|
-
showSignalControlArea:
|
|
161
|
-
clearSignalControlArea:
|
|
162
|
-
locateSignalControlArea:
|
|
163
|
-
highlightSignalControlArea:
|
|
159
|
+
unselectSumoInOpenDrive: Oe,
|
|
160
|
+
getSumoInfo: Ae,
|
|
161
|
+
splitOpenDriveLane: ke,
|
|
162
|
+
clearSplitOpenDriveLane: De,
|
|
163
|
+
showSignalControlArea: Le,
|
|
164
|
+
clearSignalControlArea: Te,
|
|
165
|
+
locateSignalControlArea: Ie,
|
|
166
|
+
highlightSignalControlArea: Be,
|
|
164
167
|
resetHighlightSignalControlArea: Me,
|
|
165
168
|
showSubSignalControlArea: _e,
|
|
166
169
|
editSubSignalControlArea: xe,
|
|
167
170
|
stopEditSubSignalControlArea: He,
|
|
168
|
-
selectSubSignalControlAreaCross:
|
|
169
|
-
unselectSubSignalControlAreaCross:
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
selectSubSignalControlAreaCross: Ve,
|
|
172
|
+
unselectSubSignalControlAreaCross: Pe,
|
|
173
|
+
changeSubSignalControlAreaBorderVisibility: Ne,
|
|
174
|
+
addGreenWaveBand: ze
|
|
175
|
+
}), (e, u) => (h(), k("div", rt, [
|
|
176
|
+
p("div", {
|
|
172
177
|
class: "gis-viewer-main",
|
|
173
178
|
ref_key: "mapContainer",
|
|
174
179
|
ref: d
|
|
175
180
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
qe(p("div", ot, [
|
|
182
|
+
p("button", {
|
|
178
183
|
style: { "margin-right": "10px" },
|
|
179
|
-
onClick:
|
|
184
|
+
onClick: P
|
|
180
185
|
}, " 开始记录 "),
|
|
181
|
-
|
|
186
|
+
p("button", {
|
|
182
187
|
style: { "margin-right": "10px" },
|
|
183
|
-
onClick:
|
|
188
|
+
onClick: N
|
|
184
189
|
}, " 下载日志 "),
|
|
185
|
-
|
|
190
|
+
p("button", {
|
|
186
191
|
style: { "margin-right": "10px" },
|
|
187
|
-
onClick:
|
|
192
|
+
onClick: z
|
|
188
193
|
}, " 显示车辆id "),
|
|
189
|
-
|
|
194
|
+
p("button", { onClick: E }, "显示车辆号牌")
|
|
190
195
|
], 512), [
|
|
191
|
-
[
|
|
196
|
+
[Ke, f.value]
|
|
192
197
|
])
|
|
193
198
|
], 512),
|
|
194
|
-
(h(!0),
|
|
199
|
+
(h(!0), k(Ue, null, Je(O, (i, m) => (h(), Re(et, {
|
|
195
200
|
key: m,
|
|
196
201
|
"display-mode": i.displayMode,
|
|
197
202
|
"road-id": i.crossId,
|
|
@@ -207,5 +212,5 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
|
|
|
207
212
|
}
|
|
208
213
|
});
|
|
209
214
|
export {
|
|
210
|
-
|
|
215
|
+
vt as default
|
|
211
216
|
};
|
|
@@ -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: {};
|
|
@@ -124,6 +125,11 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
124
125
|
};
|
|
125
126
|
selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
126
127
|
unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
128
|
+
changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
|
|
129
|
+
status: number;
|
|
130
|
+
message: string;
|
|
131
|
+
};
|
|
132
|
+
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
127
133
|
props: any;
|
|
128
134
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
129
135
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
|
+
export default class GreenWaveBandController {
|
|
3
|
+
private view;
|
|
4
|
+
private unSelectedNodesLayer;
|
|
5
|
+
private viewClickWatcher?;
|
|
6
|
+
private openDriveServer;
|
|
7
|
+
private selectedNodeIds;
|
|
8
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
9
|
+
/**
|
|
10
|
+
* 新增绿波带
|
|
11
|
+
* @param prams
|
|
12
|
+
*/
|
|
13
|
+
addGreenWaveBand(prams: IEditSignalControlAreaParams): void;
|
|
14
|
+
stopAddGreenWaveBand(): void;
|
|
15
|
+
private showAllNodes;
|
|
16
|
+
private handleViewClick;
|
|
17
|
+
/**
|
|
18
|
+
* 显示下游节点
|
|
19
|
+
* @param nodeId
|
|
20
|
+
*/
|
|
21
|
+
private showDownstreamNodes;
|
|
22
|
+
private getSymbol;
|
|
23
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import l from "@arcgis/core/Graphic";
|
|
2
|
+
import n from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import d from "axios";
|
|
4
|
+
class p {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.selectedNodeIds = [], this.view = e, this.unSelectedNodesLayer = new n({
|
|
7
|
+
id: "unSelectedNodesLayer"
|
|
8
|
+
}), this.view.map.addMany([this.unSelectedNodesLayer]);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 新增绿波带
|
|
12
|
+
* @param prams
|
|
13
|
+
*/
|
|
14
|
+
addGreenWaveBand(e) {
|
|
15
|
+
this.selectedNodeIds = [], this.openDriveServer = e.odrServer, this.showAllNodes(e.crossesInArea), this.viewClickWatcher || (this.viewClickWatcher = this.view.on("click", (t) => {
|
|
16
|
+
this.handleViewClick(t);
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
stopAddGreenWaveBand() {
|
|
20
|
+
var e;
|
|
21
|
+
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0;
|
|
22
|
+
}
|
|
23
|
+
showAllNodes(e) {
|
|
24
|
+
const t = [];
|
|
25
|
+
e.forEach((s) => {
|
|
26
|
+
t.push(
|
|
27
|
+
new l({
|
|
28
|
+
geometry: {
|
|
29
|
+
type: "point",
|
|
30
|
+
x: s.longitude,
|
|
31
|
+
y: s.latitude
|
|
32
|
+
},
|
|
33
|
+
symbol: this.getSymbol(!1),
|
|
34
|
+
attributes: { ...s, selected: !1 }
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
}), this.unSelectedNodesLayer.addMany(t);
|
|
38
|
+
}
|
|
39
|
+
async handleViewClick(e) {
|
|
40
|
+
var a;
|
|
41
|
+
const s = (a = (await this.view.hitTest(e, {
|
|
42
|
+
include: [this.unSelectedNodesLayer]
|
|
43
|
+
})).results) == null ? void 0 : a.filter(
|
|
44
|
+
(o) => o.type === "graphic"
|
|
45
|
+
);
|
|
46
|
+
if (s.length === 0)
|
|
47
|
+
return;
|
|
48
|
+
const i = s[0].graphic, r = i.getAttribute("id");
|
|
49
|
+
i.setAttribute("selected", !0), i.symbol = this.getSymbol(!0), this.selectedNodeIds.push(r), console.log(this.selectedNodeIds), this.unSelectedNodesLayer.graphics.forEach((o) => {
|
|
50
|
+
this.selectedNodeIds.length === 0 ? o !== i && (o.visible = !1) : o.getAttribute("selected") === !1 && (o.visible = !1);
|
|
51
|
+
}), await this.showDownstreamNodes(r);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 显示下游节点
|
|
55
|
+
* @param nodeId
|
|
56
|
+
*/
|
|
57
|
+
async showDownstreamNodes(e) {
|
|
58
|
+
const t = await d.get(
|
|
59
|
+
`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,
|
|
60
|
+
{ params: { nodeId: e } }
|
|
61
|
+
);
|
|
62
|
+
if (t.status !== 200 || t.data.status !== 0)
|
|
63
|
+
return;
|
|
64
|
+
console.log(t.data.result), t.data.result.forEach((i) => {
|
|
65
|
+
this.unSelectedNodesLayer.graphics.forEach((r) => {
|
|
66
|
+
r.getAttribute("nodeId") === i.id && r.getAttribute("selected") === !1 && (r.visible = !0);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
getSymbol(e) {
|
|
71
|
+
return {
|
|
72
|
+
type: "cim",
|
|
73
|
+
data: {
|
|
74
|
+
type: "CIMSymbolReference",
|
|
75
|
+
primitiveOverrides: [
|
|
76
|
+
{
|
|
77
|
+
// 将textGraphic的TextString替换为graphic.attributes.name
|
|
78
|
+
type: "CIMPrimitiveOverride",
|
|
79
|
+
primitiveName: "textGraphic",
|
|
80
|
+
propertyName: "TextString",
|
|
81
|
+
valueExpressionInfo: {
|
|
82
|
+
type: "CIMExpressionInfo",
|
|
83
|
+
title: "Custom",
|
|
84
|
+
expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
|
|
85
|
+
returnType: "Default"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
symbol: {
|
|
90
|
+
type: "CIMPointSymbol",
|
|
91
|
+
symbolLayers: [
|
|
92
|
+
// 路口名称
|
|
93
|
+
{
|
|
94
|
+
type: "CIMVectorMarker",
|
|
95
|
+
size: 30,
|
|
96
|
+
colorLocked: !0,
|
|
97
|
+
anchorPointUnits: "Relative",
|
|
98
|
+
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
99
|
+
markerGraphics: [
|
|
100
|
+
{
|
|
101
|
+
type: "CIMMarkerGraphic",
|
|
102
|
+
primitiveName: "textGraphic",
|
|
103
|
+
geometry: { x: 0, y: 0 },
|
|
104
|
+
symbol: {
|
|
105
|
+
type: "CIMTextSymbol",
|
|
106
|
+
height: 12,
|
|
107
|
+
horizontalAlignment: "Center",
|
|
108
|
+
offsetX: 0,
|
|
109
|
+
offsetY: 20,
|
|
110
|
+
haloSize: 2,
|
|
111
|
+
haloSymbol: {
|
|
112
|
+
type: "CIMPolygonSymbol",
|
|
113
|
+
symbolLayers: [
|
|
114
|
+
{
|
|
115
|
+
type: "CIMSolidFill",
|
|
116
|
+
enable: !0,
|
|
117
|
+
color: [255, 255, 255, 255]
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
symbol: {
|
|
122
|
+
type: "CIMPolygonSymbol",
|
|
123
|
+
symbolLayers: [
|
|
124
|
+
{
|
|
125
|
+
type: "CIMSolidFill",
|
|
126
|
+
enable: !0,
|
|
127
|
+
color: [0, 0, 0, 255]
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
verticalAlignment: "Center"
|
|
132
|
+
},
|
|
133
|
+
textString: ""
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
scaleSymbolsProportionally: !0,
|
|
137
|
+
respectFrame: !0
|
|
138
|
+
},
|
|
139
|
+
// 路口图标
|
|
140
|
+
{
|
|
141
|
+
type: "CIMPictureMarker",
|
|
142
|
+
enable: !0,
|
|
143
|
+
anchorPoint: {
|
|
144
|
+
x: 0,
|
|
145
|
+
y: 0
|
|
146
|
+
},
|
|
147
|
+
anchorPointUnits: "Relative",
|
|
148
|
+
size: 25,
|
|
149
|
+
rotateClockwise: !0,
|
|
150
|
+
textureFilter: "Picture",
|
|
151
|
+
url: `/GisViewerAssets/Images/cross/${e ? "gis_xhj_blue" : "gis_xhj_gray"}.png`
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
p as default
|
|
161
|
+
};
|
|
@@ -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);
|
|
@@ -56,6 +56,7 @@ export default class SignalControlAreaController {
|
|
|
56
56
|
* @param id
|
|
57
57
|
*/
|
|
58
58
|
unselectSubSignalControlAreaCross(id: string): IResult;
|
|
59
|
+
changeSubSignalControlAreaBorderVisibility(visible: boolean): void;
|
|
59
60
|
/**
|
|
60
61
|
* 在区控\子区\路口图层中查找对应的graphic
|
|
61
62
|
* @param id
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as d from "@arcgis/core/core/reactiveUtils.js";
|
|
2
2
|
import n from "@arcgis/core/Graphic";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import y from "@arcgis/core/layers/GraphicsLayer";
|
|
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;
|
|
15
15
|
const r = C.useAppDataStore.mapConfig;
|
|
16
|
-
this.openDriveServer = (i = r.openDriveServer) == null ? void 0 : i.url, this.districtControllerLayer = new
|
|
16
|
+
this.openDriveServer = (i = r.openDriveServer) == null ? void 0 : i.url, this.districtControllerLayer = new y({
|
|
17
17
|
id: "districtControllerLayer"
|
|
18
|
-
}), this.subDistrictControllerLayer = new
|
|
18
|
+
}), this.subDistrictControllerLayer = new y({
|
|
19
19
|
id: "subDistrictControllerLayer",
|
|
20
20
|
visible: !1
|
|
21
21
|
// maxScale: 0,
|
|
22
22
|
// minScale: 144447
|
|
23
|
-
}), this.crossLayer = new
|
|
23
|
+
}), this.crossLayer = new y({
|
|
24
24
|
id: "crossLayer",
|
|
25
25
|
visible: !1
|
|
26
26
|
// maxScale: 0,
|
|
27
27
|
// minScale: 36112
|
|
28
|
-
}), this.highlightLayer = new
|
|
28
|
+
}), this.highlightLayer = new y({
|
|
29
29
|
id: "highlightLayer"
|
|
30
30
|
}), this.view.map.addMany([
|
|
31
31
|
this.districtControllerLayer,
|
|
@@ -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)) {
|
|
@@ -180,10 +180,10 @@ class P {
|
|
|
180
180
|
continue;
|
|
181
181
|
}
|
|
182
182
|
if (this.crossLayer.graphics.some(
|
|
183
|
-
(
|
|
183
|
+
(c) => c.getAttribute("id") === o
|
|
184
184
|
))
|
|
185
185
|
continue;
|
|
186
|
-
const
|
|
186
|
+
const g = new n({
|
|
187
187
|
geometry: {
|
|
188
188
|
type: "point",
|
|
189
189
|
x: s.lon,
|
|
@@ -197,7 +197,7 @@ class P {
|
|
|
197
197
|
selected: !1
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
|
-
i.push(
|
|
200
|
+
i.push(g);
|
|
201
201
|
}
|
|
202
202
|
return this.crossLayer.addMany(i), { status: 0, message: "ok" };
|
|
203
203
|
} else
|
|
@@ -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
|
);
|
|
@@ -271,6 +273,11 @@ class P {
|
|
|
271
273
|
), { status: 0, message: "ok" };
|
|
272
274
|
}), { status: 0, message: "未找到" };
|
|
273
275
|
}
|
|
276
|
+
changeSubSignalControlAreaBorderVisibility(e) {
|
|
277
|
+
this.highlightLayer.graphics.forEach((t) => {
|
|
278
|
+
t.getAttribute("type") === "signalControlArea" && (t.visible = e);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
274
281
|
/**
|
|
275
282
|
* 在区控\子区\路口图层中查找对应的graphic
|
|
276
283
|
* @param id
|
|
@@ -298,17 +305,17 @@ class P {
|
|
|
298
305
|
s = a.lineString(r);
|
|
299
306
|
else {
|
|
300
307
|
if (t) {
|
|
301
|
-
const
|
|
308
|
+
const h = a.featureCollection(
|
|
302
309
|
r.map((m) => a.point(m))
|
|
303
310
|
);
|
|
304
|
-
s = u(
|
|
311
|
+
s = u(h);
|
|
305
312
|
} else {
|
|
306
|
-
const
|
|
307
|
-
|
|
313
|
+
const h = f(r, 0.5);
|
|
314
|
+
h.length >= 4 && (s = a.polygon([h]));
|
|
308
315
|
}
|
|
309
316
|
s || (s = a.lineString(r));
|
|
310
317
|
}
|
|
311
|
-
const o =
|
|
318
|
+
const o = p(
|
|
312
319
|
s.geometry,
|
|
313
320
|
// 区控面积更大,需要更大的缓冲半径
|
|
314
321
|
t ? 200 : 30,
|
|
@@ -340,7 +347,7 @@ class P {
|
|
|
340
347
|
label: "路口数量"
|
|
341
348
|
}
|
|
342
349
|
];
|
|
343
|
-
const
|
|
350
|
+
const g = {
|
|
344
351
|
type: "signalControlArea",
|
|
345
352
|
id: e.id,
|
|
346
353
|
name: e.name,
|
|
@@ -348,7 +355,7 @@ class P {
|
|
|
348
355
|
parentName: e.parentName,
|
|
349
356
|
crossCount: e.crossCount,
|
|
350
357
|
subDistrictCount: e.subDistrictCount
|
|
351
|
-
},
|
|
358
|
+
}, c = new n({
|
|
352
359
|
geometry: {
|
|
353
360
|
type: "polygon",
|
|
354
361
|
rings: o.geometry.coordinates
|
|
@@ -363,7 +370,7 @@ class P {
|
|
|
363
370
|
style: t ? "long-dash" : "solid"
|
|
364
371
|
}
|
|
365
372
|
},
|
|
366
|
-
attributes:
|
|
373
|
+
attributes: g,
|
|
367
374
|
popupTemplate: {
|
|
368
375
|
title: `${t ? "区控" : "子区"} ${e.name}`,
|
|
369
376
|
content: [
|
|
@@ -374,7 +381,7 @@ class P {
|
|
|
374
381
|
]
|
|
375
382
|
}
|
|
376
383
|
});
|
|
377
|
-
t
|
|
384
|
+
t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
|
|
378
385
|
}
|
|
379
386
|
for (const s of e.subDistricts)
|
|
380
387
|
this.drawArea(s, !1);
|
|
@@ -386,6 +393,7 @@ class P {
|
|
|
386
393
|
name: s.name,
|
|
387
394
|
color: e.areaColor,
|
|
388
395
|
signalId: s.signalId,
|
|
396
|
+
nodeId: s.nodeId,
|
|
389
397
|
districtId: t ? e.id : e.parentId,
|
|
390
398
|
districtName: t ? e.name : e.parentName,
|
|
391
399
|
subDistrictId: t ? "" : e.id,
|
|
@@ -413,13 +421,13 @@ class P {
|
|
|
413
421
|
fieldName: "subDistrictName",
|
|
414
422
|
label: "子区名称"
|
|
415
423
|
},
|
|
416
|
-
{
|
|
417
|
-
fieldName: "id",
|
|
418
|
-
label: "路口编号"
|
|
419
|
-
},
|
|
420
424
|
{
|
|
421
425
|
fieldName: "signalId",
|
|
422
426
|
label: "信号机编号"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
fieldName: "nodeId",
|
|
430
|
+
label: "路口编号"
|
|
423
431
|
}
|
|
424
432
|
]
|
|
425
433
|
}
|
|
@@ -640,5 +648,5 @@ class P {
|
|
|
640
648
|
}
|
|
641
649
|
}
|
|
642
650
|
export {
|
|
643
|
-
|
|
651
|
+
N as default
|
|
644
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;
|
|
@@ -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: {};
|
|
@@ -135,6 +137,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
135
137
|
};
|
|
136
138
|
selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
137
139
|
unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
140
|
+
changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
|
|
141
|
+
status: number;
|
|
142
|
+
message: string;
|
|
143
|
+
};
|
|
144
|
+
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
138
145
|
props: any;
|
|
139
146
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
140
147
|
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 Ee=require("./utils/green-wave-band-controller/index.js"),He=require("./utils/holo-flow/index.js"),Pe=require("./utils/holo-flow/signal-countdown-panel.vue.js"),ze=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),A=require("./utils/overlay.js"),je=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),D=require("./utils/signal-control-area-controller/index.js"),Qe=require("./utils/traffic-flow.js"),We={class:"gis-viewer"},Ge={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},Ze=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:_,emit:x}){const p=a.ref(null);let i,u,l,o,r,s,m,t,n,f;const S=a.ref(!1);h.registerStore();const I=h.default.useAppDataStore,b=a.reactive([]);a.onMounted(async()=>{if(!p.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,I.mapConfig=c,u=new ze.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(g,w,C,Ne)=>{v("markerClick",g,w,C,Ne)},mapClickCallback:(g,w,C)=>{v("mapClick",g,w,C)}}),r=new He.default(i,b),await r.init(),v("mapLoaded")}),a.onUnmounted(()=>{n==null||n.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const q=a.computed(()=>i),B=()=>{const e=h.default.useAppDataStore;e.saveTrackLog=!0},V=()=>{r.downloadTrackLog()},M=()=>{y("vehicleId")},N=()=>{y("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),Q=e=>{u.cancelCoordinateTransform(e)},W=e=>{u.setMapZoomRange(e)},G=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 Qe.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)},y=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 je.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()),ye=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ve=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)),xe=e=>n?n.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ie=()=>n?n.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},qe=e=>n?n.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Be=e=>n?n.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ve=e=>n?n.changeSubSignalControlAreaBorderVisibility(e):{status:-1,message:"未加载信号控制区"},Me=e=>(f||(f=new Ee.default(i)),f.addGreenWaveBand(e)),k=T,v=x;return _({mapViewer:q,setLayerVisibility:z,setMapCenter:E,lookAt:P,setMapCamera:H,setMapZoomRange:W,requestCoordinateTransform:j,cancelCoordinateTransform:Q,addOverlays:se,addMask:oe,removeMask:ie,showAllOverlays:de,removeOverlaysByType:ce,removeOverlaysById:le,removeAllOverlays:ue,showLaneNumber:G,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:y,togglePause:ae,updateQueueLength:ge,removeQueueLength:me,showOpenDriveFromServer:pe,showOpenDriveFromFile:fe,clearOpenDrive:Se,geometrySearchInOpenDrive:Ce,findSumoInOpenDrive:ye,selectSumoInOpenDrive:ve,unselectSumoInOpenDrive:we,getSumoInfo:he,splitOpenDriveLane:be,clearSplitOpenDriveLane:ke,showSignalControlArea:Oe,clearSignalControlArea:Ae,locateSignalControlArea:Le,highlightSignalControlArea:De,resetHighlightSignalControlArea:Te,showSubSignalControlArea:_e,editSubSignalControlArea:xe,stopEditSubSignalControlArea:Ie,selectSubSignalControlAreaCross:qe,unselectSubSignalControlAreaCross:Be,changeSubSignalControlAreaBorderVisibility:Ve,addGreenWaveBand:Me}),(e,d)=>(a.openBlock(),a.createElementBlock("div",We,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[a.withDirectives(a.createElementVNode("div",Ge,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:B}," 开始记录 "),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(Pe.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=Ze;
|
|
@@ -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: {};
|
|
@@ -124,6 +125,11 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
124
125
|
};
|
|
125
126
|
selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
126
127
|
unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
|
|
128
|
+
changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
|
|
129
|
+
status: number;
|
|
130
|
+
message: string;
|
|
131
|
+
};
|
|
132
|
+
addGreenWaveBand: (params: import("../types").IEditSignalControlAreaParams) => void;
|
|
127
133
|
props: any;
|
|
128
134
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
129
135
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IEditSignalControlAreaParams } from '../../../types';
|
|
2
|
+
export default class GreenWaveBandController {
|
|
3
|
+
private view;
|
|
4
|
+
private unSelectedNodesLayer;
|
|
5
|
+
private viewClickWatcher?;
|
|
6
|
+
private openDriveServer;
|
|
7
|
+
private selectedNodeIds;
|
|
8
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
9
|
+
/**
|
|
10
|
+
* 新增绿波带
|
|
11
|
+
* @param prams
|
|
12
|
+
*/
|
|
13
|
+
addGreenWaveBand(prams: IEditSignalControlAreaParams): void;
|
|
14
|
+
stopAddGreenWaveBand(): void;
|
|
15
|
+
private showAllNodes;
|
|
16
|
+
private handleViewClick;
|
|
17
|
+
/**
|
|
18
|
+
* 显示下游节点
|
|
19
|
+
* @param nodeId
|
|
20
|
+
*/
|
|
21
|
+
private showDownstreamNodes;
|
|
22
|
+
private getSymbol;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@arcgis/core/Graphic"),n=require("@arcgis/core/layers/GraphicsLayer"),c=require("axios");class d{constructor(e){this.selectedNodeIds=[],this.view=e,this.unSelectedNodesLayer=new n({id:"unSelectedNodesLayer"}),this.view.map.addMany([this.unSelectedNodesLayer])}addGreenWaveBand(e){this.selectedNodeIds=[],this.openDriveServer=e.odrServer,this.showAllNodes(e.crossesInArea),this.viewClickWatcher||(this.viewClickWatcher=this.view.on("click",t=>{this.handleViewClick(t)}))}stopAddGreenWaveBand(){var e;(e=this.viewClickWatcher)==null||e.remove(),this.viewClickWatcher=void 0}showAllNodes(e){const t=[];e.forEach(s=>{t.push(new l({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getSymbol(!1),attributes:{...s,selected:!1}}))}),this.unSelectedNodesLayer.addMany(t)}async handleViewClick(e){var a;const s=(a=(await this.view.hitTest(e,{include:[this.unSelectedNodesLayer]})).results)==null?void 0:a.filter(o=>o.type==="graphic");if(s.length===0)return;const i=s[0].graphic,r=i.getAttribute("id");i.setAttribute("selected",!0),i.symbol=this.getSymbol(!0),this.selectedNodeIds.push(r),console.log(this.selectedNodeIds),this.unSelectedNodesLayer.graphics.forEach(o=>{this.selectedNodeIds.length===0?o!==i&&(o.visible=!1):o.getAttribute("selected")===!1&&(o.visible=!1)}),await this.showDownstreamNodes(r)}async showDownstreamNodes(e){const t=await c.get(`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,{params:{nodeId:e}});if(t.status!==200||t.data.status!==0)return;console.log(t.data.result),t.data.result.forEach(i=>{this.unSelectedNodesLayer.graphics.forEach(r=>{r.getAttribute("nodeId")===i.id&&r.getAttribute("selected")===!1&&(r.visible=!0)})})}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=d;
|
|
@@ -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);
|
|
@@ -56,6 +56,7 @@ export default class SignalControlAreaController {
|
|
|
56
56
|
* @param id
|
|
57
57
|
*/
|
|
58
58
|
unselectSubSignalControlAreaCross(id: string): IResult;
|
|
59
|
+
changeSubSignalControlAreaBorderVisibility(visible: boolean): void;
|
|
59
60
|
/**
|
|
60
61
|
* 在区控\子区\路口图层中查找对应的graphic
|
|
61
62
|
* @param id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),m=require("@turf/convex"),C=require("@turf/helpers"),v=require("axios"),S=require("concaveman"),I=require("../../stores/index.js"),A=require("./district-controller.js");function d(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const L=d(b),a=d(C);class w{constructor(e){var r;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;const i=I.default.useAppDataStore.mapConfig;this.openDriveServer=(r=i.openDriveServer)==null?void 0:r.url,this.districtControllerLayer=new u({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new u({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new u({id:"crossLayer",visible:!1}),this.highlightLayer=new u({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1,this.districtControllerLayer.visible=!0;for(const t of e.areaList){const i=new A.default(t,e.style||"");this.drawArea(i,!0)}return this.scaleWatcher=L.watch(()=>this.view.scale,(t,i)=>{t>this.crossScale&&i<=this.crossScale?(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker"))})):t<=this.crossScale&&i>this.crossScale&&(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e,t;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.scaleWatcher)==null||e.remove(),this.scaleWatcher=void 0,(t=this.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}),i=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),r=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());if(t.length>0&&this.highlightLayer.addMany(t),i.length>0&&this.highlightLayer.addMany(i),r.length>0&&this.highlightLayer.addMany(r),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(i.length>0){const s=i[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else r.length>1?await this.view.goTo(r):await this.view.goTo({target:r[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){this.crossLayer.removeAll(),this.crossLayer.visible=!0;const i=e.children.map(r=>{const s={...r,selected:!0};return new c({geometry:{type:"point",x:r.longitude,y:r.latitude},symbol:this.getCrossSymbolInSubDistrict(s),attributes:s})});return this.crossLayer.addMany(i),this.view.goTo(i),{status:0,message:"ok"}}async handleViewClick(e){var s;const i=(s=(await this.view.hitTest(e,{include:[this.crossLayer]})).results)==null?void 0:s.filter(o=>o.type==="graphic");if(i.length===0)return;const r=i[0].graphic;r.getAttribute("selected")?r.getAttribute("signalId")&&(this.removeCrossCallback&&this.removeCrossCallback({id:r.getAttribute("id")}),r.setAttribute("selected",!1),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)):(r.getAttribute("signalId")&&(this.addCrossCallback&&this.addCrossCallback({id:r.getAttribute("id"),name:r.getAttribute("name")}),r.setAttribute("selected",!0),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)),await this.showNearbyCrosses(r.getAttribute("id")))}async showNearbyCrosses(e){const t=await v.get(`http://${this.openDriveServer}/api/computable/getRelatedJunctionsForJunction`,{params:{junctionIds:e}});if(t.status===200)if(t.data.status===0){const i=t.data.result,r=[];for(const s of i){const o=s.junctionId;if(o.startsWith("-"))continue;if(s.signalId&&!this.crossIdsInDistrict.includes(o)){console.log("不是此区控内的路口",o);continue}if(this.crossLayer.graphics.some(g=>g.getAttribute("id")===o))continue;const y=new c({geometry:{type:"point",x:s.lon,y:s.lat},symbol:this.getCrossSymbolInSubDistrict(s),attributes:{id:o,name:s.name,signalId:s.signalId,selected:!1}});r.push(y)}return this.crossLayer.addMany(r),{status:0,message:"ok"}}else return{status:-1,message:t.data.message};else return{status:-1,message:"请求失败"}}async editSubSignalControlArea(e){if(e.odrServer){this.openDriveServer=e.odrServer,this.crossIdsInDistrict=e.crossesInArea.map(s=>s.id);const t=a.featureCollection(e.crossesInArea.map(s=>a.point([s.x,s.y]))),i=m(t);i&&(this.districtControllerLayer.removeAll(),this.districtControllerLayer.add(new c({geometry:{type:"polygon",rings:i.geometry.coordinates},symbol:{type:"simple-fill",style:"none",outline:{color:[61,139,249],width:3,style:"long-dash"}}}))),this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,this.clickWatcher||(this.clickWatcher=this.view.on("click",async s=>{await this.handleViewClick(s)}));const r=this.crossLayer.graphics.toArray().map(s=>s.getAttribute("id")).join(",");return await this.showNearbyCrosses(r)}else return{status:1,message:"未配置OpenDriveServer"}}stopEditSubSignalControlArea(){var t;(t=this.clickWatcher)==null||t.remove(),this.clickWatcher=void 0;const e=this.crossLayer.graphics.filter(i=>i.getAttribute("signalId")===""||!i.getAttribute("signalId")||!i.getAttribute("selected"));this.crossLayer.removeMany(e.toArray())}selectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&!t.getAttribute("selected"))return t.setAttribute("selected",!0),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}unselectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&t.getAttribute("selected"))return t.setAttribute("selected",!1),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(i=>i.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(i=>i.attributes.id===e)),t||(t=this.crossLayer.graphics.find(i=>i.attributes.id===e)),t}drawArea(e,t){const i=e.getAllCrossCoordinates();if(i.length>=2){let s=null;if(i.length===2)s=a.lineString(i);else{if(t){const h=a.featureCollection(i.map(p=>a.point(p)));s=m(h)}else{const h=S(i,.5);h.length>=4&&(s=a.polygon([h]))}s||(s=a.lineString(i))}const o=f(s.geometry,t?200:30,{units:"meters"});let n;t?n=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:n=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const y={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},g=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:y,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:n}]}});t&&this.districtControllerLayer.add(g)}for(const s of e.subDistricts)this.drawArea(s,!1);const r=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,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:"信号机编号"}]}]}});r.push(n)}),this.crossLayer.addMany(r)}getCrossSymbolInSubDistrict(e){return e.signalId&&e.signalId!==""?{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e.selected?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_lkcz.png",width:"20px",height:"20px"}}getCrossGraphicSymbol(e,t){const{isKey:i,color:r}=e;if(t==="marker")return i?{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:r,size:8,outline:{color:"white",width:1}};if(t==="picture")return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:i?30:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:i?40:20,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${i?"gis_gjxklk_orange":"gis_xhj_blue"}.png`}]}}}}}exports.default=w;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const 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;
|