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
|
@@ -3,16 +3,17 @@ import * as j from "@arcgis/core/core/promiseUtils";
|
|
|
3
3
|
import { Polygon as N } from "@arcgis/core/geometry";
|
|
4
4
|
import * as L from "@arcgis/core/geometry/geometryEngine";
|
|
5
5
|
import k from "@arcgis/core/layers/FeatureLayer";
|
|
6
|
-
import
|
|
6
|
+
import I from "@arcgis/core/layers/GraphicsLayer";
|
|
7
7
|
import * as G from "@turf/helpers";
|
|
8
8
|
import { lineSliceAlong as C } from "@turf/line-slice-along";
|
|
9
9
|
import b from "axios";
|
|
10
|
-
import $ from "
|
|
10
|
+
import { XMLParser as $ } from "fast-xml-parser";
|
|
11
|
+
import F from "md5";
|
|
11
12
|
import O from "pako";
|
|
12
|
-
import { watch as
|
|
13
|
+
import { watch as P } from "vue";
|
|
13
14
|
import J from "../../stores/index.mjs";
|
|
14
|
-
import
|
|
15
|
-
class
|
|
15
|
+
import E from "../common-utils.mjs";
|
|
16
|
+
class x {
|
|
16
17
|
constructor(e) {
|
|
17
18
|
this.junctionNames = /* @__PURE__ */ new Map(), this.projectName = "", this.openDriveServer = "", this.currentSectionCode = "", this.selectedSectionIds = [], this.currentJunctionId = "", this.view = e, this.laneLayer = new k({
|
|
18
19
|
id: "OpenDriveLane",
|
|
@@ -287,7 +288,7 @@ class F {
|
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
]
|
|
290
|
-
}), this.junctionLayer = new
|
|
291
|
+
}), this.junctionLayer = new I({ id: "OpenDriveJunction" }), this.sectionLayer = new I({ id: "OpenDriveSection" }), this.highlightLayer = new I({ id: "OpenDriveHighlight" }), this.flashLayer = new I({ id: "OpenDriveFlash" }), this.drawLayer = new I({ id: "Draw" }), this.splitLaneLayer = new I({ id: "SplitLane" }), this.borderLayer = new I({ id: "OpenDriveBorder" }), this.view.map.addMany([
|
|
291
292
|
this.laneLayer,
|
|
292
293
|
this.junctionLayer,
|
|
293
294
|
this.sectionLayer,
|
|
@@ -295,18 +296,23 @@ class F {
|
|
|
295
296
|
this.highlightLayer,
|
|
296
297
|
this.flashLayer,
|
|
297
298
|
this.drawLayer,
|
|
298
|
-
this.splitLaneLayer
|
|
299
|
+
this.splitLaneLayer,
|
|
300
|
+
this.borderLayer
|
|
299
301
|
]);
|
|
300
302
|
}
|
|
301
303
|
static getInstance(e) {
|
|
302
|
-
return this.instance || (this.instance = new
|
|
304
|
+
return this.instance || (this.instance = new x(e)), this.instance;
|
|
303
305
|
}
|
|
304
306
|
async makeMd5FromFile(e) {
|
|
307
|
+
var t;
|
|
305
308
|
try {
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
const r = await (await fetch(e)).text(), n = (t = new $({
|
|
310
|
+
ignoreAttributes: !1,
|
|
311
|
+
allowBooleanAttributes: !0
|
|
312
|
+
}).parse(r).OpenDRIVE.userData) == null ? void 0 : t.border;
|
|
313
|
+
return { status: 0, message: "ok", result: { md5: F(r), border: n } };
|
|
314
|
+
} catch (i) {
|
|
315
|
+
return { status: -1, message: i.message };
|
|
310
316
|
}
|
|
311
317
|
}
|
|
312
318
|
/**
|
|
@@ -315,12 +321,12 @@ class F {
|
|
|
315
321
|
* @returns
|
|
316
322
|
*/
|
|
317
323
|
async showOpenDriveFromFile(e) {
|
|
318
|
-
var
|
|
324
|
+
var f, p;
|
|
319
325
|
this.openDriveClickCallback = e.selectedCallback, console.time("md5用时");
|
|
320
326
|
const t = await this.makeMd5FromFile(e.file);
|
|
321
327
|
if (t.status !== 0)
|
|
322
328
|
return t;
|
|
323
|
-
this.projectName = t.result, console.timeEnd("md5用时"), this.openDriveServer = e.server
|
|
329
|
+
this.projectName = t.result.md5, console.timeEnd("md5用时"), console.log(t.result.border), this.openDriveServer = e.server;
|
|
324
330
|
const i = `http://${this.openDriveServer}/api/openDrive/uploadXodr`;
|
|
325
331
|
let r;
|
|
326
332
|
try {
|
|
@@ -341,7 +347,7 @@ class F {
|
|
|
341
347
|
return { status: -1, message: r.statusText };
|
|
342
348
|
console.time("渲染用时");
|
|
343
349
|
const s = r.data.result.geoSetting;
|
|
344
|
-
|
|
350
|
+
E.setGeoData(
|
|
345
351
|
s.geoReference,
|
|
346
352
|
s.offsetX,
|
|
347
353
|
s.offsetY
|
|
@@ -351,17 +357,17 @@ class F {
|
|
|
351
357
|
const a = await (await fetch(c)).arrayBuffer(), o = O.inflate(a, { to: "string" }), l = JSON.parse(o);
|
|
352
358
|
await this.showAllLanes(
|
|
353
359
|
l,
|
|
354
|
-
((
|
|
360
|
+
((f = e.options) == null ? void 0 : f.showJunctionLane) || !1,
|
|
355
361
|
((p = e.options) == null ? void 0 : p.showRoadName) || !0
|
|
356
362
|
);
|
|
357
363
|
const d = r.data.result.junctions;
|
|
358
364
|
this.showJunction(d), e.options && e.options.centerMap !== !1 && await this.view.goTo(this.allLaneGraphics), this.mouseMoveHandler || this.monitorMouseMove(), this.mouseClickHandler || this.monitorMouseClick();
|
|
359
365
|
const h = J.useAppDataStore;
|
|
360
|
-
return
|
|
366
|
+
return P(
|
|
361
367
|
() => h.isSketching,
|
|
362
368
|
() => {
|
|
363
|
-
var m,
|
|
364
|
-
h.isSketching ? ((m = this.mouseMoveHandler) == null || m.remove(), this.mouseMoveHandler = void 0, (
|
|
369
|
+
var m, g;
|
|
370
|
+
h.isSketching ? ((m = this.mouseMoveHandler) == null || m.remove(), this.mouseMoveHandler = void 0, (g = this.mouseClickHandler) == null || g.remove(), this.mouseClickHandler = void 0) : (this.monitorMouseMove(), this.monitorMouseClick());
|
|
365
371
|
}
|
|
366
372
|
), console.timeEnd("渲染用时"), { status: 0, message: "ok" };
|
|
367
373
|
}
|
|
@@ -408,7 +414,7 @@ class F {
|
|
|
408
414
|
const { id: l, refLine: d } = o;
|
|
409
415
|
let h = o.name;
|
|
410
416
|
h.includes("(") && (h = h.slice(0, h.indexOf("("))), h = h.replace(/(.)/g, "$1 ");
|
|
411
|
-
const
|
|
417
|
+
const f = new y({
|
|
412
418
|
geometry: {
|
|
413
419
|
type: "polyline",
|
|
414
420
|
paths: [d]
|
|
@@ -419,14 +425,14 @@ class F {
|
|
|
419
425
|
roadName: h
|
|
420
426
|
}
|
|
421
427
|
});
|
|
422
|
-
this.allRefLineGraphics.push(
|
|
428
|
+
this.allRefLineGraphics.push(f), o.laneSections.sort((p, m) => Number(p.id) - Number(m.id));
|
|
423
429
|
for (let p = 0; p < o.laneSections.length; p++) {
|
|
424
|
-
const m = o.laneSections[p],
|
|
430
|
+
const m = o.laneSections[p], g = Number(m.id);
|
|
425
431
|
for (const u of m.lanePaths) {
|
|
426
432
|
const w = Number(u.id);
|
|
427
433
|
if (w === 0)
|
|
428
434
|
continue;
|
|
429
|
-
const
|
|
435
|
+
const v = u.type, M = [...u.outerPath], S = u.innerPath.concat(
|
|
430
436
|
M.reverse()
|
|
431
437
|
);
|
|
432
438
|
if (S.length <= 3) {
|
|
@@ -442,15 +448,15 @@ class F {
|
|
|
442
448
|
geometry: A,
|
|
443
449
|
attributes: {
|
|
444
450
|
ObjectID: c++,
|
|
445
|
-
id: `${l}+${
|
|
451
|
+
id: `${l}+${g}+${w}`,
|
|
446
452
|
fromNode: o.fromNode,
|
|
447
453
|
toNode: o.toNode,
|
|
448
454
|
roadId: String(l),
|
|
449
455
|
roadName: o.name,
|
|
450
|
-
sectionId: String(
|
|
456
|
+
sectionId: String(g),
|
|
451
457
|
sectionIndex: p,
|
|
452
458
|
laneId: w,
|
|
453
|
-
type:
|
|
459
|
+
type: v,
|
|
454
460
|
sumoId: "",
|
|
455
461
|
// 记录左右边线的起始点,用于按长度高亮车道的一部分
|
|
456
462
|
leftLine: u.innerPath,
|
|
@@ -505,9 +511,10 @@ class F {
|
|
|
505
511
|
},
|
|
506
512
|
symbol: {
|
|
507
513
|
type: "picture-marker",
|
|
508
|
-
url: i.crossId ? "/GisViewerAssets/Images/
|
|
509
|
-
width:
|
|
510
|
-
height:
|
|
514
|
+
url: i.crossId ? "/GisViewerAssets/Images/xhj_1.png" : "/GisViewerAssets/Images/xhj_2.png",
|
|
515
|
+
width: "18px",
|
|
516
|
+
height: "28px",
|
|
517
|
+
yoffset: "9px"
|
|
511
518
|
},
|
|
512
519
|
popupTemplate: {
|
|
513
520
|
title: i.name,
|
|
@@ -561,7 +568,7 @@ class F {
|
|
|
561
568
|
(u) => `${u.attributes.roadId}+${u.attributes.sectionId}` === n
|
|
562
569
|
), l = L.union(
|
|
563
570
|
o.map((u) => u.geometry)
|
|
564
|
-
), d = this.hitGraphic.getAttribute("fromNode"), h = this.hitGraphic.getAttribute("toNode"),
|
|
571
|
+
), d = this.hitGraphic.getAttribute("fromNode"), h = this.hitGraphic.getAttribute("toNode"), f = this.junctionNames.get(d) || d, p = this.junctionNames.get(h) || h, m = new y({
|
|
565
572
|
geometry: l,
|
|
566
573
|
symbol: {
|
|
567
574
|
type: "simple-fill",
|
|
@@ -576,7 +583,7 @@ class F {
|
|
|
576
583
|
type: "OpenDriveSection",
|
|
577
584
|
id: n,
|
|
578
585
|
selected: !1,
|
|
579
|
-
fromNodeName:
|
|
586
|
+
fromNodeName: f,
|
|
580
587
|
toNodeName: p,
|
|
581
588
|
laneCount: o.length
|
|
582
589
|
},
|
|
@@ -604,10 +611,10 @@ class F {
|
|
|
604
611
|
}
|
|
605
612
|
});
|
|
606
613
|
this.highlightLayer.removeAll(), this.highlightLayer.add(m);
|
|
607
|
-
const
|
|
614
|
+
const g = this.view.toMap(t);
|
|
608
615
|
this.view.openPopup({
|
|
609
616
|
features: [m],
|
|
610
|
-
location:
|
|
617
|
+
location: g
|
|
611
618
|
});
|
|
612
619
|
} else if (s.layer.id === "OpenDriveJunction") {
|
|
613
620
|
const n = this.hitGraphic.getAttribute("id");
|
|
@@ -806,9 +813,9 @@ class F {
|
|
|
806
813
|
type: "simple-marker",
|
|
807
814
|
style: "circle",
|
|
808
815
|
size: 30,
|
|
809
|
-
color: [
|
|
816
|
+
color: [0, 0, 255, 0.6],
|
|
810
817
|
outline: {
|
|
811
|
-
color: "
|
|
818
|
+
color: "blue",
|
|
812
819
|
width: 1
|
|
813
820
|
}
|
|
814
821
|
}
|
|
@@ -860,10 +867,9 @@ class F {
|
|
|
860
867
|
geometry: n,
|
|
861
868
|
symbol: {
|
|
862
869
|
type: "simple-fill",
|
|
863
|
-
color: [
|
|
870
|
+
color: [0, 0, 255, 0.6],
|
|
864
871
|
style: "solid",
|
|
865
872
|
outline: {
|
|
866
|
-
color: "red",
|
|
867
873
|
width: 0
|
|
868
874
|
}
|
|
869
875
|
}
|
|
@@ -978,13 +984,13 @@ class F {
|
|
|
978
984
|
type: "edge",
|
|
979
985
|
id: d
|
|
980
986
|
});
|
|
981
|
-
const h = `http://${this.openDriveServer}/api/sumo/getSumoEdge`,
|
|
987
|
+
const h = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, f = await b.get(h, {
|
|
982
988
|
params: {
|
|
983
989
|
id: `${o}+${a.getAttribute("sectionId")}`,
|
|
984
990
|
projectName: this.projectName
|
|
985
991
|
}
|
|
986
992
|
});
|
|
987
|
-
|
|
993
|
+
f.status === 200 && f.data.status === 0 && s.push(f.data.result);
|
|
988
994
|
}
|
|
989
995
|
}
|
|
990
996
|
const c = this.junctionLayer.graphics.filter((a) => {
|
|
@@ -1021,20 +1027,20 @@ class F {
|
|
|
1021
1027
|
const r = Number(i[1]), s = i[0].split("#"), c = s.length === 2 ? Number(s[1]) : 0;
|
|
1022
1028
|
let n = s[0];
|
|
1023
1029
|
n.startsWith("-") && (n = n.slice(1));
|
|
1024
|
-
const a = this.allLaneGraphics.filter((
|
|
1030
|
+
const a = this.allLaneGraphics.filter((v) => v.getAttribute("roadId") === n && v.getAttribute("sectionIndex") === c);
|
|
1025
1031
|
if (a.length === 0)
|
|
1026
1032
|
return { status: -1, message: "未找到路段" };
|
|
1027
1033
|
const o = a.length - r, l = a.find(
|
|
1028
|
-
(
|
|
1034
|
+
(v) => Math.abs(v.getAttribute("laneId")) === o
|
|
1029
1035
|
);
|
|
1030
1036
|
if (!l)
|
|
1031
1037
|
return { status: -1, message: "未找到车道" };
|
|
1032
|
-
const d = e.start || 0, h = e.end || 100,
|
|
1038
|
+
const d = e.start || 0, h = e.end || 100, f = G.lineString(l.getAttribute("leftLine")), p = C(f, d, h, {
|
|
1033
1039
|
units: "meters"
|
|
1034
|
-
}), m = G.lineString(l.getAttribute("rightLine")),
|
|
1040
|
+
}), m = G.lineString(l.getAttribute("rightLine")), g = C(m, d, h, {
|
|
1035
1041
|
units: "meters"
|
|
1036
1042
|
}), u = p.geometry.coordinates.concat(
|
|
1037
|
-
|
|
1043
|
+
g.geometry.coordinates.reverse()
|
|
1038
1044
|
);
|
|
1039
1045
|
u.push(u[u.length - 1]);
|
|
1040
1046
|
const w = new y({
|
|
@@ -1054,7 +1060,7 @@ class F {
|
|
|
1054
1060
|
type: l.getAttribute("type"),
|
|
1055
1061
|
sumoId: l.getAttribute("sumoId"),
|
|
1056
1062
|
leftLine: p.geometry.coordinates,
|
|
1057
|
-
rightLine:
|
|
1063
|
+
rightLine: g.geometry.coordinates
|
|
1058
1064
|
},
|
|
1059
1065
|
symbol: {
|
|
1060
1066
|
type: "simple-fill",
|
|
@@ -1071,5 +1077,5 @@ class F {
|
|
|
1071
1077
|
}
|
|
1072
1078
|
}
|
|
1073
1079
|
export {
|
|
1074
|
-
|
|
1080
|
+
x as default
|
|
1075
1081
|
};
|
|
@@ -2,7 +2,7 @@ import Graphic from '@arcgis/core/Graphic';
|
|
|
2
2
|
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
3
|
import MapView from '@arcgis/core/views/MapView';
|
|
4
4
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
-
import { IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
|
|
5
|
+
import { IMaskParam, IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
|
|
6
6
|
interface IOverlayOptions {
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
@@ -11,6 +11,8 @@ export default class Overlay {
|
|
|
11
11
|
overlayLayer: GraphicsLayer;
|
|
12
12
|
constructor(view: MapView | SceneView, options?: IOverlayOptions);
|
|
13
13
|
private defaultPointSymbol;
|
|
14
|
+
addMask(params: IMaskParam): void;
|
|
15
|
+
removeMask(): void;
|
|
14
16
|
/**
|
|
15
17
|
* 添加覆盖物
|
|
16
18
|
* @param params
|
|
@@ -1,30 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import l from "@arcgis/core/
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Polygon as n } from "@arcgis/core/geometry";
|
|
2
|
+
import * as l from "@arcgis/core/geometry/geometryEngine";
|
|
3
|
+
import y from "@arcgis/core/Graphic";
|
|
4
|
+
import h from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
class u {
|
|
6
|
+
constructor(e, s) {
|
|
5
7
|
this.defaultPointSymbol = {
|
|
6
8
|
type: "simple-marker",
|
|
7
9
|
style: "circle",
|
|
8
10
|
color: "yellow",
|
|
9
11
|
size: 10
|
|
10
|
-
}, this.view =
|
|
12
|
+
}, this.view = e, this.overlayLayer = new h({
|
|
11
13
|
...s
|
|
12
14
|
}), this.view.map.layers.add(this.overlayLayer);
|
|
13
15
|
}
|
|
16
|
+
addMask(e) {
|
|
17
|
+
this.removeMask();
|
|
18
|
+
const s = e.maskColor || [100, 100, 100, 0.8], i = e.maskSize || 100, r = new n({
|
|
19
|
+
rings: e.geometry.rings
|
|
20
|
+
}), t = r.centroid, a = l.geodesicBuffer(
|
|
21
|
+
t,
|
|
22
|
+
i,
|
|
23
|
+
"kilometers"
|
|
24
|
+
), o = l.difference(
|
|
25
|
+
a,
|
|
26
|
+
r
|
|
27
|
+
), d = new y({
|
|
28
|
+
geometry: o,
|
|
29
|
+
symbol: {
|
|
30
|
+
type: "simple-fill",
|
|
31
|
+
color: s,
|
|
32
|
+
outline: {
|
|
33
|
+
style: "none"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
attributes: { type: "mask" }
|
|
37
|
+
});
|
|
38
|
+
this.overlayLayer.add(d);
|
|
39
|
+
}
|
|
40
|
+
removeMask() {
|
|
41
|
+
const e = this.overlayLayer.graphics.find(
|
|
42
|
+
(s) => s.getAttribute("type") === "mask"
|
|
43
|
+
);
|
|
44
|
+
e && this.overlayLayer.remove(e);
|
|
45
|
+
}
|
|
14
46
|
/**
|
|
15
47
|
* 添加覆盖物
|
|
16
48
|
* @param params
|
|
17
49
|
*/
|
|
18
|
-
addOverlays(
|
|
50
|
+
addOverlays(e) {
|
|
19
51
|
let s = 0, i = 0;
|
|
20
|
-
for (const
|
|
21
|
-
|
|
22
|
-
const t =
|
|
52
|
+
for (const r of e.overlays) {
|
|
53
|
+
r.properties ? (r.properties.type || (r.properties.type = e.type), r.properties.id || (r.properties.id = r.id)) : r.properties = { type: e.type, id: r.id };
|
|
54
|
+
const t = r.symbol || e.defaultSymbol || this.defaultPointSymbol;
|
|
23
55
|
this.addOverlay(
|
|
24
|
-
|
|
56
|
+
r,
|
|
25
57
|
t,
|
|
26
|
-
|
|
27
|
-
|
|
58
|
+
r.properties,
|
|
59
|
+
r.visible
|
|
28
60
|
).message === "add" ? s++ : i++;
|
|
29
61
|
}
|
|
30
62
|
return { status: 0, message: `新增${s}, 更新${i}` };
|
|
@@ -33,10 +65,10 @@ class v {
|
|
|
33
65
|
* 按type移除覆盖物
|
|
34
66
|
* @param types
|
|
35
67
|
*/
|
|
36
|
-
removeOverlaysByType(
|
|
68
|
+
removeOverlaysByType(e) {
|
|
37
69
|
const s = this.overlayLayer.graphics.filter((i) => {
|
|
38
|
-
const
|
|
39
|
-
return
|
|
70
|
+
const r = i.getAttribute("type");
|
|
71
|
+
return e.includes(r);
|
|
40
72
|
});
|
|
41
73
|
return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
|
|
42
74
|
}
|
|
@@ -44,10 +76,10 @@ class v {
|
|
|
44
76
|
* 按id移除覆盖物
|
|
45
77
|
* @param ids
|
|
46
78
|
*/
|
|
47
|
-
removeOverlaysById(
|
|
79
|
+
removeOverlaysById(e) {
|
|
48
80
|
const s = this.overlayLayer.graphics.filter((i) => {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
81
|
+
const r = i.getAttribute("id");
|
|
82
|
+
return e.includes(r);
|
|
51
83
|
});
|
|
52
84
|
return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
|
|
53
85
|
}
|
|
@@ -56,10 +88,10 @@ class v {
|
|
|
56
88
|
* @param ids
|
|
57
89
|
* @param isShow
|
|
58
90
|
*/
|
|
59
|
-
isShowOverlaysByIds(
|
|
91
|
+
isShowOverlaysByIds(e, s) {
|
|
60
92
|
this.overlayLayer.graphics.map((i) => {
|
|
61
|
-
const
|
|
62
|
-
|
|
93
|
+
const r = i.getAttribute("id");
|
|
94
|
+
e.includes(r) ? i.visible = s : i.visible = !s;
|
|
63
95
|
});
|
|
64
96
|
}
|
|
65
97
|
/**
|
|
@@ -68,8 +100,8 @@ class v {
|
|
|
68
100
|
* @memberof Overlay
|
|
69
101
|
*/
|
|
70
102
|
showAllOverlays() {
|
|
71
|
-
this.overlayLayer.graphics.forEach((
|
|
72
|
-
|
|
103
|
+
this.overlayLayer.graphics.forEach((e) => {
|
|
104
|
+
e.visible = !0;
|
|
73
105
|
});
|
|
74
106
|
}
|
|
75
107
|
/**
|
|
@@ -77,8 +109,8 @@ class v {
|
|
|
77
109
|
* @returns
|
|
78
110
|
*/
|
|
79
111
|
removeAllOverlays() {
|
|
80
|
-
const
|
|
81
|
-
return this.overlayLayer.removeAll(), { status: 0, message: `删除${
|
|
112
|
+
const e = this.overlayLayer.graphics.length;
|
|
113
|
+
return this.overlayLayer.removeAll(), { status: 0, message: `删除${e}` };
|
|
82
114
|
}
|
|
83
115
|
/**
|
|
84
116
|
* 销毁
|
|
@@ -88,8 +120,8 @@ class v {
|
|
|
88
120
|
destroy() {
|
|
89
121
|
this.view.map.remove(this.overlayLayer), this.overlayLayer.destroy();
|
|
90
122
|
}
|
|
91
|
-
removeGraphics(
|
|
92
|
-
Array.isArray(
|
|
123
|
+
removeGraphics(e) {
|
|
124
|
+
Array.isArray(e) || (e = [e]), this.overlayLayer.graphics.removeMany(e);
|
|
93
125
|
}
|
|
94
126
|
/**
|
|
95
127
|
* 查找当前点击是否有覆盖物在当前图层
|
|
@@ -99,9 +131,9 @@ class v {
|
|
|
99
131
|
* @returns
|
|
100
132
|
* @memberof Overlay
|
|
101
133
|
*/
|
|
102
|
-
async findGraphic(
|
|
103
|
-
var
|
|
104
|
-
return (
|
|
134
|
+
async findGraphic(e) {
|
|
135
|
+
var r;
|
|
136
|
+
return (r = (await this.view.hitTest(e)).results) == null ? void 0 : r.filter(
|
|
105
137
|
(t) => t.type === "graphic" && t.graphic.layer === this.overlayLayer
|
|
106
138
|
);
|
|
107
139
|
}
|
|
@@ -127,23 +159,23 @@ class v {
|
|
|
127
159
|
* @param symbol
|
|
128
160
|
* @param properties
|
|
129
161
|
*/
|
|
130
|
-
addPoint(
|
|
162
|
+
addPoint(e, s, i, r) {
|
|
131
163
|
let t, a = !0;
|
|
132
|
-
return
|
|
133
|
-
(
|
|
134
|
-
)), t ? t.visible =
|
|
135
|
-
visible:
|
|
136
|
-
}), this.overlayLayer.add(t), a = !1), t.geometry =
|
|
164
|
+
return e.id && (t = this.overlayLayer.graphics.find(
|
|
165
|
+
(o) => o.getAttribute("id") === e.id
|
|
166
|
+
)), t ? t.visible = r ?? t.visible : (r = r ?? !0, t = new y({
|
|
167
|
+
visible: r
|
|
168
|
+
}), this.overlayLayer.add(t), a = !1), t.geometry = e.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
|
|
137
169
|
}
|
|
138
|
-
addOverlay(
|
|
170
|
+
addOverlay(e, s, i, r) {
|
|
139
171
|
let t, a = !0;
|
|
140
|
-
return
|
|
141
|
-
(
|
|
142
|
-
)), t ? t.visible =
|
|
143
|
-
visible:
|
|
144
|
-
}), this.overlayLayer.add(t), a = !1), t.geometry =
|
|
172
|
+
return e.id && (t = this.overlayLayer.graphics.find(
|
|
173
|
+
(o) => o.getAttribute("id") === e.id
|
|
174
|
+
)), t ? t.visible = r ?? t.visible : (r = r ?? !0, t = new y({
|
|
175
|
+
visible: r
|
|
176
|
+
}), this.overlayLayer.add(t), a = !1), t.geometry = e.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
|
|
145
177
|
}
|
|
146
178
|
}
|
|
147
179
|
export {
|
|
148
|
-
|
|
180
|
+
u as default
|
|
149
181
|
};
|
|
@@ -5,10 +5,12 @@ export default class SignalControlAreaController {
|
|
|
5
5
|
private subDistrictControllerLayer;
|
|
6
6
|
private crossLayer;
|
|
7
7
|
private highlightLayer;
|
|
8
|
+
private districtControllers;
|
|
8
9
|
private watchHandle?;
|
|
10
|
+
private openDriveServerUrl;
|
|
9
11
|
private readonly crossScale;
|
|
10
12
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
11
|
-
showSignalControlArea(params: any): IResult
|
|
13
|
+
showSignalControlArea(params: any): Promise<IResult>;
|
|
12
14
|
clearSignalControlArea(): IResult;
|
|
13
15
|
locateSignalControlArea(params: {
|
|
14
16
|
id: string;
|
|
@@ -25,12 +27,14 @@ export default class SignalControlAreaController {
|
|
|
25
27
|
*/
|
|
26
28
|
private findAreaGraphic;
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* 显示区控
|
|
29
31
|
* @param districtController
|
|
30
|
-
* @param isDistrict 是否是区控
|
|
31
32
|
* @returns
|
|
32
33
|
*/
|
|
33
|
-
private
|
|
34
|
+
private showDistrict;
|
|
35
|
+
private showSubDistrictCross;
|
|
36
|
+
private loadedSubDistricts;
|
|
37
|
+
private showSubDistrictRoad;
|
|
34
38
|
/**
|
|
35
39
|
* 生成路口点符号。在不同比例尺下,使用不同的符号
|
|
36
40
|
* @param attributes
|