gisviewer-vue3-arcgis 1.0.222 → 1.0.224
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 +34 -0
- package/es/src/gis-map/gis-map.vue.mjs +110 -103
- package/es/src/gis-map/index.d.ts +34 -0
- package/es/src/gis-map/style/index.css +13 -1
- package/es/src/gis-map/utils/holo-flow/index.d.ts +3 -1
- package/es/src/gis-map/utils/holo-flow/index.mjs +33 -16
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +31 -0
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +98 -64
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +17 -3
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +222 -123
- package/es/src/gis-map/utils/sketchView.d.ts +1 -0
- package/es/src/gis-map/utils/sketchView.mjs +3 -0
- package/es/src/types/index.d.ts +1 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +34 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +34 -0
- package/lib/src/gis-map/style/index.css +13 -1
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +3 -1
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +31 -0
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +17 -3
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/lib/src/gis-map/utils/sketchView.d.ts +1 -0
- package/lib/src/gis-map/utils/sketchView.js +1 -1
- package/lib/src/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,155 +1,254 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Point as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
class
|
|
7
|
-
constructor(e,
|
|
8
|
-
var
|
|
9
|
-
super(e), this.stopLineLayer = new
|
|
1
|
+
import * as g from "@arcgis/core/core/reactiveUtils";
|
|
2
|
+
import { Point as d } from "@arcgis/core/geometry";
|
|
3
|
+
import * as u from "@arcgis/core/geometry/support/webMercatorUtils.js";
|
|
4
|
+
import w from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
import P from "./signal-holo-flow.mjs";
|
|
6
|
+
class M extends P {
|
|
7
|
+
constructor(e, s) {
|
|
8
|
+
var l, i;
|
|
9
|
+
super(e), this.stopLineLayer = new w(), this.watchHandle = null, this.trajectoryDelayTime = 2, this.stopLineMap = /* @__PURE__ */ new Map(), this.lampGroupMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = s, this.view.map.add(this.stopLineLayer), this.trajectoryDelayTime = ((i = (l = this.mapConfig.holoFlow) == null ? void 0 : l.signal) == null ? void 0 : i.delay) || 2;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* 读取停止线图层,将灯组面板沿着停止线放置
|
|
13
13
|
* @returns
|
|
14
14
|
*/
|
|
15
15
|
async initializeLayer() {
|
|
16
|
-
var
|
|
16
|
+
var i, t;
|
|
17
|
+
if (this.stopLineMap.size > 0)
|
|
18
|
+
return;
|
|
17
19
|
console.time("初始化停止线图层");
|
|
18
|
-
let e = (
|
|
20
|
+
let e = (t = (i = this.mapConfig.holoFlow) == null ? void 0 : i.signal) == null ? void 0 : t.stopLineLayer;
|
|
19
21
|
if (!e)
|
|
20
22
|
return;
|
|
21
23
|
e = this.mapConfig.assetsRoot + "/" + e;
|
|
22
|
-
const
|
|
23
|
-
for (const n of
|
|
24
|
-
const { roadId:
|
|
25
|
-
let { destinationPoint:
|
|
26
|
-
const { coordinates:
|
|
27
|
-
if (
|
|
28
|
-
if (typeof
|
|
24
|
+
const l = await (await fetch(e)).json();
|
|
25
|
+
for (const n of l.features) {
|
|
26
|
+
const { roadId: a } = n.properties;
|
|
27
|
+
let { destinationPoint: o } = n.properties;
|
|
28
|
+
const { coordinates: r } = n.geometry;
|
|
29
|
+
if (o) {
|
|
30
|
+
if (typeof o == "string")
|
|
29
31
|
try {
|
|
30
|
-
|
|
31
|
-
} catch (
|
|
32
|
-
console.error("解析面板基准点失败",
|
|
32
|
+
o = JSON.parse(o);
|
|
33
|
+
} catch (c) {
|
|
34
|
+
console.error("解析面板基准点失败", c);
|
|
33
35
|
continue;
|
|
34
36
|
}
|
|
35
37
|
} else {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
const c = r[0], h = r[r.length - 1], p = (c[0] + h[0]) / 2, f = (c[1] + h[1]) / 2;
|
|
39
|
+
o = [p, f];
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}) : this.stopLineMap.set(
|
|
44
|
-
o,
|
|
45
|
-
/* @__PURE__ */ new Map([
|
|
46
|
-
[r, { coord: i, panelPoint: s }]
|
|
47
|
-
])
|
|
48
|
-
);
|
|
41
|
+
this.stopLineMap.set(a, {
|
|
42
|
+
coord: r,
|
|
43
|
+
panelPoint: o
|
|
44
|
+
});
|
|
49
45
|
}
|
|
50
46
|
console.timeEnd("初始化停止线图层");
|
|
51
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* 初始化灯组与进口道的关联关系
|
|
50
|
+
*/
|
|
51
|
+
initializeLampGroup(e) {
|
|
52
|
+
const { sigId: s, lampGroupList: l } = e, i = [];
|
|
53
|
+
l.forEach((t) => {
|
|
54
|
+
const { lampGroupNo: n, lampGroupType: a, crossFlowList: o, pedList: r } = t;
|
|
55
|
+
o.length > 0 && o.forEach((c) => {
|
|
56
|
+
const h = c.upSectionId;
|
|
57
|
+
let p = "s";
|
|
58
|
+
switch (c.turn) {
|
|
59
|
+
case 1:
|
|
60
|
+
p = "s";
|
|
61
|
+
break;
|
|
62
|
+
case 2:
|
|
63
|
+
p = "l";
|
|
64
|
+
break;
|
|
65
|
+
case 4:
|
|
66
|
+
p = "r";
|
|
67
|
+
break;
|
|
68
|
+
case 8:
|
|
69
|
+
p = "u";
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
a === 81 && (p = "bl"), i.push({
|
|
73
|
+
lampGroupId: n,
|
|
74
|
+
roadId: h,
|
|
75
|
+
dir: p
|
|
76
|
+
});
|
|
77
|
+
}), r.length > 0;
|
|
78
|
+
}), this.lampGroupMap.set(s, i);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 处理统一信控平台信号灯数据
|
|
82
|
+
* @param data
|
|
83
|
+
*/
|
|
84
|
+
handleUniSignalData(e) {
|
|
85
|
+
this.watchHandle || (this.watchHandle = g.watch(
|
|
86
|
+
() => this.view.extent,
|
|
87
|
+
() => this.updatePanelPosition()
|
|
88
|
+
));
|
|
89
|
+
const { sigId: s, runningStatus: l } = e.data.basicInfo, i = this.lampGroupMap.get(s);
|
|
90
|
+
if (!i)
|
|
91
|
+
return { status: -1, message: "灯组未初始化" };
|
|
92
|
+
const t = /* @__PURE__ */ new Map();
|
|
93
|
+
let n = !1;
|
|
94
|
+
switch (String(l)) {
|
|
95
|
+
case "4": {
|
|
96
|
+
n = !0, i.forEach((a) => {
|
|
97
|
+
const { roadId: o, dir: r } = a;
|
|
98
|
+
t.set(o, {
|
|
99
|
+
...t.get(o) || {},
|
|
100
|
+
[`${r}Number`]: "",
|
|
101
|
+
[`${r}Color`]: "yellow"
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "5": {
|
|
107
|
+
i.forEach((a) => {
|
|
108
|
+
const { roadId: o, dir: r } = a;
|
|
109
|
+
t.set(o, {
|
|
110
|
+
...t.get(o) || {},
|
|
111
|
+
[`${r}Number`]: "",
|
|
112
|
+
[`${r}Color`]: "red"
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case "6":
|
|
118
|
+
case "9": {
|
|
119
|
+
i.forEach((a) => {
|
|
120
|
+
const { roadId: o, dir: r } = a;
|
|
121
|
+
t.set(o, {
|
|
122
|
+
...t.get(o) || {},
|
|
123
|
+
[`${r}Number`]: "",
|
|
124
|
+
[`${r}Color`]: "off"
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
default: {
|
|
130
|
+
const { curSigColorInfo: a } = e.data;
|
|
131
|
+
a.forEach((o) => {
|
|
132
|
+
const r = String(o.lamgroupId), { color: c, leftTime: h } = o, p = i.find(
|
|
133
|
+
(f) => f.lampGroupId === r
|
|
134
|
+
);
|
|
135
|
+
if (p) {
|
|
136
|
+
const { roadId: f, dir: m } = p;
|
|
137
|
+
t.set(f, {
|
|
138
|
+
...t.get(f) || {},
|
|
139
|
+
[`${m}Number`]: h,
|
|
140
|
+
[`${m}Color`]: c === 1 ? "red" : c === 2 ? "yellow" : "green"
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return this.updateLampGroupPanelStatus(s, t, n), { status: 0, message: "ok" };
|
|
147
|
+
}
|
|
52
148
|
/**
|
|
53
149
|
* 根据地图比例尺计算灯组面板缩放比例
|
|
54
150
|
*/
|
|
55
151
|
getPanelScale() {
|
|
56
152
|
const e = this.view.scale;
|
|
57
|
-
let
|
|
58
|
-
return e < 1e3 ?
|
|
153
|
+
let s = 1;
|
|
154
|
+
return e < 1e3 ? s = 1 : e < 2e3 ? s = 0.8 : e < 4e3 ? s = 0.4 : s = 0, s;
|
|
59
155
|
}
|
|
60
156
|
/**
|
|
61
157
|
* 地图移动时更新灯组面板位置
|
|
62
158
|
*/
|
|
63
159
|
updatePanelPosition() {
|
|
64
160
|
const e = this.getPanelScale();
|
|
65
|
-
for (const
|
|
66
|
-
e !== this.currentPanelScale && (
|
|
67
|
-
const { mapPoint:
|
|
68
|
-
let
|
|
69
|
-
x:
|
|
70
|
-
y:
|
|
161
|
+
for (const s of this.countdownPanelProps) {
|
|
162
|
+
e !== this.currentPanelScale && (s.scale = e);
|
|
163
|
+
const { mapPoint: l } = s;
|
|
164
|
+
let i = new d({
|
|
165
|
+
x: l[0],
|
|
166
|
+
y: l[1]
|
|
71
167
|
});
|
|
72
|
-
this.view.spatialReference.isWebMercator && (
|
|
73
|
-
|
|
168
|
+
this.view.spatialReference.isWebMercator && (i = u.geographicToWebMercator(
|
|
169
|
+
i
|
|
74
170
|
));
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
const n = this.getPanelRotation(
|
|
78
|
-
|
|
171
|
+
const t = this.view.toScreen(i);
|
|
172
|
+
if (s.position.left = t.x, s.position.top = t.y, this.view.type === "3d") {
|
|
173
|
+
const n = this.getPanelRotation(s.stopLine);
|
|
174
|
+
s.rotation = n;
|
|
79
175
|
}
|
|
80
176
|
}
|
|
81
177
|
this.currentPanelScale = e;
|
|
82
178
|
}
|
|
179
|
+
doHoloSignalData(e) {
|
|
180
|
+
const s = e.crossId, l = e.phaseCountDownList, i = /* @__PURE__ */ new Map();
|
|
181
|
+
for (const t of l) {
|
|
182
|
+
let n = "";
|
|
183
|
+
for (let c of t.roadIdList)
|
|
184
|
+
if (c.startsWith("-") && (c = c.slice(1)), this.stopLineMap.has(c)) {
|
|
185
|
+
n = c;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
if (!n) {
|
|
189
|
+
console.log(`没有找到对应的进口道${s}--${n}`);
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
let a = i.get(n);
|
|
193
|
+
if (a || (a = {}, i.set(n, a)), !t.direction)
|
|
194
|
+
continue;
|
|
195
|
+
const o = t.direction.toLowerCase(), r = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
|
|
196
|
+
o === "u" ? (a.uNumber = t.leftTime, a.uColor = r) : o === "l" ? (a.lNumber = t.leftTime, a.lColor = r) : o === "s" ? (a.sNumber = t.leftTime, a.sColor = r) : o === "r" && (a.rNumber = t.leftTime, a.rColor = r);
|
|
197
|
+
}
|
|
198
|
+
this.updateLampGroupPanelStatus(s, i);
|
|
199
|
+
}
|
|
200
|
+
updateLampGroupPanelStatus(e, s, l = !1) {
|
|
201
|
+
s.forEach((i, t) => {
|
|
202
|
+
const n = this.stopLineMap.get(t);
|
|
203
|
+
if (!n)
|
|
204
|
+
return;
|
|
205
|
+
const a = this.countdownPanelProps.find(
|
|
206
|
+
(o) => o.roadId === t
|
|
207
|
+
);
|
|
208
|
+
if (a)
|
|
209
|
+
a.lampStatus = i, a.flash = l;
|
|
210
|
+
else {
|
|
211
|
+
let o = new d({
|
|
212
|
+
x: n.panelPoint[0],
|
|
213
|
+
y: n.panelPoint[1]
|
|
214
|
+
});
|
|
215
|
+
this.view.spatialReference.isWebMercator && (o = u.geographicToWebMercator(
|
|
216
|
+
o
|
|
217
|
+
));
|
|
218
|
+
const r = this.view.toScreen(o), c = this.getPanelRotation(n.coord);
|
|
219
|
+
this.countdownPanelProps.push({
|
|
220
|
+
displayMode: "complex",
|
|
221
|
+
flash: l,
|
|
222
|
+
crossId: e,
|
|
223
|
+
roadId: t,
|
|
224
|
+
mapPoint: n.panelPoint,
|
|
225
|
+
// 定位点地理坐标
|
|
226
|
+
stopLine: n.coord,
|
|
227
|
+
// 关联的停止线坐标
|
|
228
|
+
position: { left: r.x, top: r.y },
|
|
229
|
+
// 定位点屏幕坐标
|
|
230
|
+
rotation: c,
|
|
231
|
+
// 面板旋转角度
|
|
232
|
+
scale: this.getPanelScale(),
|
|
233
|
+
lampStatus: i
|
|
234
|
+
// 灯组状态
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
83
239
|
/**
|
|
84
240
|
* 处理全息流信号灯数据
|
|
85
241
|
* @param data
|
|
86
242
|
* @returns
|
|
87
243
|
*/
|
|
88
244
|
async handleHoloSignalData(e) {
|
|
89
|
-
this.watchHandle || (this.watchHandle =
|
|
245
|
+
this.watchHandle || (this.watchHandle = g.watch(
|
|
90
246
|
() => this.view.extent,
|
|
91
247
|
() => this.updatePanelPosition()
|
|
92
|
-
)),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const l = e.phaseCountDownList, c = /* @__PURE__ */ new Map();
|
|
99
|
-
for (const n of l) {
|
|
100
|
-
let r = "";
|
|
101
|
-
for (let p of n.roadIdList)
|
|
102
|
-
if (p.startsWith("-") && (p = p.slice(1)), a.has(p)) {
|
|
103
|
-
r = p;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
if (!r) {
|
|
107
|
-
console.log(`没有找到对应的进口道${t}--${r}`);
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
let o = c.get(r);
|
|
111
|
-
if (o || (o = {}, c.set(r, o)), !n.direction)
|
|
112
|
-
continue;
|
|
113
|
-
const s = n.direction.toLowerCase(), i = n.color === 1 ? "red" : n.color === 2 ? "yellow" : "green";
|
|
114
|
-
s === "u" ? (o.uNumber = n.leftTime, o.uColor = i) : s === "l" ? (o.lNumber = n.leftTime, o.lColor = i) : s === "s" ? (o.sNumber = n.leftTime, o.sColor = i) : s === "r" && (o.rNumber = n.leftTime, o.rColor = i);
|
|
115
|
-
}
|
|
116
|
-
c.forEach((n, r) => {
|
|
117
|
-
const o = a.get(r);
|
|
118
|
-
if (!o)
|
|
119
|
-
return;
|
|
120
|
-
const s = this.countdownPanelProps.find(
|
|
121
|
-
(i) => i.crossId === t && i.roadId === r
|
|
122
|
-
);
|
|
123
|
-
if (s)
|
|
124
|
-
s.lampStatus = n;
|
|
125
|
-
else {
|
|
126
|
-
let i = new f({
|
|
127
|
-
x: o.panelPoint[0],
|
|
128
|
-
y: o.panelPoint[1]
|
|
129
|
-
});
|
|
130
|
-
this.view.spatialReference.isWebMercator && (i = d.geographicToWebMercator(
|
|
131
|
-
i
|
|
132
|
-
));
|
|
133
|
-
const p = this.view.toScreen(i), h = this.getPanelRotation(o.coord);
|
|
134
|
-
this.countdownPanelProps.push({
|
|
135
|
-
displayMode: "complex",
|
|
136
|
-
crossId: t,
|
|
137
|
-
roadId: r,
|
|
138
|
-
mapPoint: o.panelPoint,
|
|
139
|
-
// 定位点地理坐标
|
|
140
|
-
stopLine: o.coord,
|
|
141
|
-
// 关联的停止线坐标
|
|
142
|
-
position: { left: p.x, top: p.y },
|
|
143
|
-
// 定位点屏幕坐标
|
|
144
|
-
rotation: h,
|
|
145
|
-
// 面板旋转角度
|
|
146
|
-
scale: this.getPanelScale(),
|
|
147
|
-
lampStatus: n
|
|
148
|
-
// 灯组状态
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}, this.trajectoryDelayTime * 1e3);
|
|
248
|
+
)), this.trajectoryDelayTime === 0 ? this.doHoloSignalData(e) : setTimeout(
|
|
249
|
+
() => this.doHoloSignalData(e),
|
|
250
|
+
this.trajectoryDelayTime * 1e3
|
|
251
|
+
);
|
|
153
252
|
}
|
|
154
253
|
clearSignal() {
|
|
155
254
|
var e;
|
|
@@ -161,26 +260,26 @@ class b extends y {
|
|
|
161
260
|
* @returns
|
|
162
261
|
*/
|
|
163
262
|
getPanelRotation(e) {
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
x:
|
|
167
|
-
y:
|
|
263
|
+
const s = e[0];
|
|
264
|
+
let l = new d({
|
|
265
|
+
x: s[0],
|
|
266
|
+
y: s[1]
|
|
168
267
|
});
|
|
169
|
-
this.view.spatialReference.isWebMercator && (
|
|
170
|
-
|
|
268
|
+
this.view.spatialReference.isWebMercator && (l = u.geographicToWebMercator(
|
|
269
|
+
l
|
|
171
270
|
));
|
|
172
|
-
const
|
|
173
|
-
let n = new
|
|
174
|
-
x:
|
|
175
|
-
y:
|
|
271
|
+
const i = this.view.toScreen(l), t = e[e.length - 1];
|
|
272
|
+
let n = new d({
|
|
273
|
+
x: t[0],
|
|
274
|
+
y: t[1]
|
|
176
275
|
});
|
|
177
|
-
this.view.spatialReference.isWebMercator && (n =
|
|
276
|
+
this.view.spatialReference.isWebMercator && (n = u.geographicToWebMercator(
|
|
178
277
|
n
|
|
179
278
|
));
|
|
180
|
-
const
|
|
181
|
-
return Math.atan2(
|
|
279
|
+
const a = this.view.toScreen(n), o = a.x - i.x, r = a.y - i.y;
|
|
280
|
+
return Math.atan2(r, o) * (180 / Math.PI);
|
|
182
281
|
}
|
|
183
282
|
}
|
|
184
283
|
export {
|
|
185
|
-
|
|
284
|
+
M as default
|
|
186
285
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
41
41
|
countdownPanels: ISignalCountdownProps[];
|
|
42
42
|
}, {}, {}>;
|
|
43
43
|
countdownPanelProps: {
|
|
44
|
+
flash: boolean;
|
|
44
45
|
displayMode: string;
|
|
45
46
|
crossId: string;
|
|
46
47
|
roadId: string;
|
|
@@ -92,6 +93,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
92
93
|
clearHoloTrace: () => void;
|
|
93
94
|
setInterpolate: (enable: boolean) => void;
|
|
94
95
|
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
96
|
+
initializeLampGroup: (data: any) => Promise<void>;
|
|
97
|
+
handleUniSignalData: (signalData: any) => void;
|
|
95
98
|
clearHoloSignal: () => void;
|
|
96
99
|
toggleTrafficInfo: (params: IToggleTrafficInfoParams) => void;
|
|
97
100
|
togglePause: (pause: boolean) => void;
|
|
@@ -162,6 +165,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
162
165
|
type: StringConstructor;
|
|
163
166
|
required: true;
|
|
164
167
|
};
|
|
168
|
+
flash: {
|
|
169
|
+
type: BooleanConstructor;
|
|
170
|
+
required: true;
|
|
171
|
+
};
|
|
165
172
|
crossId: {
|
|
166
173
|
type: StringConstructor;
|
|
167
174
|
required: true;
|
|
@@ -195,6 +202,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
195
202
|
required: true;
|
|
196
203
|
};
|
|
197
204
|
}, {
|
|
205
|
+
colors: string[];
|
|
198
206
|
props: any;
|
|
199
207
|
panelStyle: import("vue").ComputedRef<{
|
|
200
208
|
top: string;
|
|
@@ -202,14 +210,36 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
202
210
|
'transform-origin': string;
|
|
203
211
|
transform: string;
|
|
204
212
|
}>;
|
|
213
|
+
blImage: import("vue").ComputedRef<string>;
|
|
214
|
+
blNumberStyle: import("vue").ComputedRef<any>;
|
|
215
|
+
blLampStyle: import("vue").ComputedRef<{
|
|
216
|
+
display: string;
|
|
217
|
+
animation: string;
|
|
218
|
+
}>;
|
|
205
219
|
uImage: import("vue").ComputedRef<string>;
|
|
206
220
|
uNumberStyle: import("vue").ComputedRef<any>;
|
|
221
|
+
uLampStyle: import("vue").ComputedRef<{
|
|
222
|
+
display: string;
|
|
223
|
+
animation: string;
|
|
224
|
+
}>;
|
|
207
225
|
lImage: import("vue").ComputedRef<string>;
|
|
208
226
|
lNumberStyle: import("vue").ComputedRef<any>;
|
|
227
|
+
lLampStyle: import("vue").ComputedRef<{
|
|
228
|
+
display: string;
|
|
229
|
+
animation: string;
|
|
230
|
+
}>;
|
|
209
231
|
sImage: import("vue").ComputedRef<string>;
|
|
210
232
|
sNumberStyle: import("vue").ComputedRef<any>;
|
|
233
|
+
sLampStyle: import("vue").ComputedRef<{
|
|
234
|
+
display: string;
|
|
235
|
+
animation: string;
|
|
236
|
+
}>;
|
|
211
237
|
rImage: import("vue").ComputedRef<string>;
|
|
212
238
|
rNumberStyle: import("vue").ComputedRef<any>;
|
|
239
|
+
rLampStyle: import("vue").ComputedRef<{
|
|
240
|
+
display: string;
|
|
241
|
+
animation: string;
|
|
242
|
+
}>;
|
|
213
243
|
getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
|
|
214
244
|
getNumberStyle: (color: string | undefined) => any;
|
|
215
245
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -217,6 +247,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
217
247
|
type: StringConstructor;
|
|
218
248
|
required: true;
|
|
219
249
|
};
|
|
250
|
+
flash: {
|
|
251
|
+
type: BooleanConstructor;
|
|
252
|
+
required: true;
|
|
253
|
+
};
|
|
220
254
|
crossId: {
|
|
221
255
|
type: StringConstructor;
|
|
222
256
|
required: true;
|
|
@@ -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 n=require("vue"),b=require("./stores/index.js");require("./style/index.css");const je=require("./utils/detect-gpu.js"),A=require("./utils/green-wave-band-controller/index.js"),Qe=require("./utils/holo-flow/index.js"),Ue=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ze=require("./utils/map-initializer.js"),L=require("./utils/open-drive-renderer/index.js"),D=require("./utils/overlay.js"),Ke=require("./utils/queue-length.js"),T=require("./utils/road-config-tool/index.js"),Je=require("./utils/signal-control-area-controller/edit-area.js"),Xe=require("./utils/signal-control-area-controller/show-area.js"),Ye=require("./utils/traffic-flow.js"),Fe={class:"gis-viewer"},Re={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},$e=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(_,{expose:B,emit:q}){const S=n.ref(null);let o,d,l,i,a,r,f,t,u,s,m;const y=n.ref(!1);b.registerStore();const V=b.default.useAppDataStore,k=n.reactive([]);je.default(),n.onMounted(async()=>{if(!S.value)return;document.addEventListener("keydown",p=>{p.ctrlKey&&p.key==="i"&&(y.value=!y.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:g}=e.appContext.config.globalProperties,c=await(await fetch(O.config)).json();c.assetsRoot=O.assetsRoot||g,V.mapConfig=c,d=new Ze.default,o=await d.initialize({container:S.value,mapConfig:c,markerClickCallback:(p,C,h,We)=>{w("markerClick",p,C,h,We)},mapClickCallback:(p,C,h)=>{w("mapClick",p,C,h)}}),a=new Qe.default(o,k),await a.init(),w("mapLoaded")}),n.onUnmounted(()=>{s==null||s.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),i==null||i.disconnectTrafficFlow()});const x=n.computed(()=>o),I=()=>{const e=b.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{a.downloadTrackLog()},N=()=>{v("vehicleId")},E=()=>{v("plateNumber")},H=async e=>await d.setMapCenter(e),P=async e=>await d.setMapCamera(e),G=async e=>await d.lookAt(e),z=e=>d.setLayerVisibility(e),W=(e,g)=>d.requestCoordinateTransform(e,g),j=e=>{d.cancelCoordinateTransform(e)},Q=e=>{d.setMapZoomRange(e)},U=e=>(l||(l=new T.default(o)),l.showLaneNumber(e)),Z=()=>{l==null||l.clearLaneNumber()},K=async e=>(l||(l=new T.default(o)),await l.initializeSearch(e)),J=async()=>l==null?void 0:l.calCrossIndicatorArea(),X=async()=>{},Y=async(e,g)=>{i||(i=new Ye.default(o)),i.connectTrafficFlow(e,g)},F=()=>{i==null||i.disconnectTrafficFlow()},R=async e=>{a.handleVehicleTraceData(e)},$=()=>{a.clearHoloTrace()},ee=e=>{a.setInterpolate(e)},te=async e=>{await a.handleSignalData(e)},ae=async e=>{await a.initializeLampGroup(e)},ne=e=>{a.handleUniSignalData(e)},re=()=>{a.clearHoloSignal()},se=e=>{i==null||i.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},oe=e=>{a==null||a.togglePause(e)},ie=e=>{i==null||i.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},v=e=>{a==null||a.updatePanelContent(e)},ce=async e=>(r||(r=new D.default(o)),r.addOverlays(e)),le=e=>(r||(r=new D.default(o)),r.addMask(e)),ue=()=>{r==null||r.removeMask()},de=e=>r==null?void 0:r.removeOverlaysByType(e),me=e=>r==null?void 0:r.removeOverlaysById(e),ge=()=>r==null?void 0:r.removeAllOverlays(),pe=()=>{r==null||r.showAllOverlays()},fe=e=>{f||(f=new Ke.default(o)),f.updateQueueLength(e)},Se=()=>{f==null||f.removeQueueLength()},ye=async(e,g)=>(t||(t=new L.default(o)),await t.showOpenDriveFromServer(e,g)),ve=async e=>(t||(t=new L.default(o)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),we=async()=>await(t==null?void 0:t.clearOpenDrive()),Ce=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},be=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ke=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},Oe=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},Ae=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Le=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},De=async e=>(s||(s=new Xe.default(o)),await s.showSignalControlArea(e)),Te=async()=>await(s==null?void 0:s.clearSignalControlArea()),_e=e=>s==null?void 0:s.setLayerVisibility(e),Be=async e=>s?await(s==null?void 0:s.locateSignalControlArea(e)):{status:-1,message:"未加载信号控制区"},qe=async e=>s?await s.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ve=()=>s?s.resetHighlight():{status:-1,message:"未加载信号控制区"},xe=e=>(u||(u=new Je.default(o)),u.showSubSignalControlArea(e)),Ie=e=>u?u.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Me=()=>u?u.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ne=e=>u?u.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ee=e=>u?u.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},He=e=>{if(!u)return{status:-1,message:"未加载信号控制区"}},Pe=e=>(m||(m=new A.default(o)),m.addGreenWaveBand(e)),Ge=()=>{if(!m)return{status:-1,message:"未加载绿波带"};m.stopAddGreenWaveBand()},ze=async e=>(m||(m=new A.default(o)),await m.showGreenWaveBand(e)),O=_,w=q;return B({mapViewer:x,setLayerVisibility:z,setMapCenter:H,lookAt:G,setMapCamera:P,setMapZoomRange:Q,requestCoordinateTransform:W,cancelCoordinateTransform:j,addOverlays:ce,addMask:le,removeMask:ue,showAllOverlays:pe,removeOverlaysByType:de,removeOverlaysById:me,removeAllOverlays:ge,showLaneNumber:U,clearLaneNumber:Z,initializeAreaTool:K,calCrossIndicatorArea:J,calRoadIndicatorArea:X,connectCarFlow:Y,disconnectCarFlow:F,handleHoloVehicleTraceData:R,clearHoloTrace:$,initializeLampGroup:ae,handleUniSignalData:ne,handleHoloSignalData:te,clearHoloSignal:re,setInterpolate:ee,toggleTrafficInfo:se,toggleTrafficObject:ie,toggleVehicleInfo:v,togglePause:oe,updateQueueLength:fe,removeQueueLength:Se,showOpenDriveFromServer:ye,showOpenDriveFromFile:ve,clearOpenDrive:we,geometrySearchInOpenDrive:ke,findSumoInOpenDrive:Ce,selectSumoInOpenDrive:he,unselectSumoInOpenDrive:be,getSumoInfo:Oe,splitOpenDriveLane:Ae,clearSplitOpenDriveLane:Le,showSignalControlArea:De,clearSignalControlArea:Te,setSignalControlAreaVisibility:_e,locateSignalControlArea:Be,highlightSignalControlArea:qe,resetHighlightSignalControlArea:Ve,showSubSignalControlArea:xe,editSubSignalControlArea:Ie,stopEditSubSignalControlArea:Me,selectSubSignalControlAreaCross:Ne,unselectSubSignalControlAreaCross:Ee,changeSubSignalControlAreaBorderVisibility:He,addGreenWaveBand:Pe,stopAddGreenWaveBand:Ge,showGreenWaveBand:ze}),(e,g)=>(n.openBlock(),n.createElementBlock("div",Fe,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:S},[n.withDirectives(n.createElementVNode("div",Re,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:I}," 开始记录 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 下载日志 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:N}," 显示车辆id "),n.createElementVNode("button",{onClick:E},"显示车辆号牌")],512),[[n.vShow,y.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k,(c,p)=>(n.openBlock(),n.createBlock(Ue.default,{key:p,"display-mode":c.displayMode,flash:c.flash,"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","flash","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=$e;
|
|
@@ -28,6 +28,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
28
28
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
29
29
|
}, {}, {}>;
|
|
30
30
|
countdownPanelProps: {
|
|
31
|
+
flash: boolean;
|
|
31
32
|
displayMode: string;
|
|
32
33
|
crossId: string;
|
|
33
34
|
roadId: string;
|
|
@@ -79,6 +80,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
79
80
|
clearHoloTrace: () => void;
|
|
80
81
|
setInterpolate: (enable: boolean) => void;
|
|
81
82
|
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
83
|
+
initializeLampGroup: (data: any) => Promise<void>;
|
|
84
|
+
handleUniSignalData: (signalData: any) => void;
|
|
82
85
|
clearHoloSignal: () => void;
|
|
83
86
|
toggleTrafficInfo: (params: import("../types").IToggleTrafficInfoParams) => void;
|
|
84
87
|
togglePause: (pause: boolean) => void;
|
|
@@ -149,6 +152,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
149
152
|
type: StringConstructor;
|
|
150
153
|
required: true;
|
|
151
154
|
};
|
|
155
|
+
flash: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
required: true;
|
|
158
|
+
};
|
|
152
159
|
crossId: {
|
|
153
160
|
type: StringConstructor;
|
|
154
161
|
required: true;
|
|
@@ -182,6 +189,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
182
189
|
required: true;
|
|
183
190
|
};
|
|
184
191
|
}, {
|
|
192
|
+
colors: string[];
|
|
185
193
|
props: any;
|
|
186
194
|
panelStyle: import("vue").ComputedRef<{
|
|
187
195
|
top: string;
|
|
@@ -189,14 +197,36 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
189
197
|
'transform-origin': string;
|
|
190
198
|
transform: string;
|
|
191
199
|
}>;
|
|
200
|
+
blImage: import("vue").ComputedRef<string>;
|
|
201
|
+
blNumberStyle: import("vue").ComputedRef<any>;
|
|
202
|
+
blLampStyle: import("vue").ComputedRef<{
|
|
203
|
+
display: string;
|
|
204
|
+
animation: string;
|
|
205
|
+
}>;
|
|
192
206
|
uImage: import("vue").ComputedRef<string>;
|
|
193
207
|
uNumberStyle: import("vue").ComputedRef<any>;
|
|
208
|
+
uLampStyle: import("vue").ComputedRef<{
|
|
209
|
+
display: string;
|
|
210
|
+
animation: string;
|
|
211
|
+
}>;
|
|
194
212
|
lImage: import("vue").ComputedRef<string>;
|
|
195
213
|
lNumberStyle: import("vue").ComputedRef<any>;
|
|
214
|
+
lLampStyle: import("vue").ComputedRef<{
|
|
215
|
+
display: string;
|
|
216
|
+
animation: string;
|
|
217
|
+
}>;
|
|
196
218
|
sImage: import("vue").ComputedRef<string>;
|
|
197
219
|
sNumberStyle: import("vue").ComputedRef<any>;
|
|
220
|
+
sLampStyle: import("vue").ComputedRef<{
|
|
221
|
+
display: string;
|
|
222
|
+
animation: string;
|
|
223
|
+
}>;
|
|
198
224
|
rImage: import("vue").ComputedRef<string>;
|
|
199
225
|
rNumberStyle: import("vue").ComputedRef<any>;
|
|
226
|
+
rLampStyle: import("vue").ComputedRef<{
|
|
227
|
+
display: string;
|
|
228
|
+
animation: string;
|
|
229
|
+
}>;
|
|
200
230
|
getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
|
|
201
231
|
getNumberStyle: (color: string | undefined) => any;
|
|
202
232
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -204,6 +234,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
204
234
|
type: StringConstructor;
|
|
205
235
|
required: true;
|
|
206
236
|
};
|
|
237
|
+
flash: {
|
|
238
|
+
type: BooleanConstructor;
|
|
239
|
+
required: true;
|
|
240
|
+
};
|
|
207
241
|
crossId: {
|
|
208
242
|
type: StringConstructor;
|
|
209
243
|
required: true;
|