gisviewer-vue3-arcgis 1.0.154 → 1.0.156
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 -2
- package/es/src/gis-map/gis-map.vue.mjs +120 -116
- package/es/src/gis-map/index.d.ts +3 -1
- package/es/src/gis-map/utils/holo-flow/index.d.ts +1 -2
- package/es/src/gis-map/utils/holo-flow/index.mjs +19 -12
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +9 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +43 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +3 -4
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +52 -46
- package/es/src/gis-map/utils/overlay.d.ts +3 -1
- package/es/src/gis-map/utils/overlay.mjs +75 -43
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +8 -4
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +216 -137
- package/es/src/types/index.d.ts +5 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -2
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +3 -1
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +1 -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 +9 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +3 -4
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/gis-map/utils/overlay.d.ts +3 -1
- package/lib/src/gis-map/utils/overlay.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.d.ts +8 -4
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as u from "@arcgis/core/core/reactiveUtils.js";
|
|
2
|
+
import { Polyline as g } from "@arcgis/core/geometry";
|
|
3
|
+
import * as y from "@arcgis/core/geometry/geometryEngine.js";
|
|
4
|
+
import a from "@arcgis/core/Graphic";
|
|
3
5
|
import l from "@arcgis/core/layers/GraphicsLayer";
|
|
4
6
|
import f from "@turf/buffer";
|
|
5
|
-
import
|
|
6
|
-
import m from "@turf/convex";
|
|
7
|
+
import b from "@turf/concave";
|
|
7
8
|
import * as n from "@turf/helpers";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import C from "axios";
|
|
10
|
+
import S from "../../stores/index.mjs";
|
|
11
|
+
import m from "../common-utils.mjs";
|
|
12
|
+
import v from "./district-controller.mjs";
|
|
13
|
+
class k {
|
|
11
14
|
constructor(e) {
|
|
12
|
-
this.crossScale = 5e3, this.
|
|
15
|
+
this.districtControllers = [], this.crossScale = 5e3, this.loadedSubDistricts = [], this.view = e;
|
|
16
|
+
const i = S.useAppDataStore.mapConfig;
|
|
17
|
+
this.openDriveServerUrl = i.openDriveServer.url, this.districtControllerLayer = new l({
|
|
13
18
|
id: "districtControllerLayer",
|
|
14
19
|
maxScale: 144447,
|
|
15
20
|
minScale: 1155582
|
|
@@ -30,82 +35,80 @@ class M {
|
|
|
30
35
|
this.highlightLayer
|
|
31
36
|
]);
|
|
32
37
|
}
|
|
33
|
-
showSignalControlArea(e) {
|
|
34
|
-
this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
|
|
35
|
-
for (const
|
|
36
|
-
const
|
|
37
|
-
this.
|
|
38
|
+
async showSignalControlArea(e) {
|
|
39
|
+
console.time("showSignalControlArea"), this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
|
|
40
|
+
for (const r of e) {
|
|
41
|
+
const i = new v(r);
|
|
42
|
+
this.showDistrict(i), this.districtControllers.push(i);
|
|
38
43
|
}
|
|
39
|
-
|
|
44
|
+
this.watchHandle = u.watch(
|
|
40
45
|
() => this.view.scale,
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
(r, i) => {
|
|
47
|
+
r > this.crossScale && i <= this.crossScale ? (this.crossLayer.graphics.forEach((t) => {
|
|
48
|
+
t.symbol = this.getCrossGraphicSymbol(
|
|
49
|
+
t.attributes,
|
|
45
50
|
"marker"
|
|
46
51
|
);
|
|
47
|
-
}), this.highlightLayer.graphics.forEach((
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
}), this.highlightLayer.graphics.forEach((t) => {
|
|
53
|
+
t.getAttribute("type") === "cross" && (t.symbol = this.getCrossGraphicSymbol(
|
|
54
|
+
t.attributes,
|
|
50
55
|
"marker"
|
|
51
56
|
));
|
|
52
|
-
})) :
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
})) : r <= this.crossScale && i > this.crossScale && (this.crossLayer.graphics.forEach((t) => {
|
|
58
|
+
t.symbol = this.getCrossGraphicSymbol(
|
|
59
|
+
t.attributes,
|
|
55
60
|
"picture"
|
|
56
61
|
);
|
|
57
|
-
}), this.highlightLayer.graphics.forEach((
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
}), this.highlightLayer.graphics.forEach((t) => {
|
|
63
|
+
t.getAttribute("type") === "cross" && (t.symbol = this.getCrossGraphicSymbol(
|
|
64
|
+
t.attributes,
|
|
60
65
|
"picture"
|
|
61
66
|
));
|
|
62
67
|
}));
|
|
63
68
|
}
|
|
64
|
-
)
|
|
69
|
+
);
|
|
70
|
+
for (const r of this.districtControllers)
|
|
71
|
+
for (const i of r.subDistricts)
|
|
72
|
+
await this.showSubDistrictRoad(i);
|
|
73
|
+
return console.timeEnd("showSignalControlArea"), { status: 0, message: "ok" };
|
|
65
74
|
}
|
|
66
75
|
clearSignalControlArea() {
|
|
67
76
|
var e;
|
|
68
77
|
return this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), (e = this.watchHandle) == null || e.remove(), this.view.closePopup(), { status: 0, message: "ok" };
|
|
69
78
|
}
|
|
70
79
|
async locateSignalControlArea(e) {
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
target:
|
|
80
|
+
const r = this.findAreaGraphic(e.id);
|
|
81
|
+
return r ? (r[0].attributes.type === "cross" ? await this.view.goTo({
|
|
82
|
+
target: r,
|
|
74
83
|
scale: 1500
|
|
75
|
-
}) : await this.view.goTo(
|
|
84
|
+
}) : await this.view.goTo(r), { status: 0, message: "ok" }) : { status: 1, message: "未找到" };
|
|
76
85
|
}
|
|
77
86
|
showPopup(e) {
|
|
78
|
-
const
|
|
87
|
+
const r = e.geometry.type === "point" ? e.geometry : e.geometry.centroid;
|
|
79
88
|
this.view.openPopup({
|
|
80
89
|
features: [e],
|
|
81
|
-
location:
|
|
90
|
+
location: r
|
|
82
91
|
});
|
|
83
92
|
}
|
|
84
93
|
async highlightSignalControlArea(e) {
|
|
85
94
|
if (!e.id || e.id === "")
|
|
86
95
|
return { status: 1, message: "请输入id" };
|
|
87
96
|
this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.crossLayer.visible = !1;
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
} else
|
|
104
|
-
s.length > 1 ? await this.view.goTo(s) : await this.view.goTo({
|
|
105
|
-
target: s[0].geometry,
|
|
106
|
-
scale: 1500
|
|
107
|
-
});
|
|
108
|
-
return { status: 0, message: "ok" };
|
|
97
|
+
for (const s of this.districtControllers)
|
|
98
|
+
for (const o of s.subDistricts)
|
|
99
|
+
(o.id === e.id || o.parentId === e.id) && await this.showSubDistrictRoad(o);
|
|
100
|
+
const r = this.districtControllerLayer.graphics.filter((s) => s.getAttribute("id") === e.id).toArray().map((s) => s.clone()), i = this.subDistrictControllerLayer.graphics.filter(
|
|
101
|
+
(s) => s.getAttribute("districtId") === e.id || s.getAttribute("subDistrictId") === e.id
|
|
102
|
+
).toArray().map((s) => s.clone()), t = this.crossLayer.graphics.filter(
|
|
103
|
+
(s) => s.getAttribute("id") === e.id || s.getAttribute("districtId") === e.id || s.getAttribute("subDistrictId") === e.id
|
|
104
|
+
).toArray().map((s) => s.clone());
|
|
105
|
+
return r.length > 0 && this.highlightLayer.addMany(r), i.length > 0 && this.highlightLayer.addMany(i), t.length > 0 && this.highlightLayer.addMany(t), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (r.length > 0 ? await this.view.goTo(r) : i.length > 0 ? await this.view.goTo({
|
|
106
|
+
target: i,
|
|
107
|
+
scale: this.crossScale - 500
|
|
108
|
+
}) : t.length > 1 ? await this.view.goTo(t) : await this.view.goTo({
|
|
109
|
+
target: t[0].geometry,
|
|
110
|
+
scale: 1500
|
|
111
|
+
}), { status: 0, message: "ok" });
|
|
109
112
|
}
|
|
110
113
|
resetHighlight() {
|
|
111
114
|
return this.highlightLayer.removeAll(), this.view.closePopup(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0, this.crossLayer.visible = !0, { status: 0, message: "ok" };
|
|
@@ -116,42 +119,35 @@ class M {
|
|
|
116
119
|
* @returns
|
|
117
120
|
*/
|
|
118
121
|
findAreaGraphic(e) {
|
|
119
|
-
let
|
|
120
|
-
(
|
|
122
|
+
let r = this.districtControllerLayer.graphics.filter(
|
|
123
|
+
(i) => i.attributes.id === e
|
|
121
124
|
);
|
|
122
|
-
|
|
123
|
-
(
|
|
124
|
-
)),
|
|
125
|
+
if (r || (r = this.subDistrictControllerLayer.graphics.filter(
|
|
126
|
+
(i) => i.attributes.getAttribute("subDistrictId") === e
|
|
127
|
+
)), r || (r = this.crossLayer.graphics.filter((i) => i.attributes.id === e)), r.length !== 0)
|
|
128
|
+
return r.toArray();
|
|
125
129
|
}
|
|
126
130
|
/**
|
|
127
|
-
*
|
|
131
|
+
* 显示区控
|
|
128
132
|
* @param districtController
|
|
129
|
-
* @param isDistrict 是否是区控
|
|
130
133
|
* @returns
|
|
131
134
|
*/
|
|
132
|
-
|
|
135
|
+
showDistrict(e) {
|
|
133
136
|
const r = e.getAllCrossCoordinates();
|
|
134
137
|
if (r.length >= 2) {
|
|
135
|
-
let
|
|
138
|
+
let t = null;
|
|
136
139
|
if (r.length === 2)
|
|
137
|
-
|
|
140
|
+
t = n.lineString(r);
|
|
138
141
|
else if (r.length > 2) {
|
|
139
|
-
const
|
|
140
|
-
r.map((
|
|
142
|
+
const p = n.featureCollection(
|
|
143
|
+
r.map((d) => n.point(d))
|
|
141
144
|
);
|
|
142
|
-
t
|
|
145
|
+
t = b(p);
|
|
143
146
|
}
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
t ? 200 : 30,
|
|
149
|
-
{
|
|
150
|
-
units: "meters"
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
let a;
|
|
154
|
-
t ? a = [
|
|
147
|
+
t || (t = n.lineString(r));
|
|
148
|
+
const s = f(t.geometry, 200, {
|
|
149
|
+
units: "meters"
|
|
150
|
+
}), o = [
|
|
155
151
|
{
|
|
156
152
|
fieldName: "id",
|
|
157
153
|
label: "区控编号"
|
|
@@ -164,17 +160,7 @@ class M {
|
|
|
164
160
|
fieldName: "subDistrictCount",
|
|
165
161
|
label: "子区数量"
|
|
166
162
|
}
|
|
167
|
-
]
|
|
168
|
-
{
|
|
169
|
-
fieldName: "parentName",
|
|
170
|
-
label: "所属区控"
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
fieldName: "crossCount",
|
|
174
|
-
label: "路口数量"
|
|
175
|
-
}
|
|
176
|
-
];
|
|
177
|
-
const g = {
|
|
163
|
+
], h = {
|
|
178
164
|
type: "signalControlArea",
|
|
179
165
|
id: e.id,
|
|
180
166
|
name: e.name,
|
|
@@ -182,59 +168,60 @@ class M {
|
|
|
182
168
|
parentName: e.parentName,
|
|
183
169
|
crossCount: e.crossCount,
|
|
184
170
|
subDistrictCount: e.subDistrictCount
|
|
185
|
-
}, c = new
|
|
171
|
+
}, c = new a({
|
|
186
172
|
geometry: {
|
|
187
173
|
type: "polygon",
|
|
188
|
-
rings:
|
|
174
|
+
rings: s.geometry.coordinates
|
|
189
175
|
},
|
|
190
176
|
symbol: {
|
|
191
177
|
type: "simple-fill",
|
|
192
|
-
color: [...e.areaColor,
|
|
178
|
+
color: [...e.areaColor, 0.1],
|
|
193
179
|
outline: {
|
|
194
180
|
color: e.areaColor,
|
|
195
|
-
width: 2
|
|
196
|
-
style: t ? "solid" : "long-dash"
|
|
181
|
+
width: 2
|
|
197
182
|
}
|
|
198
183
|
},
|
|
199
|
-
attributes:
|
|
184
|
+
attributes: h,
|
|
200
185
|
popupTemplate: {
|
|
201
|
-
title:
|
|
186
|
+
title: `区控 ${e.name}`,
|
|
202
187
|
content: [
|
|
203
188
|
{
|
|
204
189
|
type: "fields",
|
|
205
|
-
fieldInfos:
|
|
190
|
+
fieldInfos: o
|
|
206
191
|
}
|
|
207
192
|
]
|
|
208
193
|
}
|
|
209
194
|
});
|
|
210
|
-
|
|
195
|
+
this.districtControllerLayer.add(c);
|
|
211
196
|
}
|
|
212
|
-
for (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
197
|
+
for (let t = 0; t < e.subDistricts.length; t++) {
|
|
198
|
+
const s = e.subDistricts[t];
|
|
199
|
+
this.showSubDistrictCross(s);
|
|
200
|
+
}
|
|
201
|
+
const i = [];
|
|
202
|
+
e.crosses = e.crosses.filter(
|
|
203
|
+
(t) => m.isCoordinateValid(t)
|
|
204
|
+
), e.crosses.forEach((t) => {
|
|
205
|
+
if (m.isCoordinateValid(t)) {
|
|
206
|
+
const s = {
|
|
218
207
|
type: "cross",
|
|
219
|
-
id:
|
|
220
|
-
name:
|
|
208
|
+
id: t.id,
|
|
209
|
+
name: t.name,
|
|
221
210
|
color: e.areaColor,
|
|
222
|
-
signalId:
|
|
223
|
-
districtId:
|
|
224
|
-
districtName:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
isKey: i.isKey
|
|
228
|
-
}, a = new y({
|
|
211
|
+
signalId: t.signalId,
|
|
212
|
+
districtId: e.id,
|
|
213
|
+
districtName: e.name,
|
|
214
|
+
isKey: t.isKey
|
|
215
|
+
}, o = new a({
|
|
229
216
|
geometry: {
|
|
230
217
|
type: "point",
|
|
231
|
-
x:
|
|
232
|
-
y:
|
|
218
|
+
x: t.longitude,
|
|
219
|
+
y: t.latitude
|
|
233
220
|
},
|
|
234
|
-
symbol: this.getCrossGraphicSymbol(
|
|
235
|
-
attributes:
|
|
221
|
+
symbol: this.getCrossGraphicSymbol(s, "marker"),
|
|
222
|
+
attributes: s,
|
|
236
223
|
popupTemplate: {
|
|
237
|
-
title:
|
|
224
|
+
title: t.name,
|
|
238
225
|
content: [
|
|
239
226
|
{
|
|
240
227
|
type: "fields",
|
|
@@ -243,10 +230,6 @@ class M {
|
|
|
243
230
|
fieldName: "districtName",
|
|
244
231
|
label: "区控名称"
|
|
245
232
|
},
|
|
246
|
-
{
|
|
247
|
-
fieldName: "subDistrictName",
|
|
248
|
-
label: "子区名称"
|
|
249
|
-
},
|
|
250
233
|
{
|
|
251
234
|
fieldName: "id",
|
|
252
235
|
label: "路口编号"
|
|
@@ -260,10 +243,106 @@ class M {
|
|
|
260
243
|
]
|
|
261
244
|
}
|
|
262
245
|
});
|
|
263
|
-
|
|
246
|
+
i.push(o);
|
|
264
247
|
} else
|
|
265
|
-
console.log("路口坐标无效",
|
|
266
|
-
}), this.crossLayer.addMany(
|
|
248
|
+
console.log("路口坐标无效", t);
|
|
249
|
+
}), this.crossLayer.addMany(i);
|
|
250
|
+
}
|
|
251
|
+
showSubDistrictCross(e) {
|
|
252
|
+
const r = [];
|
|
253
|
+
e.crosses = e.crosses.filter(
|
|
254
|
+
(i) => m.isCoordinateValid(i)
|
|
255
|
+
), e.crosses.forEach((i) => {
|
|
256
|
+
const t = {
|
|
257
|
+
type: "cross",
|
|
258
|
+
id: i.id,
|
|
259
|
+
name: i.name,
|
|
260
|
+
color: e.areaColor,
|
|
261
|
+
signalId: i.signalId,
|
|
262
|
+
districtId: e.parentId,
|
|
263
|
+
districtName: e.parentName,
|
|
264
|
+
subDistrictId: e.id,
|
|
265
|
+
subDistrictName: e.name,
|
|
266
|
+
isKey: i.isKey
|
|
267
|
+
}, s = new a({
|
|
268
|
+
geometry: {
|
|
269
|
+
type: "point",
|
|
270
|
+
x: i.longitude,
|
|
271
|
+
y: i.latitude
|
|
272
|
+
},
|
|
273
|
+
symbol: this.getCrossGraphicSymbol(t, "marker"),
|
|
274
|
+
attributes: t,
|
|
275
|
+
popupTemplate: {
|
|
276
|
+
title: i.name,
|
|
277
|
+
content: [
|
|
278
|
+
{
|
|
279
|
+
type: "fields",
|
|
280
|
+
fieldInfos: [
|
|
281
|
+
{
|
|
282
|
+
fieldName: "districtName",
|
|
283
|
+
label: "区控名称"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
fieldName: "subDistrictName",
|
|
287
|
+
label: "子区名称"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
fieldName: "id",
|
|
291
|
+
label: "路口编号"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
fieldName: "signalId",
|
|
295
|
+
label: "信号机编号"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
r.push(s);
|
|
303
|
+
}), this.crossLayer.addMany(r);
|
|
304
|
+
}
|
|
305
|
+
async showSubDistrictRoad(e) {
|
|
306
|
+
if (e.crosses.length > 1 && !this.loadedSubDistricts.includes(e.id) && this.openDriveServerUrl && this.openDriveServerUrl !== "") {
|
|
307
|
+
this.loadedSubDistricts.push(e.id);
|
|
308
|
+
const r = await C.get(
|
|
309
|
+
`http://${this.openDriveServerUrl}/api/computable/getRoadsectWithinJunctions`,
|
|
310
|
+
{
|
|
311
|
+
params: {
|
|
312
|
+
junctionIds: e.crosses.map((i) => i.id).join(",")
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
if (r.status === 200) {
|
|
317
|
+
const i = r.data.result;
|
|
318
|
+
if (i.length > 0) {
|
|
319
|
+
const t = i.map((c) => new g({ paths: [c] })), s = y.geodesicBuffer(
|
|
320
|
+
t,
|
|
321
|
+
5,
|
|
322
|
+
"meters"
|
|
323
|
+
), o = y.union(
|
|
324
|
+
s
|
|
325
|
+
), h = new a({
|
|
326
|
+
geometry: o,
|
|
327
|
+
symbol: {
|
|
328
|
+
type: "simple-fill",
|
|
329
|
+
color: [...e.areaColor, 0.8],
|
|
330
|
+
outline: {
|
|
331
|
+
color: e.areaColor,
|
|
332
|
+
width: 1
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
attributes: {
|
|
336
|
+
districtId: e.parentId,
|
|
337
|
+
districtName: e.parentName,
|
|
338
|
+
subDistrictId: e.id,
|
|
339
|
+
subDistrictName: e.name
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
this.subDistrictControllerLayer.add(h);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
267
346
|
}
|
|
268
347
|
/**
|
|
269
348
|
* 生成路口点符号。在不同比例尺下,使用不同的符号
|
|
@@ -271,10 +350,10 @@ class M {
|
|
|
271
350
|
* @param symbolType
|
|
272
351
|
* @returns
|
|
273
352
|
*/
|
|
274
|
-
getCrossGraphicSymbol(e,
|
|
275
|
-
const { isKey:
|
|
276
|
-
if (
|
|
277
|
-
return
|
|
353
|
+
getCrossGraphicSymbol(e, r) {
|
|
354
|
+
const { isKey: i, color: t } = e;
|
|
355
|
+
if (r === "marker")
|
|
356
|
+
return i ? {
|
|
278
357
|
type: "picture-marker",
|
|
279
358
|
url: "/GisViewerAssets/Images/icon_star.png",
|
|
280
359
|
width: "30px",
|
|
@@ -282,14 +361,14 @@ class M {
|
|
|
282
361
|
} : {
|
|
283
362
|
type: "simple-marker",
|
|
284
363
|
style: "circle",
|
|
285
|
-
color:
|
|
364
|
+
color: t,
|
|
286
365
|
size: 8,
|
|
287
366
|
outline: {
|
|
288
367
|
color: "white",
|
|
289
368
|
width: 1
|
|
290
369
|
}
|
|
291
370
|
};
|
|
292
|
-
if (
|
|
371
|
+
if (r === "picture")
|
|
293
372
|
return {
|
|
294
373
|
type: "cim",
|
|
295
374
|
data: {
|
|
@@ -328,7 +407,7 @@ class M {
|
|
|
328
407
|
height: 12,
|
|
329
408
|
horizontalAlignment: "Center",
|
|
330
409
|
offsetX: 0,
|
|
331
|
-
offsetY:
|
|
410
|
+
offsetY: i ? 60 : 40,
|
|
332
411
|
haloSize: 1,
|
|
333
412
|
haloSymbol: {
|
|
334
413
|
type: "CIMPolygonSymbol",
|
|
@@ -367,11 +446,11 @@ class M {
|
|
|
367
446
|
y: 0
|
|
368
447
|
},
|
|
369
448
|
anchorPointUnits: "Relative",
|
|
370
|
-
size:
|
|
449
|
+
size: i ? 45 : 30,
|
|
371
450
|
rotateClockwise: !0,
|
|
372
451
|
textureFilter: "Picture",
|
|
373
|
-
url: `/GisViewerAssets/Images/xhj_${
|
|
374
|
-
offsetY:
|
|
452
|
+
url: `/GisViewerAssets/Images/xhj_${i ? 4 : 1}.png`,
|
|
453
|
+
offsetY: i ? 22 : 15
|
|
375
454
|
}
|
|
376
455
|
]
|
|
377
456
|
}
|
|
@@ -380,5 +459,5 @@ class M {
|
|
|
380
459
|
}
|
|
381
460
|
}
|
|
382
461
|
export {
|
|
383
|
-
|
|
462
|
+
k as default
|
|
384
463
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -129,6 +129,11 @@ export interface IOverlay {
|
|
|
129
129
|
symbol?: IPointSymbol | ILineSymbol | IPolygonSymbol;
|
|
130
130
|
properties?: any;
|
|
131
131
|
}
|
|
132
|
+
export interface IMaskParam {
|
|
133
|
+
geometry: IPolygon;
|
|
134
|
+
maskColor?: number[];
|
|
135
|
+
maskSize?: number;
|
|
136
|
+
}
|
|
132
137
|
export interface IOverlayParam {
|
|
133
138
|
type?: string;
|
|
134
139
|
defaultSymbol?: IPointSymbol | ILineSymbol | IPolygonSymbol;
|
|
@@ -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, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
3
|
+
import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, 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';
|
|
@@ -63,6 +63,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
63
63
|
toggleTrafficObject: (params: IToggleTrafficInfoParams) => void;
|
|
64
64
|
toggleVehicleInfo: (contentType: string) => void;
|
|
65
65
|
addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
|
|
66
|
+
addMask: (params: IMaskParam) => void;
|
|
67
|
+
removeMask: () => void;
|
|
66
68
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
67
69
|
removeOverlaysById: (ids: string[]) => import("../types").IResult;
|
|
68
70
|
removeAllOverlays: () => import("../types").IResult;
|
|
@@ -82,7 +84,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
82
84
|
status: number;
|
|
83
85
|
message: string;
|
|
84
86
|
}>;
|
|
85
|
-
showSignalControlArea: (params: any) => import("../types").IResult
|
|
87
|
+
showSignalControlArea: (params: any) => Promise<import("../types").IResult>;
|
|
86
88
|
clearSignalControlArea: () => void;
|
|
87
89
|
locateSignalControlArea: (params: {
|
|
88
90
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),y=require("./stores/index.js");require("./style/index.css");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),y=require("./stores/index.js");require("./style/index.css");const De=require("./utils/holo-flow/index.js"),Le=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),C=require("./utils/overlay.js"),Ae=require("./utils/queue-length.js"),k=require("./utils/road-config-tool/index.js"),Ie=require("./utils/signal-control-area-controller/index.js"),be=require("./utils/traffic-flow.js"),qe={class:"gis-viewer"},Me={style:{position:"absolute",bottom:"10px",left:"10px"}},_e=o.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:D,emit:L}){const p=o.ref(null);let c,l,i,r,n,a,m,t,s;const d=o.ref(!1);o.onMounted(async()=>{if(y.registerStore(),!p.value)return;document.addEventListener("keydown",g=>{g.ctrlKey&&g.key==="i"&&(d.value=!d.value)});const e=o.getCurrentInstance(),{$gisviewerAssetsRoot:u}=e.appContext.config.globalProperties,S=await(await fetch(h.config)).json();S.assetsRoot=h.assetsRoot||u;const ke=y.default.useAppDataStore;ke.mapConfig=S,l=new Le.default,c=await l.initialize({container:p.value,markerClickCallback:(g,w,v,Te)=>{f("markerClick",g,w,v,Te)},mapClickCallback:(g,w,v)=>{f("mapClick",g,w,v)}}),n=new De.default(c),await n.init(),f("mapLoaded")}),o.onUnmounted(()=>{s==null||s.clearSignalControlArea(),t==null||t.clearOpenDrive(),n==null||n.clearHoloTrace(),n==null||n.clearHoloSignal(),r==null||r.disconnectTrafficFlow()});const A=o.computed(()=>c),I=()=>{const e=y.default.useAppDataStore;e.saveTrackLog=!0},b=()=>{n.downloadTrackLog()},q=async e=>await l.setMapCenter(e),M=async e=>await l.setMapCamera(e),_=async e=>await l.lookAt(e),x=e=>l.setLayerVisibility(e),H=(e,u)=>l.requestCoordinateTransform(e,u),V=e=>{l.cancelCoordinateTransform(e)},N=e=>{l.setMapZoomRange(e)},B=e=>(i||(i=new k.default(c)),i.showLaneNumber(e)),E=()=>{i==null||i.clearLaneNumber()},j=async e=>(i||(i=new k.default(c)),await i.initializeSearch(e)),z=async()=>i==null?void 0:i.calCrossIndicatorArea(),P=async()=>{},Q=async(e,u)=>{r||(r=new be.default(c)),r.connectTrafficFlow(e,u)},F=()=>{r==null||r.disconnectTrafficFlow()},Z=e=>{n.handleVehicleTraceData(e)},K=()=>{n.clearHoloTrace()},U=e=>{n.setInterpolate(e)},G=async e=>{await n.handleSignalData(e)},J=()=>{n.clearHoloSignal()},W=e=>{r==null||r.toggleTrafficInfo(e),n.toggleTrafficInfo(e)},X=e=>{n.togglePause(e)},Y=e=>{r==null||r.toggleTrafficObject(e),n.toggleTrafficObject(e)},R=e=>{n.updatePanelContent(e)},$=async e=>(a||(a=new C.default(c)),a.addOverlays(e)),ee=e=>(a||(a=new C.default(c)),a.addMask(e)),te=()=>{a==null||a.removeMask()},ae=e=>a==null?void 0:a.removeOverlaysByType(e),ne=e=>a==null?void 0:a.removeOverlaysById(e),re=()=>a==null?void 0:a.removeAllOverlays(),se=()=>{a==null||a.showAllOverlays()},oe=e=>{m||(m=new Ae.default(c)),m.updateQueueLength(e)},ce=()=>{m==null||m.removeQueueLength()},ie=async(e,u)=>(t||(t=new O.default(c)),await t.showOpenDriveFromServer(e,u)),le=async e=>(t||(t=new O.default(c)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),ue=async()=>await(t==null?void 0:t.clearOpenDrive()),me=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ge=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},pe=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},de=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},fe=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},ve=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},ye=async e=>(s||(s=new Ie.default(c)),await s.showSignalControlArea(e)),he=()=>{s==null||s.clearSignalControlArea()},Se=async e=>s?await s.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Oe=async e=>s?await s.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ce=()=>s?s.resetHighlight():{status:-1,message:"未加载信号控制区"},h=T,f=L;return D({mapViewer:A,setLayerVisibility:x,setMapCenter:q,lookAt:_,setMapCamera:M,setMapZoomRange:N,requestCoordinateTransform:H,cancelCoordinateTransform:V,addOverlays:$,addMask:ee,removeMask:te,showAllOverlays:se,removeOverlaysByType:ae,removeOverlaysById:ne,removeAllOverlays:re,showLaneNumber:B,clearLaneNumber:E,initializeAreaTool:j,calCrossIndicatorArea:z,calRoadIndicatorArea:P,connectCarFlow:Q,disconnectCarFlow:F,handleHoloVehicleTraceData:Z,clearHoloTrace:K,handleHoloSignalData:G,clearHoloSignal:J,setInterpolate:U,toggleTrafficInfo:W,toggleTrafficObject:Y,toggleVehicleInfo:R,togglePause:X,updateQueueLength:oe,removeQueueLength:ce,showOpenDriveFromServer:ie,showOpenDriveFromFile:le,clearOpenDrive:ue,geometrySearchInOpenDrive:de,findSumoInOpenDrive:me,selectSumoInOpenDrive:ge,unselectSumoInOpenDrive:pe,getSumoInfo:fe,splitOpenDriveLane:we,clearSplitOpenDriveLane:ve,showSignalControlArea:ye,clearSignalControlArea:he,locateSignalControlArea:Se,highlightSignalControlArea:Oe,resetHighlightSignalControlArea:Ce}),(e,u)=>(o.openBlock(),o.createElementBlock("div",qe,[o.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[o.withDirectives(o.createElementVNode("div",Me,[o.createElementVNode("button",{style:{"margin-right":"10px"},onClick:I}," 开始记录 "),o.createElementVNode("button",{onClick:b},"下载日志")],512),[[o.vShow,d.value]])],512)]))}});exports.default=_e;
|
|
@@ -52,6 +52,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
52
52
|
toggleTrafficObject: (params: import("../types").IToggleTrafficInfoParams) => void;
|
|
53
53
|
toggleVehicleInfo: (contentType: string) => void;
|
|
54
54
|
addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
|
|
55
|
+
addMask: (params: import("../types").IMaskParam) => void;
|
|
56
|
+
removeMask: () => void;
|
|
55
57
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
56
58
|
removeOverlaysById: (ids: string[]) => import("../types").IResult;
|
|
57
59
|
removeAllOverlays: () => import("../types").IResult;
|
|
@@ -71,7 +73,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
71
73
|
status: number;
|
|
72
74
|
message: string;
|
|
73
75
|
}>;
|
|
74
|
-
showSignalControlArea: (params: any) => import("../types").IResult
|
|
76
|
+
showSignalControlArea: (params: any) => Promise<import("../types").IResult>;
|
|
75
77
|
clearSignalControlArea: () => void;
|
|
76
78
|
locateSignalControlArea: (params: {
|
|
77
79
|
id: string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import View from '@arcgis/core/views/View';
|
|
2
1
|
import { IToggleTrafficInfoParams } from '../../../types';
|
|
3
2
|
export default class Index {
|
|
4
3
|
private readonly view;
|
|
5
4
|
private traceHoloFlow;
|
|
6
5
|
private signalHoloFlow;
|
|
7
|
-
constructor(view:
|
|
6
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
8
7
|
init(): Promise<void>;
|
|
9
8
|
/**
|
|
10
9
|
* 处理全息流轨迹数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../types/index.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../types/index.js"),i=require("../../stores/index.js"),s=require("./signal-holo-flow.js"),n=require("./signal-holo-flow-lsr.js"),c=require("./trace-holo-flow.js");class r{constructor(e){this.view=e}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=i.default.useAppDataStore;((l=(o=JSON.parse(JSON.stringify(a.mapConfig)).holoFlow)==null?void 0:o.signal)==null?void 0:l.style)==="LSR"?this.signalHoloFlow=new n.default(this.view):this.signalHoloFlow=new s.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=r;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import SignalHoloFlow from './signal-holo-flow';
|
|
2
|
+
export default class LSRSignalHoloFlow extends SignalHoloFlow {
|
|
3
|
+
private stopLineLayer;
|
|
4
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
5
|
+
private stopLineMap;
|
|
6
|
+
initializeLayer(): Promise<void>;
|
|
7
|
+
handleSignalData(data: any): Promise<void>;
|
|
8
|
+
clearSignal(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),d=require("@arcgis/core/layers/GraphicsLayer"),h=require("./signal-holo-flow.js");class y extends h.default{constructor(e){super(e),this.stopLineLayer=new d,this.stopLineMap=new Map,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var s,i;console.time("初始化停止线图层");let e=(i=(s=this.mapConfig.holoFlow)==null?void 0:s.signal)==null?void 0:i.stopLineLayer;if(!e)return;e=this.mapConfig.assetsRoot+"/"+e;const o=await(await fetch(e)).json();console.log(o.features.length),o.features.forEach(t=>{const{roadId:n,nodeId:r}=t.properties,{coordinates:l}=t.geometry,p=this.stopLineMap.get(r);p?p.set(n,l):this.stopLineMap.set(r,new Map([[n,l]]))}),console.timeEnd("初始化停止线图层"),console.log(this.stopLineMap.size)}async handleSignalData(e){const{crossId:a}=e,o=this.stopLineMap.get(a);o&&o.forEach((s,i)=>{const t=new c({geometry:{type:"polyline",paths:[s]},symbol:{type:"simple-line",color:[255,0,0],width:4}});this.stopLineLayer.add(t)})}clearSignal(){}}exports.default=y;
|