gisviewer-vue3-arcgis 1.0.166 → 1.0.168
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 +24 -4
- package/es/src/gis-map/gis-map.vue.mjs +144 -138
- package/es/src/gis-map/index.d.ts +24 -4
- package/es/src/gis-map/utils/common-utils.mjs +9 -9
- package/es/src/gis-map/utils/holo-flow/index.mjs +37 -36
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +17 -1
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +2 -2
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +41 -39
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +117 -71
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +6 -5
- package/es/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +2 -1
- package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +10 -9
- package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +6 -5
- package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
- package/es/src/gis-map/utils/map-initializer.mjs +121 -122
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +3 -1
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +169 -67
- package/es/src/types/index.d.ts +2 -0
- package/es/style.css +1 -1
- package/lib/src/gis-map/gis-map.vue.d.ts +24 -4
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +24 -4
- package/lib/src/gis-map/utils/common-utils.js +1 -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 +17 -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 -0
- 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 +2 -1
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.d.ts +3 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/lib/src/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as p from "@arcgis/core/core/reactiveUtils.js";
|
|
2
2
|
import y from "@arcgis/core/Graphic";
|
|
3
3
|
import h from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
-
import
|
|
4
|
+
import u from "@turf/buffer";
|
|
5
5
|
import d from "@turf/convex";
|
|
6
6
|
import * as o from "@turf/helpers";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import b from "concaveman";
|
|
8
|
+
import f from "./district-controller.mjs";
|
|
9
9
|
class x {
|
|
10
10
|
constructor(e) {
|
|
11
11
|
this.crossScale = 5e3, this.view = e, this.districtControllerLayer = new h({
|
|
12
|
-
id: "districtControllerLayer"
|
|
13
|
-
maxScale: 144447,
|
|
14
|
-
minScale: 1155582
|
|
12
|
+
id: "districtControllerLayer"
|
|
15
13
|
}), this.subDistrictControllerLayer = new h({
|
|
16
14
|
id: "subDistrictControllerLayer",
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
visible: !1
|
|
16
|
+
// maxScale: 0,
|
|
17
|
+
// minScale: 144447
|
|
19
18
|
}), this.crossLayer = new h({
|
|
20
19
|
id: "crossLayer",
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
visible: !1
|
|
21
|
+
// maxScale: 0,
|
|
22
|
+
// minScale: 36112
|
|
23
23
|
}), this.highlightLayer = new h({
|
|
24
24
|
id: "highlightLayer"
|
|
25
25
|
}), this.view.map.addMany([
|
|
@@ -30,15 +30,15 @@ class x {
|
|
|
30
30
|
]);
|
|
31
31
|
}
|
|
32
32
|
showSignalControlArea(e) {
|
|
33
|
-
this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0
|
|
33
|
+
this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0;
|
|
34
34
|
for (const t of e) {
|
|
35
|
-
const
|
|
36
|
-
this.drawArea(
|
|
35
|
+
const i = new f(t);
|
|
36
|
+
this.drawArea(i, !0);
|
|
37
37
|
}
|
|
38
|
-
return this.watchHandle =
|
|
38
|
+
return this.watchHandle = p.watch(
|
|
39
39
|
() => this.view.scale,
|
|
40
|
-
(t,
|
|
41
|
-
t > this.crossScale &&
|
|
40
|
+
(t, i) => {
|
|
41
|
+
t > this.crossScale && i <= this.crossScale ? (this.crossLayer.graphics.forEach((s) => {
|
|
42
42
|
s.symbol = this.getCrossGraphicSymbol(
|
|
43
43
|
s.attributes,
|
|
44
44
|
"marker"
|
|
@@ -48,7 +48,7 @@ class x {
|
|
|
48
48
|
s.attributes,
|
|
49
49
|
"marker"
|
|
50
50
|
));
|
|
51
|
-
})) : t <= this.crossScale &&
|
|
51
|
+
})) : t <= this.crossScale && i > this.crossScale && (this.crossLayer.graphics.forEach((s) => {
|
|
52
52
|
s.symbol = this.getCrossGraphicSymbol(
|
|
53
53
|
s.attributes,
|
|
54
54
|
"picture"
|
|
@@ -73,30 +73,23 @@ class x {
|
|
|
73
73
|
scale: 1500
|
|
74
74
|
}) : await this.view.goTo(t.geometry), { status: 0, message: "ok" }) : { status: 1, message: "未找到" };
|
|
75
75
|
}
|
|
76
|
-
showPopup(e) {
|
|
77
|
-
const t = e.geometry.type === "point" ? e.geometry : e.geometry.centroid;
|
|
78
|
-
this.view.openPopup({
|
|
79
|
-
features: [e],
|
|
80
|
-
location: t
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
76
|
async highlightSignalControlArea(e) {
|
|
84
77
|
if (!e.id || e.id === "")
|
|
85
78
|
return { status: 1, message: "请输入id" };
|
|
86
|
-
this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1
|
|
87
|
-
const t = this.districtControllerLayer.graphics.filter((
|
|
88
|
-
(
|
|
89
|
-
).toArray().map((
|
|
90
|
-
(
|
|
91
|
-
).toArray().map((
|
|
92
|
-
if (t.length > 0 && this.highlightLayer.addMany(t),
|
|
79
|
+
this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1;
|
|
80
|
+
const t = this.districtControllerLayer.graphics.filter((r) => r.getAttribute("id") === e.id).toArray().map((r) => r.clone()), i = this.subDistrictControllerLayer.graphics.filter(
|
|
81
|
+
(r) => r.getAttribute("id") === e.id || r.getAttribute("parentId") === e.id
|
|
82
|
+
).toArray().map((r) => r.clone()), s = this.crossLayer.graphics.filter(
|
|
83
|
+
(r) => r.getAttribute("id") === e.id || r.getAttribute("districtId") === e.id || r.getAttribute("subDistrictId") === e.id
|
|
84
|
+
).toArray().map((r) => r.clone());
|
|
85
|
+
if (t.length > 0 && this.highlightLayer.addMany(t), i.length > 0 && this.highlightLayer.addMany(i), s.length > 0 && this.highlightLayer.addMany(s), this.highlightLayer.graphics.length === 0)
|
|
93
86
|
return { status: 1, message: "未找到" };
|
|
94
87
|
if (t.length > 0)
|
|
95
88
|
await this.view.goTo(t);
|
|
96
|
-
else if (
|
|
97
|
-
const
|
|
89
|
+
else if (i.length > 0) {
|
|
90
|
+
const r = i[0].geometry.centroid;
|
|
98
91
|
await this.view.goTo({
|
|
99
|
-
target:
|
|
92
|
+
target: r,
|
|
100
93
|
scale: this.crossScale - 500
|
|
101
94
|
});
|
|
102
95
|
} else
|
|
@@ -107,7 +100,28 @@ class x {
|
|
|
107
100
|
return { status: 0, message: "ok" };
|
|
108
101
|
}
|
|
109
102
|
resetHighlight() {
|
|
110
|
-
return this.highlightLayer.removeAll(), this.view.closePopup(), this.districtControllerLayer.visible = !0,
|
|
103
|
+
return this.highlightLayer.removeAll(), this.view.closePopup(), this.districtControllerLayer.visible = !0, { status: 0, message: "ok" };
|
|
104
|
+
}
|
|
105
|
+
showSubSignalControlArea(e) {
|
|
106
|
+
const t = e.children;
|
|
107
|
+
console.log(t);
|
|
108
|
+
const i = t.map((s) => new y({
|
|
109
|
+
geometry: {
|
|
110
|
+
type: "point",
|
|
111
|
+
x: s.longitude,
|
|
112
|
+
y: s.latitude
|
|
113
|
+
},
|
|
114
|
+
symbol: this.getCrossGraphicInSubDistrict(),
|
|
115
|
+
attributes: {
|
|
116
|
+
id: s.id,
|
|
117
|
+
name: s.name,
|
|
118
|
+
signalId: s.signalId
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
121
|
+
return this.crossLayer.addMany(i), this.view.goTo(i), { status: 0, message: "ok" };
|
|
122
|
+
}
|
|
123
|
+
editSubSignalArea() {
|
|
124
|
+
return { status: 0, message: "ok" };
|
|
111
125
|
}
|
|
112
126
|
/**
|
|
113
127
|
* 在区控\子区\路口图层中查找对应的graphic
|
|
@@ -116,11 +130,11 @@ class x {
|
|
|
116
130
|
*/
|
|
117
131
|
findAreaGraphic(e) {
|
|
118
132
|
let t = this.districtControllerLayer.graphics.find(
|
|
119
|
-
(
|
|
133
|
+
(i) => i.attributes.id === e
|
|
120
134
|
);
|
|
121
135
|
return t || (t = this.subDistrictControllerLayer.graphics.find(
|
|
122
|
-
(
|
|
123
|
-
)), t || (t = this.crossLayer.graphics.find((
|
|
136
|
+
(i) => i.attributes.id === e
|
|
137
|
+
)), t || (t = this.crossLayer.graphics.find((i) => i.attributes.id === e)), t;
|
|
124
138
|
}
|
|
125
139
|
/**
|
|
126
140
|
* 绘制区控与子区
|
|
@@ -129,25 +143,25 @@ class x {
|
|
|
129
143
|
* @returns
|
|
130
144
|
*/
|
|
131
145
|
drawArea(e, t) {
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
let
|
|
135
|
-
if (
|
|
136
|
-
|
|
146
|
+
const i = e.getAllCrossCoordinates();
|
|
147
|
+
if (i.length >= 2) {
|
|
148
|
+
let r = null;
|
|
149
|
+
if (i.length === 2)
|
|
150
|
+
r = o.lineString(i);
|
|
137
151
|
else {
|
|
138
152
|
if (t) {
|
|
139
153
|
const n = o.featureCollection(
|
|
140
|
-
|
|
154
|
+
i.map((g) => o.point(g))
|
|
141
155
|
);
|
|
142
|
-
|
|
156
|
+
r = d(n);
|
|
143
157
|
} else {
|
|
144
|
-
const n =
|
|
145
|
-
n.length >= 4 && (
|
|
158
|
+
const n = b(i, 0.5);
|
|
159
|
+
n.length >= 4 && (r = o.polygon([n]));
|
|
146
160
|
}
|
|
147
|
-
|
|
161
|
+
r || (r = o.lineString(i));
|
|
148
162
|
}
|
|
149
|
-
const l =
|
|
150
|
-
|
|
163
|
+
const l = u(
|
|
164
|
+
r.geometry,
|
|
151
165
|
// 区控面积更大,需要更大的缓冲半径
|
|
152
166
|
t ? 200 : 30,
|
|
153
167
|
{
|
|
@@ -213,31 +227,31 @@ class x {
|
|
|
213
227
|
});
|
|
214
228
|
t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
|
|
215
229
|
}
|
|
216
|
-
for (const
|
|
217
|
-
this.drawArea(
|
|
230
|
+
for (const r of e.subDistricts)
|
|
231
|
+
this.drawArea(r, !1);
|
|
218
232
|
const s = [];
|
|
219
|
-
e.crosses.forEach((
|
|
233
|
+
e.crosses.forEach((r) => {
|
|
220
234
|
const l = {
|
|
221
235
|
type: "cross",
|
|
222
|
-
id:
|
|
223
|
-
name:
|
|
236
|
+
id: r.id,
|
|
237
|
+
name: r.name,
|
|
224
238
|
color: e.areaColor,
|
|
225
|
-
signalId:
|
|
239
|
+
signalId: r.signalId,
|
|
226
240
|
districtId: t ? e.id : e.parentId,
|
|
227
241
|
districtName: t ? e.name : e.parentName,
|
|
228
242
|
subDistrictId: t ? "" : e.id,
|
|
229
243
|
subDistrictName: t ? "" : e.name,
|
|
230
|
-
isKey:
|
|
244
|
+
isKey: r.isKey
|
|
231
245
|
}, a = new y({
|
|
232
246
|
geometry: {
|
|
233
247
|
type: "point",
|
|
234
|
-
x:
|
|
235
|
-
y:
|
|
248
|
+
x: r.longitude,
|
|
249
|
+
y: r.latitude
|
|
236
250
|
},
|
|
237
251
|
symbol: this.getCrossGraphicSymbol(l, "marker"),
|
|
238
252
|
attributes: l,
|
|
239
253
|
popupTemplate: {
|
|
240
|
-
title:
|
|
254
|
+
title: r.name,
|
|
241
255
|
content: [
|
|
242
256
|
{
|
|
243
257
|
type: "fields",
|
|
@@ -266,6 +280,94 @@ class x {
|
|
|
266
280
|
s.push(a);
|
|
267
281
|
}), this.crossLayer.addMany(s);
|
|
268
282
|
}
|
|
283
|
+
getCrossGraphicInSubDistrict() {
|
|
284
|
+
return {
|
|
285
|
+
type: "cim",
|
|
286
|
+
data: {
|
|
287
|
+
type: "CIMSymbolReference",
|
|
288
|
+
primitiveOverrides: [
|
|
289
|
+
{
|
|
290
|
+
// 将textGraphic的TextString替换为graphic.attributes.name
|
|
291
|
+
type: "CIMPrimitiveOverride",
|
|
292
|
+
primitiveName: "textGraphic",
|
|
293
|
+
propertyName: "TextString",
|
|
294
|
+
valueExpressionInfo: {
|
|
295
|
+
type: "CIMExpressionInfo",
|
|
296
|
+
title: "Custom",
|
|
297
|
+
expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
|
|
298
|
+
returnType: "Default"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
symbol: {
|
|
303
|
+
type: "CIMPointSymbol",
|
|
304
|
+
symbolLayers: [
|
|
305
|
+
// 路口名称
|
|
306
|
+
{
|
|
307
|
+
type: "CIMVectorMarker",
|
|
308
|
+
size: 32,
|
|
309
|
+
colorLocked: !0,
|
|
310
|
+
anchorPointUnits: "Relative",
|
|
311
|
+
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
312
|
+
markerGraphics: [
|
|
313
|
+
{
|
|
314
|
+
type: "CIMMarkerGraphic",
|
|
315
|
+
primitiveName: "textGraphic",
|
|
316
|
+
geometry: { x: 0, y: 0 },
|
|
317
|
+
symbol: {
|
|
318
|
+
type: "CIMTextSymbol",
|
|
319
|
+
height: 12,
|
|
320
|
+
horizontalAlignment: "Center",
|
|
321
|
+
offsetX: 0,
|
|
322
|
+
offsetY: 20,
|
|
323
|
+
haloSize: 1,
|
|
324
|
+
haloSymbol: {
|
|
325
|
+
type: "CIMPolygonSymbol",
|
|
326
|
+
symbolLayers: [
|
|
327
|
+
{
|
|
328
|
+
type: "CIMSolidFill",
|
|
329
|
+
enable: !0,
|
|
330
|
+
color: [255, 255, 255, 255]
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
symbol: {
|
|
335
|
+
type: "CIMPolygonSymbol",
|
|
336
|
+
symbolLayers: [
|
|
337
|
+
{
|
|
338
|
+
type: "CIMSolidFill",
|
|
339
|
+
enable: !0,
|
|
340
|
+
color: [0, 0, 0, 255]
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
verticalAlignment: "Center"
|
|
345
|
+
},
|
|
346
|
+
textString: ""
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
scaleSymbolsProportionally: !0,
|
|
350
|
+
respectFrame: !0
|
|
351
|
+
},
|
|
352
|
+
// 路口图标
|
|
353
|
+
{
|
|
354
|
+
type: "CIMPictureMarker",
|
|
355
|
+
enable: !0,
|
|
356
|
+
anchorPoint: {
|
|
357
|
+
x: 0,
|
|
358
|
+
y: 0
|
|
359
|
+
},
|
|
360
|
+
anchorPointUnits: "Relative",
|
|
361
|
+
size: 20,
|
|
362
|
+
rotateClockwise: !0,
|
|
363
|
+
textureFilter: "Picture",
|
|
364
|
+
url: "/GisViewerAssets/Images/gis_lkcz_xz.png"
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
269
371
|
/**
|
|
270
372
|
* 生成路口点符号。在不同比例尺下,使用不同的符号
|
|
271
373
|
* @param attributes
|
|
@@ -273,9 +375,9 @@ class x {
|
|
|
273
375
|
* @returns
|
|
274
376
|
*/
|
|
275
377
|
getCrossGraphicSymbol(e, t) {
|
|
276
|
-
const { isKey:
|
|
378
|
+
const { isKey: i, color: s } = e;
|
|
277
379
|
if (t === "marker")
|
|
278
|
-
return
|
|
380
|
+
return i ? {
|
|
279
381
|
type: "picture-marker",
|
|
280
382
|
url: "/GisViewerAssets/Images/icon_star.png",
|
|
281
383
|
width: "30px",
|
|
@@ -329,7 +431,7 @@ class x {
|
|
|
329
431
|
height: 12,
|
|
330
432
|
horizontalAlignment: "Center",
|
|
331
433
|
offsetX: 0,
|
|
332
|
-
offsetY:
|
|
434
|
+
offsetY: i ? 50 : 40,
|
|
333
435
|
haloSize: 1,
|
|
334
436
|
haloSymbol: {
|
|
335
437
|
type: "CIMPolygonSymbol",
|
|
@@ -368,11 +470,11 @@ class x {
|
|
|
368
470
|
y: 0
|
|
369
471
|
},
|
|
370
472
|
anchorPointUnits: "Relative",
|
|
371
|
-
size:
|
|
473
|
+
size: i ? 45 : 30,
|
|
372
474
|
rotateClockwise: !0,
|
|
373
475
|
textureFilter: "Picture",
|
|
374
|
-
url: `/GisViewerAssets/Images/xhj_${
|
|
375
|
-
offsetY:
|
|
476
|
+
url: `/GisViewerAssets/Images/xhj_${i ? 4 : 1}.png`,
|
|
477
|
+
offsetY: i ? 22 : 15
|
|
376
478
|
}
|
|
377
479
|
]
|
|
378
480
|
}
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -248,6 +248,7 @@ export interface IJunctionTableData {
|
|
|
248
248
|
factoryCode?: string;
|
|
249
249
|
}
|
|
250
250
|
export interface ISignalCountdownProps {
|
|
251
|
+
displayMode: string;
|
|
251
252
|
crossId: string;
|
|
252
253
|
roadId: string;
|
|
253
254
|
mapPoint: number[];
|
|
@@ -257,6 +258,7 @@ export interface ISignalCountdownProps {
|
|
|
257
258
|
top: number;
|
|
258
259
|
};
|
|
259
260
|
rotation: number;
|
|
261
|
+
scale: number;
|
|
260
262
|
lampStatus: {
|
|
261
263
|
uNumber?: number;
|
|
262
264
|
uColor?: string;
|
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}.signal-countdown-panel[data-v-
|
|
1
|
+
.gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}.signal-countdown-panel[data-v-f1172941]{position:absolute;display:flex;flex-direction:row;padding:0;margin:0}.signal-countdown-container[data-v-f1172941]{margin:0 1px;padding:0;background-color:#000c;border-style:solid;border-color:#40e0d0;border-width:2px;border-radius:5px;color:#fff;width:40px;height:70px;justify-content:center;align-items:center;display:flex;flex-direction:column}.signal-countdown-number[data-v-f1172941]{font:30px bold}
|
|
@@ -29,6 +29,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
29
29
|
queueLength: QueueLength;
|
|
30
30
|
openDriveRenderer: OpenDriveRenderer;
|
|
31
31
|
signalControlAreaController: SignalControlAreaController;
|
|
32
|
+
showLogDiv: import("vue").Ref<boolean>;
|
|
32
33
|
appDataStore: import("pinia").Store<"appData", {
|
|
33
34
|
mapConfig: {};
|
|
34
35
|
saveTrackLog: boolean;
|
|
@@ -36,6 +37,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
36
37
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
37
38
|
}, {}, {}>;
|
|
38
39
|
countdownPanelInfos: import("vue").Ref<{
|
|
40
|
+
displayMode: string;
|
|
39
41
|
crossId: string;
|
|
40
42
|
roadId: string;
|
|
41
43
|
mapPoint: number[];
|
|
@@ -45,6 +47,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
45
47
|
top: number;
|
|
46
48
|
};
|
|
47
49
|
rotation: number;
|
|
50
|
+
scale: number;
|
|
48
51
|
lampStatus: {
|
|
49
52
|
uNumber?: number | undefined;
|
|
50
53
|
uColor?: string | undefined;
|
|
@@ -56,7 +59,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
56
59
|
rColor?: string | undefined;
|
|
57
60
|
};
|
|
58
61
|
}[]>;
|
|
59
|
-
showLogDiv: import("vue").Ref<boolean>;
|
|
60
62
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
61
63
|
startSaveTrackLog: () => void;
|
|
62
64
|
downloadTrackLog: () => void;
|
|
@@ -80,7 +82,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
80
82
|
calRoadIndicatorArea: () => Promise<void>;
|
|
81
83
|
connectCarFlow: (url: string, options?: any) => Promise<void>;
|
|
82
84
|
disconnectCarFlow: () => void;
|
|
83
|
-
handleHoloVehicleTraceData: (vehicleTrace: any) => void
|
|
85
|
+
handleHoloVehicleTraceData: (vehicleTrace: any) => Promise<void>;
|
|
84
86
|
clearHoloTrace: () => void;
|
|
85
87
|
setInterpolate: (enable: boolean) => void;
|
|
86
88
|
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
@@ -111,7 +113,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
111
113
|
status: number;
|
|
112
114
|
message: string;
|
|
113
115
|
}>;
|
|
114
|
-
showSignalControlArea: (params: any) =>
|
|
116
|
+
showSignalControlArea: (params: any) => import("../types").IResult;
|
|
115
117
|
clearSignalControlArea: () => void;
|
|
116
118
|
locateSignalControlArea: (params: {
|
|
117
119
|
id: string;
|
|
@@ -120,9 +122,15 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
120
122
|
id: string;
|
|
121
123
|
}) => Promise<import("../types").IResult>;
|
|
122
124
|
resetHighlightSignalControlArea: () => import("../types").IResult;
|
|
125
|
+
showSubSignalControlArea: (params: any) => import("../types").IResult;
|
|
126
|
+
editSubSignalControlArea: () => import("../types").IResult;
|
|
123
127
|
props: any;
|
|
124
128
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
125
129
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
130
|
+
displayMode: {
|
|
131
|
+
type: StringConstructor;
|
|
132
|
+
required: true;
|
|
133
|
+
};
|
|
126
134
|
crossId: {
|
|
127
135
|
type: StringConstructor;
|
|
128
136
|
required: true;
|
|
@@ -139,6 +147,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
139
147
|
type: ArrayConstructor;
|
|
140
148
|
required: true;
|
|
141
149
|
};
|
|
150
|
+
scale: {
|
|
151
|
+
type: NumberConstructor;
|
|
152
|
+
required: true;
|
|
153
|
+
};
|
|
142
154
|
position: {
|
|
143
155
|
type: ObjectConstructor;
|
|
144
156
|
required: true;
|
|
@@ -175,8 +187,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
175
187
|
rNumberStyle: import("vue").ComputedRef<{
|
|
176
188
|
color: string;
|
|
177
189
|
}>;
|
|
178
|
-
getColorString: (color: string | undefined) => "red" | "
|
|
190
|
+
getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
|
|
179
191
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
192
|
+
displayMode: {
|
|
193
|
+
type: StringConstructor;
|
|
194
|
+
required: true;
|
|
195
|
+
};
|
|
180
196
|
crossId: {
|
|
181
197
|
type: StringConstructor;
|
|
182
198
|
required: true;
|
|
@@ -193,6 +209,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
193
209
|
type: ArrayConstructor;
|
|
194
210
|
required: true;
|
|
195
211
|
};
|
|
212
|
+
scale: {
|
|
213
|
+
type: NumberConstructor;
|
|
214
|
+
required: true;
|
|
215
|
+
};
|
|
196
216
|
position: {
|
|
197
217
|
type: ObjectConstructor;
|
|
198
218
|
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"),Ie=require("pinia"),v=require("./stores/index.js");require("./style/index.css");const O=require("./utils/holo-flow/index.js"),Me=require("./utils/holo-flow/signal-countdown-panel.vue.js"),_e=require("./utils/map-initializer.js"),k=require("./utils/open-drive-renderer/index.js"),A=require("./utils/overlay.js"),xe=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),T=require("./utils/signal-control-area-controller/index.js"),Be=require("./utils/traffic-flow.js"),He={class:"gis-viewer"},Ve={style:{position:"absolute",bottom:"10px",left:"10px"}},Pe=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(b,{expose:D,emit:q}){const p=n.ref(null);let i,u,l,o,a,r,g,t,s;const f=n.ref(!1);v.registerStore();const h=v.default.useAppDataStore,{countdownPanels:I}=Ie.storeToRefs(h);n.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",m=>{m.ctrlKey&&m.key==="i"&&(f.value=!f.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(C.config)).json();c.assetsRoot=C.assetsRoot||d,h.mapConfig=c,u=new _e.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(m,y,S,qe)=>{w("markerClick",m,y,S,qe)},mapClickCallback:(m,y,S)=>{w("mapClick",m,y,S)}}),a=new O.default(i),await a.init(),w("mapLoaded")}),n.onUnmounted(()=>{s==null||s.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const M=n.computed(()=>i),_=()=>{const e=v.default.useAppDataStore;e.saveTrackLog=!0},x=()=>{a.downloadTrackLog()},B=async e=>await u.setMapCenter(e),H=async e=>await u.setMapCamera(e),V=async e=>await u.lookAt(e),P=e=>u.setLayerVisibility(e),N=(e,d)=>u.requestCoordinateTransform(e,d),E=e=>{u.cancelCoordinateTransform(e)},j=e=>{u.setMapZoomRange(e)},z=e=>(l||(l=new L.default(i)),l.showLaneNumber(e)),Q=()=>{l==null||l.clearLaneNumber()},Z=async e=>(l||(l=new L.default(i)),await l.initializeSearch(e)),K=async()=>l==null?void 0:l.calCrossIndicatorArea(),U=async()=>{},G=async(e,d)=>{o||(o=new Be.default(i)),o.connectTrafficFlow(e,d)},J=()=>{o==null||o.disconnectTrafficFlow()},W=async e=>{a||(a=new O.default(i),await a.init()),a.handleVehicleTraceData(e)},X=()=>{a.clearHoloTrace()},Y=e=>{a.setInterpolate(e)},F=async e=>{await a.handleSignalData(e)},R=()=>{a.clearHoloSignal()},$=e=>{o==null||o.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},ee=e=>{a==null||a.togglePause(e)},te=e=>{o==null||o.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},ae=e=>{a==null||a.updatePanelContent(e)},ne=async e=>(r||(r=new A.default(i)),r.addOverlays(e)),re=e=>(r||(r=new A.default(i)),r.addMask(e)),se=()=>{r==null||r.removeMask()},oe=e=>r==null?void 0:r.removeOverlaysByType(e),ie=e=>r==null?void 0:r.removeOverlaysById(e),ce=()=>r==null?void 0:r.removeAllOverlays(),le=()=>{r==null||r.showAllOverlays()},ue=e=>{g||(g=new xe.default(i)),g.updateQueueLength(e)},de=()=>{g==null||g.removeQueueLength()},me=async(e,d)=>(t||(t=new k.default(i)),await t.showOpenDriveFromServer(e,d)),ge=async e=>(t||(t=new k.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),pe=async()=>await(t==null?void 0:t.clearOpenDrive()),fe=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Se=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Ce=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Oe=e=>(s||(s=new T.default(i)),s.showSignalControlArea(e)),ke=()=>{s==null||s.clearSignalControlArea()},Ae=async e=>s?await s.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=async e=>s?await s.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Te=()=>s?s.resetHighlight():{status:-1,message:"未加载信号控制区"},be=e=>(s||(s=new T.default(i)),s.showSubSignalControlArea(e)),De=()=>s?s.editSubSignalArea():{status:-1,message:"未加载信号控制区"},C=b,w=q;return D({mapViewer:M,setLayerVisibility:P,setMapCenter:B,lookAt:V,setMapCamera:H,setMapZoomRange:j,requestCoordinateTransform:N,cancelCoordinateTransform:E,addOverlays:ne,addMask:re,removeMask:se,showAllOverlays:le,removeOverlaysByType:oe,removeOverlaysById:ie,removeAllOverlays:ce,showLaneNumber:z,clearLaneNumber:Q,initializeAreaTool:Z,calCrossIndicatorArea:K,calRoadIndicatorArea:U,connectCarFlow:G,disconnectCarFlow:J,handleHoloVehicleTraceData:W,clearHoloTrace:X,handleHoloSignalData:F,clearHoloSignal:R,setInterpolate:Y,toggleTrafficInfo:$,toggleTrafficObject:te,toggleVehicleInfo:ae,togglePause:ee,updateQueueLength:ue,removeQueueLength:de,showOpenDriveFromServer:me,showOpenDriveFromFile:ge,clearOpenDrive:pe,geometrySearchInOpenDrive:Se,findSumoInOpenDrive:fe,selectSumoInOpenDrive:we,unselectSumoInOpenDrive:ye,getSumoInfo:ve,splitOpenDriveLane:he,clearSplitOpenDriveLane:Ce,showSignalControlArea:Oe,clearSignalControlArea:ke,locateSignalControlArea:Ae,highlightSignalControlArea:Le,resetHighlightSignalControlArea:Te,showSubSignalControlArea:be,editSubSignalControlArea:De}),(e,d)=>(n.openBlock(),n.createElementBlock("div",He,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[n.withDirectives(n.createElementVNode("div",Ve,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:_}," 开始记录 "),n.createElementVNode("button",{onClick:x},"下载日志")],512),[[n.vShow,f.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(I),(c,m)=>(n.openBlock(),n.createBlock(Me.default,{key:m,"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=Pe;
|
|
@@ -18,6 +18,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
18
18
|
queueLength: import("./utils/queue-length").default;
|
|
19
19
|
openDriveRenderer: import("./utils/open-drive-renderer").default;
|
|
20
20
|
signalControlAreaController: import("./utils/signal-control-area-controller").default;
|
|
21
|
+
showLogDiv: import("vue").Ref<boolean>;
|
|
21
22
|
appDataStore: import("pinia").Store<"appData", {
|
|
22
23
|
mapConfig: {};
|
|
23
24
|
saveTrackLog: boolean;
|
|
@@ -25,6 +26,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
25
26
|
countdownPanels: import("../types").ISignalCountdownProps[];
|
|
26
27
|
}, {}, {}>;
|
|
27
28
|
countdownPanelInfos: import("vue").Ref<{
|
|
29
|
+
displayMode: string;
|
|
28
30
|
crossId: string;
|
|
29
31
|
roadId: string;
|
|
30
32
|
mapPoint: number[];
|
|
@@ -34,6 +36,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
34
36
|
top: number;
|
|
35
37
|
};
|
|
36
38
|
rotation: number;
|
|
39
|
+
scale: number;
|
|
37
40
|
lampStatus: {
|
|
38
41
|
uNumber?: number | undefined;
|
|
39
42
|
uColor?: string | undefined;
|
|
@@ -45,7 +48,6 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
45
48
|
rColor?: string | undefined;
|
|
46
49
|
};
|
|
47
50
|
}[]>;
|
|
48
|
-
showLogDiv: import("vue").Ref<boolean>;
|
|
49
51
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
50
52
|
startSaveTrackLog: () => void;
|
|
51
53
|
downloadTrackLog: () => void;
|
|
@@ -69,7 +71,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
69
71
|
calRoadIndicatorArea: () => Promise<void>;
|
|
70
72
|
connectCarFlow: (url: string, options?: any) => Promise<void>;
|
|
71
73
|
disconnectCarFlow: () => void;
|
|
72
|
-
handleHoloVehicleTraceData: (vehicleTrace: any) => void
|
|
74
|
+
handleHoloVehicleTraceData: (vehicleTrace: any) => Promise<void>;
|
|
73
75
|
clearHoloTrace: () => void;
|
|
74
76
|
setInterpolate: (enable: boolean) => void;
|
|
75
77
|
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
@@ -100,7 +102,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
100
102
|
status: number;
|
|
101
103
|
message: string;
|
|
102
104
|
}>;
|
|
103
|
-
showSignalControlArea: (params: any) =>
|
|
105
|
+
showSignalControlArea: (params: any) => import("../types").IResult;
|
|
104
106
|
clearSignalControlArea: () => void;
|
|
105
107
|
locateSignalControlArea: (params: {
|
|
106
108
|
id: string;
|
|
@@ -109,9 +111,15 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
109
111
|
id: string;
|
|
110
112
|
}) => Promise<import("../types").IResult>;
|
|
111
113
|
resetHighlightSignalControlArea: () => import("../types").IResult;
|
|
114
|
+
showSubSignalControlArea: (params: any) => import("../types").IResult;
|
|
115
|
+
editSubSignalControlArea: () => import("../types").IResult;
|
|
112
116
|
props: any;
|
|
113
117
|
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
114
118
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
119
|
+
displayMode: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
required: true;
|
|
122
|
+
};
|
|
115
123
|
crossId: {
|
|
116
124
|
type: StringConstructor;
|
|
117
125
|
required: true;
|
|
@@ -128,6 +136,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
128
136
|
type: ArrayConstructor;
|
|
129
137
|
required: true;
|
|
130
138
|
};
|
|
139
|
+
scale: {
|
|
140
|
+
type: NumberConstructor;
|
|
141
|
+
required: true;
|
|
142
|
+
};
|
|
131
143
|
position: {
|
|
132
144
|
type: ObjectConstructor;
|
|
133
145
|
required: true;
|
|
@@ -164,8 +176,12 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
164
176
|
rNumberStyle: import("vue").ComputedRef<{
|
|
165
177
|
color: string;
|
|
166
178
|
}>;
|
|
167
|
-
getColorString: (color: string | undefined) => "red" | "
|
|
179
|
+
getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
|
|
168
180
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
181
|
+
displayMode: {
|
|
182
|
+
type: StringConstructor;
|
|
183
|
+
required: true;
|
|
184
|
+
};
|
|
169
185
|
crossId: {
|
|
170
186
|
type: StringConstructor;
|
|
171
187
|
required: true;
|
|
@@ -182,6 +198,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
182
198
|
type: ArrayConstructor;
|
|
183
199
|
required: true;
|
|
184
200
|
};
|
|
201
|
+
scale: {
|
|
202
|
+
type: NumberConstructor;
|
|
203
|
+
required: true;
|
|
204
|
+
};
|
|
185
205
|
position: {
|
|
186
206
|
type: ObjectConstructor;
|
|
187
207
|
required: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("@turf/length"),A=require("@turf/line-slice-along"),M=require("pako"),h=require("proj4");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const l=y(L),P=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new f.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),u=g(r,t,o,{units:"meters"}),d=o>0?o-180:o+180,O=g(s,t,d,{units:"meters"});return new f.Polyline({paths:[[u.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new f.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new f.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof f.Polyline){const s=r.paths[0],o=s[0],u=s[s.length-1];return[o,u]}return[]}static async getOffsetLine(e,t){const n=P.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return P.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return M.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>h(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return h(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return g(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}static getCenterPointInLine(e){const t=c.lineString(e),n=S(t,{units:"meters"})/2
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("@turf/length"),A=require("@turf/line-slice-along"),M=require("pako"),h=require("proj4");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const l=y(L),P=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new f.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),u=g(r,t,o,{units:"meters"}),d=o>0?o-180:o+180,O=g(s,t,d,{units:"meters"});return new f.Polyline({paths:[[u.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new f.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new f.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof f.Polyline){const s=r.paths[0],o=s[0],u=s[s.length-1];return[o,u]}return[]}static async getOffsetLine(e,t){const n=P.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return P.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return M.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>h(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return h(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return g(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}static getCenterPointInLine(e){const t=c.lineString(e),n=S(t,{units:"meters"})/2,r=A(t,0,n,{units:"meters"});return r.geometry.coordinates[r.geometry.coordinates.length-1]}}exports.default=i;
|