gisviewer-vue3-arcgis 1.0.169 → 1.0.171
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 +4 -4
- package/es/src/gis-map/gis-map.vue.mjs +105 -106
- package/es/src/gis-map/index.d.ts +2 -2
- package/es/src/gis-map/style/index.css +26 -0
- package/es/src/gis-map/utils/GreenWaveline.d.ts +68 -0
- package/es/src/gis-map/utils/holo-flow/index.d.ts +3 -2
- package/es/src/gis-map/utils/holo-flow/index.mjs +9 -6
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +120 -5
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +2 -120
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +60 -77
- package/es/style.css +1 -1
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -4
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +2 -2
- package/lib/src/gis-map/style/index.css +26 -0
- package/lib/src/gis-map/utils/GreenWaveline.d.ts +68 -0
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +3 -2
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/package.json +1 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.mjs +0 -4
- package/lib/_virtual/_plugin-vue_export-helper.js +0 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +0 -1
|
@@ -1,122 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const b = {
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "signal-countdown-container"
|
|
5
|
-
}, _ = ["src"], I = {
|
|
6
|
-
key: 1,
|
|
7
|
-
class: "signal-countdown-container"
|
|
8
|
-
}, N = ["src"], f = {
|
|
9
|
-
key: 2,
|
|
10
|
-
class: "signal-countdown-container"
|
|
11
|
-
}, $ = ["src"], k = {
|
|
12
|
-
key: 3,
|
|
13
|
-
class: "signal-countdown-container"
|
|
14
|
-
}, V = ["src"], A = /* @__PURE__ */ C({
|
|
15
|
-
__name: "signal-countdown-panel",
|
|
16
|
-
props: {
|
|
17
|
-
displayMode: {},
|
|
18
|
-
crossId: {},
|
|
19
|
-
roadId: {},
|
|
20
|
-
mapPoint: {},
|
|
21
|
-
stopLine: {},
|
|
22
|
-
scale: {},
|
|
23
|
-
position: {},
|
|
24
|
-
rotation: {},
|
|
25
|
-
lampStatus: {}
|
|
26
|
-
},
|
|
27
|
-
setup(c) {
|
|
28
|
-
const t = c, m = o(() => ({
|
|
29
|
-
top: `${t.position.top}px`,
|
|
30
|
-
left: `${t.position.left}px`,
|
|
31
|
-
"transform-origin": "bottom center",
|
|
32
|
-
transform: `translateX(-50%) translateY(-100%) rotate(${t.rotation}deg) scale(${t.scale})`
|
|
33
|
-
})), p = o(
|
|
34
|
-
() => `/GisViewerAssets/Images/SignalLamp/u-${t.lampStatus.uColor}.png`
|
|
35
|
-
), d = o(() => ({
|
|
36
|
-
color: r(t.lampStatus.uColor)
|
|
37
|
-
})), g = o(
|
|
38
|
-
() => `/GisViewerAssets/Images/SignalLamp/l-${t.lampStatus.lColor}.png`
|
|
39
|
-
), S = o(() => ({
|
|
40
|
-
color: r(t.lampStatus.lColor)
|
|
41
|
-
})), h = o(
|
|
42
|
-
() => `/GisViewerAssets/Images/SignalLamp/s-${t.lampStatus.sColor}.png`
|
|
43
|
-
), v = o(() => ({
|
|
44
|
-
color: r(t.lampStatus.sColor)
|
|
45
|
-
})), w = o(
|
|
46
|
-
() => `/GisViewerAssets/Images/SignalLamp/r-${t.lampStatus.rColor}.png`
|
|
47
|
-
), y = o(() => ({
|
|
48
|
-
color: r(t.lampStatus.rColor)
|
|
49
|
-
})), r = (e) => {
|
|
50
|
-
switch (e) {
|
|
51
|
-
case "red":
|
|
52
|
-
return "red";
|
|
53
|
-
case "yellow":
|
|
54
|
-
return "rgb(255, 192, 2)";
|
|
55
|
-
case "green":
|
|
56
|
-
return "lime";
|
|
57
|
-
default:
|
|
58
|
-
return "white";
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return (e, L) => (l(), a("div", {
|
|
62
|
-
class: "signal-countdown-panel",
|
|
63
|
-
style: n(m.value)
|
|
64
|
-
}, [
|
|
65
|
-
e.lampStatus.uColor ? (l(), a("div", b, [
|
|
66
|
-
s("div", {
|
|
67
|
-
class: "signal-countdown-number",
|
|
68
|
-
style: n(d.value)
|
|
69
|
-
}, i(e.lampStatus.uNumber), 5),
|
|
70
|
-
s("div", null, [
|
|
71
|
-
s("img", {
|
|
72
|
-
src: p.value,
|
|
73
|
-
width: "20px",
|
|
74
|
-
height: "20px"
|
|
75
|
-
}, null, 8, _)
|
|
76
|
-
])
|
|
77
|
-
])) : u("", !0),
|
|
78
|
-
e.lampStatus.lColor ? (l(), a("div", I, [
|
|
79
|
-
s("div", {
|
|
80
|
-
class: "signal-countdown-number",
|
|
81
|
-
style: n(S.value)
|
|
82
|
-
}, i(e.lampStatus.lNumber), 5),
|
|
83
|
-
s("div", null, [
|
|
84
|
-
s("img", {
|
|
85
|
-
src: g.value,
|
|
86
|
-
width: "20px",
|
|
87
|
-
height: "20px"
|
|
88
|
-
}, null, 8, N)
|
|
89
|
-
])
|
|
90
|
-
])) : u("", !0),
|
|
91
|
-
e.lampStatus.sColor ? (l(), a("div", f, [
|
|
92
|
-
s("div", {
|
|
93
|
-
class: "signal-countdown-number",
|
|
94
|
-
style: n(v.value)
|
|
95
|
-
}, i(e.lampStatus.sNumber), 5),
|
|
96
|
-
s("div", null, [
|
|
97
|
-
s("img", {
|
|
98
|
-
src: h.value,
|
|
99
|
-
width: "20px",
|
|
100
|
-
height: "20px"
|
|
101
|
-
}, null, 8, $)
|
|
102
|
-
])
|
|
103
|
-
])) : u("", !0),
|
|
104
|
-
e.lampStatus.rColor !== void 0 ? (l(), a("div", k, [
|
|
105
|
-
s("div", {
|
|
106
|
-
class: "signal-countdown-number",
|
|
107
|
-
style: n(y.value)
|
|
108
|
-
}, i(e.lampStatus.rNumber), 5),
|
|
109
|
-
s("div", null, [
|
|
110
|
-
s("img", {
|
|
111
|
-
src: w.value,
|
|
112
|
-
width: "20px",
|
|
113
|
-
height: "20px"
|
|
114
|
-
}, null, 8, V)
|
|
115
|
-
])
|
|
116
|
-
])) : u("", !0)
|
|
117
|
-
], 4));
|
|
118
|
-
}
|
|
119
|
-
});
|
|
1
|
+
import f from "./signal-countdown-panel.vue.mjs";
|
|
120
2
|
export {
|
|
121
|
-
|
|
3
|
+
f as default
|
|
122
4
|
};
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
import { ISignalCountdownProps } from '../../../types';
|
|
2
3
|
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
4
|
private stopLineLayer;
|
|
4
|
-
private store;
|
|
5
5
|
private watchHandle;
|
|
6
|
-
|
|
6
|
+
private countdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, countdownPanelInfos: ISignalCountdownProps[]);
|
|
7
8
|
private stopLineMap;
|
|
8
9
|
initializeLayer(): Promise<void>;
|
|
9
10
|
private currentPanelScale;
|
|
10
11
|
private getPanelScale;
|
|
11
12
|
handleSignalData(data: any): Promise<void>;
|
|
12
13
|
clearSignal(): void;
|
|
13
|
-
/**
|
|
14
|
-
* 从停止线坐标计算面板位置
|
|
15
|
-
* @param coordinates
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
private getPanelPoint;
|
|
19
14
|
/**
|
|
20
15
|
* 从停止线坐标计算面板旋转角度
|
|
21
16
|
* @param coordinates
|
|
@@ -1,108 +1,103 @@
|
|
|
1
1
|
import * as d from "@arcgis/core/core/reactiveUtils";
|
|
2
|
-
import { Point as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import y from "../common-utils.mjs";
|
|
9
|
-
import L from "./signal-holo-flow.mjs";
|
|
10
|
-
class b extends L {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
super(e), this.stopLineLayer = new P(), this.store = g.useAppDataStore, this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
|
|
2
|
+
import { Point as h } from "@arcgis/core/geometry";
|
|
3
|
+
import w from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
+
import P from "./signal-holo-flow.mjs";
|
|
5
|
+
class L extends P {
|
|
6
|
+
constructor(n, s) {
|
|
7
|
+
super(n), this.stopLineLayer = new w(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = s, this.view.map.add(this.stopLineLayer);
|
|
13
8
|
}
|
|
14
9
|
async initializeLayer() {
|
|
15
10
|
var c, r;
|
|
16
11
|
console.time("初始化停止线图层");
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
12
|
+
let n = (r = (c = this.mapConfig.holoFlow) == null ? void 0 : c.signal) == null ? void 0 : r.stopLineLayer;
|
|
13
|
+
if (!n)
|
|
19
14
|
return;
|
|
20
|
-
|
|
21
|
-
const { roadId:
|
|
22
|
-
f ? f.set(
|
|
15
|
+
n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
|
|
16
|
+
const { roadId: o, nodeId: e, angle: i, destinationPoint: a } = t.properties, { coordinates: l } = t.geometry, f = this.stopLineMap.get(e);
|
|
17
|
+
f ? f.set(o, {
|
|
23
18
|
coord: l,
|
|
24
19
|
panelPoint: a,
|
|
25
|
-
angle:
|
|
20
|
+
angle: i
|
|
26
21
|
}) : this.stopLineMap.set(
|
|
27
|
-
|
|
22
|
+
e,
|
|
28
23
|
/* @__PURE__ */ new Map([
|
|
29
24
|
[
|
|
30
|
-
|
|
31
|
-
{ coord: l, panelPoint: a, angle:
|
|
25
|
+
o,
|
|
26
|
+
{ coord: l, panelPoint: a, angle: i }
|
|
32
27
|
]
|
|
33
28
|
])
|
|
34
29
|
);
|
|
35
30
|
}), console.timeEnd("初始化停止线图层");
|
|
36
31
|
}
|
|
37
32
|
getPanelScale() {
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
return
|
|
33
|
+
const n = this.view.scale;
|
|
34
|
+
let s = 1;
|
|
35
|
+
return n < 1e3 ? s = 1 : n < 2e3 ? s = 0.8 : s = 0.4, s;
|
|
41
36
|
}
|
|
42
|
-
async handleSignalData(
|
|
37
|
+
async handleSignalData(n) {
|
|
43
38
|
this.watchHandle || (this.watchHandle = d.watch(
|
|
44
39
|
() => this.view.extent,
|
|
45
40
|
() => {
|
|
46
41
|
const t = this.getPanelScale();
|
|
47
|
-
for (const
|
|
48
|
-
t !== this.currentPanelScale && (
|
|
49
|
-
const { mapPoint:
|
|
42
|
+
for (const o of this.countdownPanelProps) {
|
|
43
|
+
t !== this.currentPanelScale && (o.scale = t);
|
|
44
|
+
const { mapPoint: e } = o, i = this.view.toScreen({
|
|
50
45
|
type: "point",
|
|
51
|
-
x:
|
|
52
|
-
y:
|
|
46
|
+
x: e[0],
|
|
47
|
+
y: e[1]
|
|
53
48
|
});
|
|
54
|
-
|
|
49
|
+
o.position.left = i.x, o.position.top = i.y;
|
|
55
50
|
}
|
|
56
51
|
this.currentPanelScale = t;
|
|
57
52
|
}
|
|
58
53
|
));
|
|
59
|
-
const
|
|
54
|
+
const s = n.crossId, p = this.stopLineMap.get(s);
|
|
60
55
|
if (!p) {
|
|
61
|
-
console.log(`没有找到路口${
|
|
56
|
+
console.log(`没有找到路口${s}`);
|
|
62
57
|
return;
|
|
63
58
|
}
|
|
64
|
-
const c =
|
|
59
|
+
const c = n.phaseCountDownList, r = /* @__PURE__ */ new Map();
|
|
65
60
|
for (const t of c) {
|
|
66
|
-
let
|
|
61
|
+
let o = "";
|
|
67
62
|
for (let l of t.roadIdList)
|
|
68
63
|
if (l.startsWith("-") && (l = l.slice(1)), p.has(l)) {
|
|
69
|
-
|
|
64
|
+
o = l;
|
|
70
65
|
break;
|
|
71
66
|
}
|
|
72
|
-
if (!
|
|
73
|
-
console.log(`没有找到对应的进口道${
|
|
67
|
+
if (!o) {
|
|
68
|
+
console.log(`没有找到对应的进口道${s}--${o}`);
|
|
74
69
|
continue;
|
|
75
70
|
}
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
78
|
-
console.log(`没有找到对应的方向${
|
|
71
|
+
let e = r.get(o);
|
|
72
|
+
if (e || (e = {}, r.set(o, e)), !t.direction) {
|
|
73
|
+
console.log(`没有找到对应的方向${s}--${JSON.stringify(t)}`);
|
|
79
74
|
continue;
|
|
80
75
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
76
|
+
const i = t.direction.toLowerCase(), a = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
|
|
77
|
+
i === "u" ? (e.uNumber = t.leftTime, e.uColor = a) : i === "l" ? (e.lNumber = t.leftTime, e.lColor = a) : i === "s" ? (e.sNumber = t.leftTime, e.sColor = a) : i === "r" && (e.rNumber = t.leftTime, e.rColor = a);
|
|
83
78
|
}
|
|
84
|
-
r.forEach((t,
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
79
|
+
r.forEach((t, o) => {
|
|
80
|
+
const e = p.get(o);
|
|
81
|
+
if (!e)
|
|
87
82
|
return;
|
|
88
|
-
const
|
|
89
|
-
(a) => a.crossId ===
|
|
83
|
+
const i = this.countdownPanelProps.find(
|
|
84
|
+
(a) => a.crossId === s && a.roadId === o
|
|
90
85
|
);
|
|
91
|
-
if (
|
|
92
|
-
|
|
86
|
+
if (i)
|
|
87
|
+
i.lampStatus = t;
|
|
93
88
|
else {
|
|
94
|
-
const a =
|
|
89
|
+
const a = e.panelPoint, l = this.view.toScreen({
|
|
95
90
|
type: "point",
|
|
96
91
|
x: a[0],
|
|
97
92
|
y: a[1]
|
|
98
|
-
}), f = this.getPanelRotation(
|
|
99
|
-
this.
|
|
93
|
+
}), f = this.getPanelRotation(e.coord);
|
|
94
|
+
this.countdownPanelProps.push({
|
|
100
95
|
displayMode: "complex",
|
|
101
|
-
crossId:
|
|
102
|
-
roadId:
|
|
96
|
+
crossId: s,
|
|
97
|
+
roadId: o,
|
|
103
98
|
mapPoint: a,
|
|
104
99
|
// 定位点地理坐标
|
|
105
|
-
stopLine:
|
|
100
|
+
stopLine: e.coord,
|
|
106
101
|
// 关联的停止线坐标
|
|
107
102
|
position: { left: l.x, top: l.y },
|
|
108
103
|
// 定位点屏幕坐标
|
|
@@ -116,39 +111,27 @@ class b extends L {
|
|
|
116
111
|
});
|
|
117
112
|
}
|
|
118
113
|
clearSignal() {
|
|
119
|
-
var
|
|
120
|
-
this.stopLineLayer.removeAll(), this.
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* 从停止线坐标计算面板位置
|
|
124
|
-
* @param coordinates
|
|
125
|
-
* @returns
|
|
126
|
-
*/
|
|
127
|
-
getPanelPoint(e) {
|
|
128
|
-
const i = y.getCenterPointInLine(e), p = e[0], c = e[e.length - 1];
|
|
129
|
-
let t = w(h.point(p), h.point(c)) - 90;
|
|
130
|
-
return t < -180 && (t += 360), u(h.point(i), 1, t, {
|
|
131
|
-
units: "meters"
|
|
132
|
-
}).geometry.coordinates;
|
|
114
|
+
var n;
|
|
115
|
+
this.stopLineLayer.removeAll(), this.countdownPanelProps = [], (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
|
|
133
116
|
}
|
|
134
117
|
/**
|
|
135
118
|
* 从停止线坐标计算面板旋转角度
|
|
136
119
|
* @param coordinates
|
|
137
120
|
* @returns
|
|
138
121
|
*/
|
|
139
|
-
getPanelRotation(
|
|
140
|
-
const
|
|
141
|
-
x:
|
|
142
|
-
y:
|
|
122
|
+
getPanelRotation(n) {
|
|
123
|
+
const s = n[0], p = new h({
|
|
124
|
+
x: s[0],
|
|
125
|
+
y: s[1],
|
|
143
126
|
spatialReference: this.view.spatialReference
|
|
144
|
-
}), c = this.view.toScreen(p), r =
|
|
127
|
+
}), c = this.view.toScreen(p), r = n[n.length - 1], t = new h({
|
|
145
128
|
x: r[0],
|
|
146
129
|
y: r[1],
|
|
147
130
|
spatialReference: this.view.spatialReference
|
|
148
|
-
}),
|
|
149
|
-
return Math.atan2(
|
|
131
|
+
}), o = this.view.toScreen(t), e = o.x - c.x, i = o.y - c.y;
|
|
132
|
+
return Math.atan2(i, e) * (180 / Math.PI);
|
|
150
133
|
}
|
|
151
134
|
}
|
|
152
135
|
export {
|
|
153
|
-
|
|
136
|
+
L as default
|
|
154
137
|
};
|
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}
|
|
1
|
+
.gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
|
-
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
3
|
+
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
4
4
|
import HoloFlow from './utils/holo-flow';
|
|
5
5
|
import MapInitializer from './utils/map-initializer';
|
|
6
6
|
import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
@@ -34,9 +34,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
34
34
|
mapConfig: {};
|
|
35
35
|
saveTrackLog: boolean;
|
|
36
36
|
isSketching: boolean;
|
|
37
|
-
countdownPanels:
|
|
37
|
+
countdownPanels: ISignalCountdownProps[];
|
|
38
38
|
}, {}, {}>;
|
|
39
|
-
|
|
39
|
+
countdownPanelProps: {
|
|
40
40
|
displayMode: string;
|
|
41
41
|
crossId: string;
|
|
42
42
|
roadId: string;
|
|
@@ -58,7 +58,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
58
58
|
rNumber?: number | undefined;
|
|
59
59
|
rColor?: string | undefined;
|
|
60
60
|
};
|
|
61
|
-
}[]
|
|
61
|
+
}[];
|
|
62
62
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
63
63
|
startSaveTrackLog: () => void;
|
|
64
64
|
downloadTrackLog: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("./stores/index.js");require("./style/index.css");const _e=require("./utils/holo-flow/index.js"),qe=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ie=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),k=require("./utils/overlay.js"),Me=require("./utils/queue-length.js"),A=require("./utils/road-config-tool/index.js"),L=require("./utils/signal-control-area-controller/index.js"),xe=require("./utils/traffic-flow.js"),Be={class:"gis-viewer"},He={style:{position:"absolute",bottom:"10px",left:"10px"}},Ve=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:b,emit:D}){const p=n.ref(null);let i,u,l,o,a,r,g,t,s;const f=n.ref(!1);S.registerStore();const _=S.default.useAppDataStore,h=n.reactive([]);n.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",d=>{d.ctrlKey&&d.key==="i"&&(f.value=!f.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:m}=e.appContext.config.globalProperties,c=await(await fetch(C.config)).json();c.assetsRoot=C.assetsRoot||m,_.mapConfig=c,u=new Ie.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(d,v,w,De)=>{y("markerClick",d,v,w,De)},mapClickCallback:(d,v,w)=>{y("mapClick",d,v,w)}}),a=new _e.default(i,h),await a.init(),y("mapLoaded")}),n.onUnmounted(()=>{s==null||s.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const q=n.computed(()=>i),I=()=>{const e=S.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{a.downloadTrackLog()},x=async e=>await u.setMapCenter(e),B=async e=>await u.setMapCamera(e),H=async e=>await u.lookAt(e),V=e=>u.setLayerVisibility(e),P=(e,m)=>u.requestCoordinateTransform(e,m),N=e=>{u.cancelCoordinateTransform(e)},E=e=>{u.setMapZoomRange(e)},j=e=>(l||(l=new A.default(i)),l.showLaneNumber(e)),z=()=>{l==null||l.clearLaneNumber()},Q=async e=>(l||(l=new A.default(i)),await l.initializeSearch(e)),Z=async()=>l==null?void 0:l.calCrossIndicatorArea(),K=async()=>{},U=async(e,m)=>{o||(o=new xe.default(i)),o.connectTrafficFlow(e,m)},G=()=>{o==null||o.disconnectTrafficFlow()},J=async e=>{a.handleVehicleTraceData(e)},W=()=>{a.clearHoloTrace()},X=e=>{a.setInterpolate(e)},Y=async e=>{await a.handleSignalData(e)},F=()=>{a.clearHoloSignal()},R=e=>{o==null||o.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},$=e=>{a==null||a.togglePause(e)},ee=e=>{o==null||o.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},te=e=>{a==null||a.updatePanelContent(e)},ae=async e=>(r||(r=new k.default(i)),r.addOverlays(e)),ne=e=>(r||(r=new k.default(i)),r.addMask(e)),re=()=>{r==null||r.removeMask()},se=e=>r==null?void 0:r.removeOverlaysByType(e),oe=e=>r==null?void 0:r.removeOverlaysById(e),ie=()=>r==null?void 0:r.removeAllOverlays(),ce=()=>{r==null||r.showAllOverlays()},le=e=>{g||(g=new Me.default(i)),g.updateQueueLength(e)},ue=()=>{g==null||g.removeQueueLength()},me=async(e,m)=>(t||(t=new O.default(i)),await t.showOpenDriveFromServer(e,m)),de=async e=>(t||(t=new O.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),ge=async()=>await(t==null?void 0:t.clearOpenDrive()),pe=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},fe=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},Se=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},he=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Ce=e=>(s||(s=new L.default(i)),s.showSignalControlArea(e)),Oe=()=>{s==null||s.clearSignalControlArea()},ke=async e=>s?await s.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ae=async e=>s?await s.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=()=>s?s.resetHighlight():{status:-1,message:"未加载信号控制区"},Te=e=>(s||(s=new L.default(i)),s.showSubSignalControlArea(e)),be=()=>s?s.editSubSignalArea():{status:-1,message:"未加载信号控制区"},C=T,y=D;return b({mapViewer:q,setLayerVisibility:V,setMapCenter:x,lookAt:H,setMapCamera:B,setMapZoomRange:E,requestCoordinateTransform:P,cancelCoordinateTransform:N,addOverlays:ae,addMask:ne,removeMask:re,showAllOverlays:ce,removeOverlaysByType:se,removeOverlaysById:oe,removeAllOverlays:ie,showLaneNumber:j,clearLaneNumber:z,initializeAreaTool:Q,calCrossIndicatorArea:Z,calRoadIndicatorArea:K,connectCarFlow:U,disconnectCarFlow:G,handleHoloVehicleTraceData:J,clearHoloTrace:W,handleHoloSignalData:Y,clearHoloSignal:F,setInterpolate:X,toggleTrafficInfo:R,toggleTrafficObject:ee,toggleVehicleInfo:te,togglePause:$,updateQueueLength:le,removeQueueLength:ue,showOpenDriveFromServer:me,showOpenDriveFromFile:de,clearOpenDrive:ge,geometrySearchInOpenDrive:ve,findSumoInOpenDrive:pe,selectSumoInOpenDrive:fe,unselectSumoInOpenDrive:ye,getSumoInfo:we,splitOpenDriveLane:Se,clearSplitOpenDriveLane:he,showSignalControlArea:Ce,clearSignalControlArea:Oe,locateSignalControlArea:ke,highlightSignalControlArea:Ae,resetHighlightSignalControlArea:Le,showSubSignalControlArea:Te,editSubSignalControlArea:be}),(e,m)=>(n.openBlock(),n.createElementBlock("div",Be,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[n.withDirectives(n.createElementVNode("div",He,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:I}," 开始记录 "),n.createElementVNode("button",{onClick:M},"下载日志")],512),[[n.vShow,f.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h,(c,d)=>(n.openBlock(),n.createBlock(qe.default,{key:d,"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=Ve;
|
|
@@ -25,7 +25,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
25
25
|
isSketching: boolean;
|
|
26
26
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
27
27
|
}, {}, {}>;
|
|
28
|
-
|
|
28
|
+
countdownPanelProps: {
|
|
29
29
|
displayMode: string;
|
|
30
30
|
crossId: string;
|
|
31
31
|
roadId: string;
|
|
@@ -47,7 +47,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
47
47
|
rNumber?: number | undefined;
|
|
48
48
|
rColor?: string | undefined;
|
|
49
49
|
};
|
|
50
|
-
}[]
|
|
50
|
+
}[];
|
|
51
51
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
52
52
|
startSaveTrackLog: () => void;
|
|
53
53
|
downloadTrackLog: () => void;
|
|
@@ -11,3 +11,29 @@
|
|
|
11
11
|
.esri-view .esri-view-surface:focus::after {
|
|
12
12
|
outline: none !important;
|
|
13
13
|
}
|
|
14
|
+
.signal-countdown-panel {
|
|
15
|
+
position: absolute;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
padding: 0px;
|
|
19
|
+
margin: 0px;
|
|
20
|
+
}
|
|
21
|
+
.signal-countdown-container {
|
|
22
|
+
margin: 0 1px;
|
|
23
|
+
padding: 0px;
|
|
24
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
25
|
+
border-style: solid;
|
|
26
|
+
border-color: turquoise;
|
|
27
|
+
border-width: 2px;
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
color: white;
|
|
30
|
+
width: 40px;
|
|
31
|
+
height: 70px;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
}
|
|
37
|
+
.signal-countdown-number {
|
|
38
|
+
font: 30px bold;
|
|
39
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Graphic from '@arcgis/core/Graphic';
|
|
2
|
+
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
4
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
+
interface GreenWaveLineOptions {
|
|
6
|
+
viewer: MapView | SceneView;
|
|
7
|
+
graphicsLayerOptions: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface roadPath {
|
|
12
|
+
paths: [number, number][];
|
|
13
|
+
symbol: any;
|
|
14
|
+
attributes: any;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface animationOptions {
|
|
18
|
+
isAnimation: boolean;
|
|
19
|
+
positive?: boolean;
|
|
20
|
+
positiveColor?: number[];
|
|
21
|
+
negative?: boolean;
|
|
22
|
+
negativeColor?: number[];
|
|
23
|
+
}
|
|
24
|
+
export default class GreenWaveLine {
|
|
25
|
+
private viewer;
|
|
26
|
+
overlayLayer: GraphicsLayer;
|
|
27
|
+
customGreenWaveLineView: any;
|
|
28
|
+
material: THREE.ShaderMaterial;
|
|
29
|
+
renderer: THREE.WebGLRenderer;
|
|
30
|
+
threeScene: THREE.Scene;
|
|
31
|
+
camera: THREE.PerspectiveCamera;
|
|
32
|
+
private defaultAnimationOptions;
|
|
33
|
+
constructor(options: GreenWaveLineOptions);
|
|
34
|
+
addGreenWaveLine(paths: roadPath[], options?: animationOptions): void;
|
|
35
|
+
getAnimationPath(paths: [number, number][], options?: animationOptions): any;
|
|
36
|
+
createLine(paths: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
37
|
+
addPointText(points: any[]): void;
|
|
38
|
+
createPointText(point: any, symbol: any, attributes: any, visible: boolean): Graphic;
|
|
39
|
+
/**
|
|
40
|
+
* 隐藏覆盖物
|
|
41
|
+
*
|
|
42
|
+
* @param {string[]} [ids]
|
|
43
|
+
* @memberof GreenWaveLine
|
|
44
|
+
*/
|
|
45
|
+
hideWaveLine(ids?: string[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* 显示覆盖物
|
|
48
|
+
*
|
|
49
|
+
* @param {string[]} [ids]
|
|
50
|
+
* @memberof GreenWaveLine
|
|
51
|
+
*/
|
|
52
|
+
showWaveLine(ids?: string[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* 隐藏图层
|
|
55
|
+
*
|
|
56
|
+
* @memberof GreenWaveLine
|
|
57
|
+
*/
|
|
58
|
+
hideLayer(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 显示图层
|
|
61
|
+
*
|
|
62
|
+
* @memberof Overlay
|
|
63
|
+
*/
|
|
64
|
+
showLayer(): void;
|
|
65
|
+
clearGreenWaveLine(): void;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IToggleTrafficInfoParams } from '../../../types';
|
|
1
|
+
import { ISignalCountdownProps, IToggleTrafficInfoParams } from '../../../types';
|
|
2
2
|
export default class Index {
|
|
3
3
|
private readonly view;
|
|
4
4
|
private traceHoloFlow;
|
|
5
5
|
private signalHoloFlow;
|
|
6
|
-
|
|
6
|
+
private signalCountdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, signalCountdownPanelProps: ISignalCountdownProps[]);
|
|
7
8
|
init(): Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* 处理全息流轨迹数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),t=require("../../../types/index.js"),s=require("../../stores/index.js"),n=require("./signal-holo-flow.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),t=require("../../../types/index.js"),s=require("../../stores/index.js"),n=require("./signal-holo-flow.js"),r=require("./signal-holo-flow-lsr.js"),c=require("./trace-holo-flow.js");class h{constructor(e,o){this.view=e,this.signalCountdownPanelProps=o}async init(){this.traceHoloFlow=new c.default(this.view),await this.traceHoloFlow.init()}handleVehicleTraceData(e){this.traceHoloFlow.handleVehicleTraceData(e)}toggleTrafficObject(e){switch(e.name.toLowerCase()){case"groundVehicle".toLowerCase():this.traceHoloFlow.toggleGroundVehicle(e.visible);break;case"elevatedVehicle".toLowerCase():this.traceHoloFlow.toggleElevatedVehicle(e.visible);break}}clearHoloTrace(){this.traceHoloFlow.clearTrace()}toggleTrafficInfo(e){this.traceHoloFlow.toggleTrafficInfo(e)}togglePause(e){this.traceHoloFlow.togglePause(e)}updatePanelContent(e){let o=t.EVehiclePlateState.None;switch(e){case"none":o=t.EVehiclePlateState.None;break;case"plateNumber":o=t.EVehiclePlateState.PlateNumber;break;case"vehicleId":o=t.EVehiclePlateState.Id;break;case"mix":o=t.EVehiclePlateState.Mix;break}this.traceHoloFlow.updatePanelContent(o)}async handleSignalData(e){var o,l;if(!this.signalHoloFlow){const a=s.default.useAppDataStore;((l=(o=i.toRaw(a.mapConfig).holoFlow)==null?void 0:o.signal)==null?void 0:l.style)==="LSR"?this.signalHoloFlow=new r.default(this.view,this.signalCountdownPanelProps):this.signalHoloFlow=new n.default(this.view),await this.signalHoloFlow.initializeLayer()}await this.signalHoloFlow.handleSignalData(e)}clearHoloSignal(){var e;(e=this.signalHoloFlow)==null||e.clearSignal()}setInterpolate(e){this.traceHoloFlow.setInterpolate(e)}downloadTrackLog(){this.traceHoloFlow.downloadLog()}}exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g={key:0,class:"signal-countdown-container"},S=["src"],v={key:1,class:"signal-countdown-container"},y=["src"],N={key:2,class:"signal-countdown-container"},h=["src"],w={key:3,class:"signal-countdown-container"},V=["src"],C=e.defineComponent({__name:"signal-countdown-panel",props:{displayMode:{},crossId:{},roadId:{},mapPoint:{},stopLine:{},scale:{},position:{},rotation:{},lampStatus:{}},setup(n){const t=n,s=e.computed(()=>({top:`${t.position.top}px`,left:`${t.position.left}px`,"transform-origin":"bottom center",transform:`translateX(-50%) translateY(-100%) rotate(${t.rotation}deg) scale(${t.scale})`})),a=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/u-${t.lampStatus.uColor}.png`),r=e.computed(()=>({color:l(t.lampStatus.uColor)})),c=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/l-${t.lampStatus.lColor}.png`),i=e.computed(()=>({color:l(t.lampStatus.lColor)})),m=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/s-${t.lampStatus.sColor}.png`),u=e.computed(()=>({color:l(t.lampStatus.sColor)})),d=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/r-${t.lampStatus.rColor}.png`),p=e.computed(()=>({color:l(t.lampStatus.rColor)})),l=o=>{switch(o){case"red":return"red";case"yellow":return"rgb(255, 192, 2)";case"green":return"lime";default:return"white"}};return(o,E)=>(e.openBlock(),e.createElementBlock("div",{class:"signal-countdown-panel",style:e.normalizeStyle(s.value)},[o.lampStatus.uColor?(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(r.value)},e.toDisplayString(o.lampStatus.uNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:a.value,width:"20px",height:"20px"},null,8,S)])])):e.createCommentVNode("",!0),o.lampStatus.lColor?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(i.value)},e.toDisplayString(o.lampStatus.lNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:c.value,width:"20px",height:"20px"},null,8,y)])])):e.createCommentVNode("",!0),o.lampStatus.sColor?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(u.value)},e.toDisplayString(o.lampStatus.sNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:m.value,width:"20px",height:"20px"},null,8,h)])])):e.createCommentVNode("",!0),o.lampStatus.rColor!==void 0?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(p.value)},e.toDisplayString(o.lampStatus.rNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:d.value,width:"20px",height:"20px"},null,8,V)])])):e.createCommentVNode("",!0)],4))}});exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./signal-countdown-panel.vue.js");exports.default=e.default;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
import { ISignalCountdownProps } from '../../../types';
|
|
2
3
|
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
4
|
private stopLineLayer;
|
|
4
|
-
private store;
|
|
5
5
|
private watchHandle;
|
|
6
|
-
|
|
6
|
+
private countdownPanelProps;
|
|
7
|
+
constructor(view: __esri.MapView | __esri.SceneView, countdownPanelInfos: ISignalCountdownProps[]);
|
|
7
8
|
private stopLineMap;
|
|
8
9
|
initializeLayer(): Promise<void>;
|
|
9
10
|
private currentPanelScale;
|
|
10
11
|
private getPanelScale;
|
|
11
12
|
handleSignalData(data: any): Promise<void>;
|
|
12
13
|
clearSignal(): void;
|
|
13
|
-
/**
|
|
14
|
-
* 从停止线坐标计算面板位置
|
|
15
|
-
* @param coordinates
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
private getPanelPoint;
|
|
19
14
|
/**
|
|
20
15
|
* 从停止线坐标计算面板旋转角度
|
|
21
16
|
* @param coordinates
|