gisviewer-vue3-arcgis 1.0.170 → 1.0.172
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 +98 -99
- package/es/src/gis-map/index.d.ts +2 -2
- 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-holo-flow-lsr.d.ts +3 -8
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +94 -95
- 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/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/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-holo-flow-lsr.d.ts +3 -8
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.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/package.json +1 -1
|
@@ -1,112 +1,115 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Point as
|
|
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";
|
|
3
4
|
import P from "@arcgis/core/layers/GraphicsLayer";
|
|
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);
|
|
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);
|
|
13
9
|
}
|
|
14
10
|
async initializeLayer() {
|
|
15
|
-
var
|
|
11
|
+
var p, l;
|
|
16
12
|
console.time("初始化停止线图层");
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
13
|
+
let n = (l = (p = this.mapConfig.holoFlow) == null ? void 0 : p.signal) == null ? void 0 : l.stopLineLayer;
|
|
14
|
+
if (!n)
|
|
19
15
|
return;
|
|
20
|
-
|
|
21
|
-
const { roadId:
|
|
22
|
-
|
|
23
|
-
coord:
|
|
24
|
-
panelPoint:
|
|
16
|
+
n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
|
|
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,
|
|
25
21
|
angle: s
|
|
26
22
|
}) : this.stopLineMap.set(
|
|
27
|
-
|
|
23
|
+
e,
|
|
28
24
|
/* @__PURE__ */ new Map([
|
|
29
25
|
[
|
|
30
|
-
|
|
31
|
-
{ coord:
|
|
26
|
+
o,
|
|
27
|
+
{ coord: r, panelPoint: i, angle: s }
|
|
32
28
|
]
|
|
33
29
|
])
|
|
34
30
|
);
|
|
35
31
|
}), console.timeEnd("初始化停止线图层");
|
|
36
32
|
}
|
|
37
33
|
getPanelScale() {
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
return
|
|
34
|
+
const n = this.view.scale;
|
|
35
|
+
let a = 1;
|
|
36
|
+
return n < 1e3 ? a = 1 : n < 2e3 ? a = 0.8 : a = 0.4, a;
|
|
41
37
|
}
|
|
42
|
-
async handleSignalData(
|
|
43
|
-
this.watchHandle || (this.watchHandle =
|
|
38
|
+
async handleSignalData(n) {
|
|
39
|
+
this.watchHandle || (this.watchHandle = w.watch(
|
|
44
40
|
() => this.view.extent,
|
|
45
41
|
() => {
|
|
42
|
+
console.log("extent changed");
|
|
46
43
|
const t = this.getPanelScale();
|
|
47
|
-
for (const
|
|
48
|
-
t !== this.currentPanelScale && (
|
|
49
|
-
const { mapPoint:
|
|
50
|
-
|
|
51
|
-
x:
|
|
52
|
-
y:
|
|
44
|
+
for (const o of this.countdownPanelProps) {
|
|
45
|
+
t !== this.currentPanelScale && (o.scale = t);
|
|
46
|
+
const { mapPoint: e } = o;
|
|
47
|
+
let s = new f({
|
|
48
|
+
x: e[0],
|
|
49
|
+
y: e[1]
|
|
53
50
|
});
|
|
54
|
-
|
|
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
|
+
}
|
|
55
59
|
}
|
|
56
60
|
this.currentPanelScale = t;
|
|
57
61
|
}
|
|
58
62
|
));
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
console.log(`没有找到路口${i}`);
|
|
63
|
+
const a = n.crossId, c = this.stopLineMap.get(a);
|
|
64
|
+
if (!c)
|
|
62
65
|
return;
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
n = l;
|
|
66
|
+
const p = n.phaseCountDownList, l = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const t of p) {
|
|
68
|
+
let o = "";
|
|
69
|
+
for (let r of t.roadIdList)
|
|
70
|
+
if (r.startsWith("-") && (r = r.slice(1)), c.has(r)) {
|
|
71
|
+
o = r;
|
|
70
72
|
break;
|
|
71
73
|
}
|
|
72
|
-
if (!
|
|
73
|
-
console.log(`没有找到对应的进口道${i}--${n}`);
|
|
74
|
+
if (!o)
|
|
74
75
|
continue;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log(`没有找到对应的方向${i}--${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)}`);
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
|
-
const s = t.direction.toLowerCase(),
|
|
82
|
-
s === "u" ? (
|
|
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);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
84
|
+
l.forEach((t, o) => {
|
|
85
|
+
const e = c.get(o);
|
|
86
|
+
if (!e)
|
|
87
87
|
return;
|
|
88
|
-
const s = this.
|
|
89
|
-
(
|
|
88
|
+
const s = this.countdownPanelProps.find(
|
|
89
|
+
(i) => i.crossId === a && i.roadId === o
|
|
90
90
|
);
|
|
91
91
|
if (s)
|
|
92
92
|
s.lampStatus = t;
|
|
93
93
|
else {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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({
|
|
100
103
|
displayMode: "complex",
|
|
101
|
-
crossId:
|
|
102
|
-
roadId:
|
|
103
|
-
mapPoint:
|
|
104
|
+
crossId: a,
|
|
105
|
+
roadId: o,
|
|
106
|
+
mapPoint: e.panelPoint,
|
|
104
107
|
// 定位点地理坐标
|
|
105
|
-
stopLine:
|
|
108
|
+
stopLine: e.coord,
|
|
106
109
|
// 关联的停止线坐标
|
|
107
|
-
position: { left:
|
|
110
|
+
position: { left: r.x, top: r.y },
|
|
108
111
|
// 定位点屏幕坐标
|
|
109
|
-
rotation:
|
|
112
|
+
rotation: h,
|
|
110
113
|
// 面板旋转角度
|
|
111
114
|
scale: this.getPanelScale(),
|
|
112
115
|
lampStatus: t
|
|
@@ -116,39 +119,35 @@ class b extends L {
|
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
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;
|
|
122
|
+
var n;
|
|
123
|
+
this.stopLineLayer.removeAll(), this.countdownPanelProps.length = 0, (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
|
|
133
124
|
}
|
|
134
125
|
/**
|
|
135
126
|
* 从停止线坐标计算面板旋转角度
|
|
136
127
|
* @param coordinates
|
|
137
128
|
* @returns
|
|
138
129
|
*/
|
|
139
|
-
getPanelRotation(
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
130
|
+
getPanelRotation(n) {
|
|
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);
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
export {
|
|
153
|
-
|
|
152
|
+
S as default
|
|
154
153
|
};
|