gisviewer-vue3-arcgis 1.0.171 → 1.0.173
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/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -1
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +82 -66
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +1 -1
- package/es/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +1 -0
- package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +132 -125
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +19 -19
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +7 -8
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/package.json +1 -1
- package/es/src/gis-map/utils/GreenWaveline.d.ts +0 -68
- package/lib/src/gis-map/utils/GreenWaveline.d.ts +0 -68
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import SignalHoloFlow from './signal-holo-flow';
|
|
2
1
|
import { ISignalCountdownProps } from '../../../types';
|
|
2
|
+
import SignalHoloFlow from './signal-holo-flow';
|
|
3
3
|
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
4
4
|
private stopLineLayer;
|
|
5
5
|
private watchHandle;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Point as
|
|
3
|
-
import
|
|
4
|
-
import P from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as w from "@arcgis/core/core/reactiveUtils";
|
|
2
|
+
import { Point as f } from "@arcgis/core/geometry";
|
|
3
|
+
import * as d from "@arcgis/core/geometry/support/webMercatorUtils.js";
|
|
4
|
+
import P from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
import g from "./signal-holo-flow.mjs";
|
|
6
|
+
class S extends g {
|
|
7
|
+
constructor(n, a) {
|
|
8
|
+
super(n), this.stopLineLayer = new P(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = a, this.view.map.add(this.stopLineLayer);
|
|
8
9
|
}
|
|
9
10
|
async initializeLayer() {
|
|
10
|
-
var
|
|
11
|
+
var p, l;
|
|
11
12
|
console.time("初始化停止线图层");
|
|
12
|
-
let n = (
|
|
13
|
+
let n = (l = (p = this.mapConfig.holoFlow) == null ? void 0 : p.signal) == null ? void 0 : l.stopLineLayer;
|
|
13
14
|
if (!n)
|
|
14
15
|
return;
|
|
15
16
|
n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
|
|
16
|
-
const { roadId: o, nodeId: e, angle:
|
|
17
|
-
|
|
18
|
-
coord:
|
|
19
|
-
panelPoint:
|
|
20
|
-
angle:
|
|
17
|
+
const { roadId: o, nodeId: e, angle: s, destinationPoint: i } = t.properties, { coordinates: r } = t.geometry, h = this.stopLineMap.get(e);
|
|
18
|
+
h ? h.set(o, {
|
|
19
|
+
coord: r,
|
|
20
|
+
panelPoint: i,
|
|
21
|
+
angle: s
|
|
21
22
|
}) : this.stopLineMap.set(
|
|
22
23
|
e,
|
|
23
24
|
/* @__PURE__ */ new Map([
|
|
24
25
|
[
|
|
25
26
|
o,
|
|
26
|
-
{ coord:
|
|
27
|
+
{ coord: r, panelPoint: i, angle: s }
|
|
27
28
|
]
|
|
28
29
|
])
|
|
29
30
|
);
|
|
@@ -31,77 +32,84 @@ class L extends P {
|
|
|
31
32
|
}
|
|
32
33
|
getPanelScale() {
|
|
33
34
|
const n = this.view.scale;
|
|
34
|
-
let
|
|
35
|
-
return n < 1e3 ?
|
|
35
|
+
let a = 1;
|
|
36
|
+
return n < 1e3 ? a = 1 : n < 2e3 ? a = 0.8 : a = 0.4, a;
|
|
36
37
|
}
|
|
37
38
|
async handleSignalData(n) {
|
|
38
|
-
this.watchHandle || (this.watchHandle =
|
|
39
|
+
this.watchHandle || (this.watchHandle = w.watch(
|
|
39
40
|
() => this.view.extent,
|
|
40
41
|
() => {
|
|
42
|
+
console.log("extent changed");
|
|
41
43
|
const t = this.getPanelScale();
|
|
42
44
|
for (const o of this.countdownPanelProps) {
|
|
43
45
|
t !== this.currentPanelScale && (o.scale = t);
|
|
44
|
-
const { mapPoint: e } = o
|
|
45
|
-
|
|
46
|
+
const { mapPoint: e } = o;
|
|
47
|
+
let s = new f({
|
|
46
48
|
x: e[0],
|
|
47
49
|
y: e[1]
|
|
48
50
|
});
|
|
49
|
-
|
|
51
|
+
this.view.spatialReference.isWebMercator && (s = d.geographicToWebMercator(
|
|
52
|
+
s
|
|
53
|
+
));
|
|
54
|
+
const i = this.view.toScreen(s);
|
|
55
|
+
if (o.position.left = i.x, o.position.top = i.y, this.view.type === "3d") {
|
|
56
|
+
const r = this.getPanelRotation(o.stopLine);
|
|
57
|
+
o.rotation = r;
|
|
58
|
+
}
|
|
50
59
|
}
|
|
51
60
|
this.currentPanelScale = t;
|
|
52
61
|
}
|
|
53
62
|
));
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
console.log(`没有找到路口${s}`);
|
|
63
|
+
const a = n.crossId, c = this.stopLineMap.get(a);
|
|
64
|
+
if (!c)
|
|
57
65
|
return;
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
for (const t of c) {
|
|
66
|
+
const p = n.phaseCountDownList, l = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const t of p) {
|
|
61
68
|
let o = "";
|
|
62
|
-
for (let
|
|
63
|
-
if (
|
|
64
|
-
o =
|
|
69
|
+
for (let r of t.roadIdList)
|
|
70
|
+
if (r.startsWith("-") && (r = r.slice(1)), c.has(r)) {
|
|
71
|
+
o = r;
|
|
65
72
|
break;
|
|
66
73
|
}
|
|
67
|
-
if (!o)
|
|
68
|
-
console.log(`没有找到对应的进口道${s}--${o}`);
|
|
74
|
+
if (!o)
|
|
69
75
|
continue;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
console.log(`没有找到对应的方向${s}--${JSON.stringify(t)}`);
|
|
76
|
+
let e = l.get(o);
|
|
77
|
+
if (e || (e = {}, l.set(o, e)), !t.direction) {
|
|
78
|
+
console.log(`没有找到对应的方向${a}--${JSON.stringify(t)}`);
|
|
74
79
|
continue;
|
|
75
80
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
81
|
+
const s = t.direction.toLowerCase(), i = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
|
|
82
|
+
s === "u" ? (e.uNumber = t.leftTime, e.uColor = i) : s === "l" ? (e.lNumber = t.leftTime, e.lColor = i) : s === "s" ? (e.sNumber = t.leftTime, e.sColor = i) : s === "r" && (e.rNumber = t.leftTime, e.rColor = i);
|
|
78
83
|
}
|
|
79
|
-
|
|
80
|
-
const e =
|
|
84
|
+
l.forEach((t, o) => {
|
|
85
|
+
const e = c.get(o);
|
|
81
86
|
if (!e)
|
|
82
87
|
return;
|
|
83
|
-
const
|
|
84
|
-
(
|
|
88
|
+
const s = this.countdownPanelProps.find(
|
|
89
|
+
(i) => i.crossId === a && i.roadId === o
|
|
85
90
|
);
|
|
86
|
-
if (
|
|
87
|
-
|
|
91
|
+
if (s)
|
|
92
|
+
s.lampStatus = t;
|
|
88
93
|
else {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
let i = new f({
|
|
95
|
+
x: e.panelPoint[0],
|
|
96
|
+
y: e.panelPoint[1]
|
|
97
|
+
});
|
|
98
|
+
this.view.spatialReference.isWebMercator && (i = d.geographicToWebMercator(
|
|
99
|
+
i
|
|
100
|
+
));
|
|
101
|
+
const r = this.view.toScreen(i), h = this.getPanelRotation(e.coord);
|
|
102
|
+
console.log(i.toJSON(), r), this.countdownPanelProps.push({
|
|
95
103
|
displayMode: "complex",
|
|
96
|
-
crossId:
|
|
104
|
+
crossId: a,
|
|
97
105
|
roadId: o,
|
|
98
|
-
mapPoint:
|
|
106
|
+
mapPoint: e.panelPoint,
|
|
99
107
|
// 定位点地理坐标
|
|
100
108
|
stopLine: e.coord,
|
|
101
109
|
// 关联的停止线坐标
|
|
102
|
-
position: { left:
|
|
110
|
+
position: { left: r.x, top: r.y },
|
|
103
111
|
// 定位点屏幕坐标
|
|
104
|
-
rotation:
|
|
112
|
+
rotation: h,
|
|
105
113
|
// 面板旋转角度
|
|
106
114
|
scale: this.getPanelScale(),
|
|
107
115
|
lampStatus: t
|
|
@@ -112,7 +120,7 @@ class L extends P {
|
|
|
112
120
|
}
|
|
113
121
|
clearSignal() {
|
|
114
122
|
var n;
|
|
115
|
-
this.stopLineLayer.removeAll(), this.countdownPanelProps =
|
|
123
|
+
this.stopLineLayer.removeAll(), this.countdownPanelProps.length = 0, (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
|
|
116
124
|
}
|
|
117
125
|
/**
|
|
118
126
|
* 从停止线坐标计算面板旋转角度
|
|
@@ -120,18 +128,26 @@ class L extends P {
|
|
|
120
128
|
* @returns
|
|
121
129
|
*/
|
|
122
130
|
getPanelRotation(n) {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const a = n[0];
|
|
132
|
+
let c = new f({
|
|
133
|
+
x: a[0],
|
|
134
|
+
y: a[1]
|
|
135
|
+
});
|
|
136
|
+
this.view.spatialReference.isWebMercator && (c = d.geographicToWebMercator(
|
|
137
|
+
c
|
|
138
|
+
));
|
|
139
|
+
const p = this.view.toScreen(c), l = n[n.length - 1];
|
|
140
|
+
let t = new f({
|
|
141
|
+
x: l[0],
|
|
142
|
+
y: l[1]
|
|
143
|
+
});
|
|
144
|
+
this.view.spatialReference.isWebMercator && (t = d.geographicToWebMercator(
|
|
145
|
+
t
|
|
146
|
+
));
|
|
147
|
+
const o = this.view.toScreen(t), e = o.x - p.x, s = o.y - p.y;
|
|
148
|
+
return Math.atan2(s, e) * (180 / Math.PI);
|
|
133
149
|
}
|
|
134
150
|
}
|
|
135
151
|
export {
|
|
136
|
-
|
|
152
|
+
S as default
|
|
137
153
|
};
|
|
@@ -186,7 +186,7 @@ class v {
|
|
|
186
186
|
drawCountdownText(e, t) {
|
|
187
187
|
const a = e.getContext("2d");
|
|
188
188
|
a.clearRect(0, 0, e.width, e.height), a.font = "24px Digital", a.textBaseline = "middle", a.textAlign = "center", a.fillStyle = t.stageRemainingTime <= t.stageAllRedTime ? "red" : t.stageRemainingTime <= t.stageAllRedTime + t.stageYellowTime ? "yellow" : "lime", a.fillText(
|
|
189
|
-
`${t.
|
|
189
|
+
`${t.stageRemainingTime.toFixed(0)}`,
|
|
190
190
|
e.width / 2,
|
|
191
191
|
e.height / 2
|
|
192
192
|
);
|