gisviewer-vue3-arcgis 1.0.130 → 1.0.132
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 +7 -1
- package/es/src/gis-map/gis-map.vue.mjs +98 -94
- package/es/src/gis-map/index.d.ts +7 -1
- package/es/src/gis-map/utils/holo-flow/index.mjs +2 -1
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +137 -135
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +1 -0
- package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +2 -2
- package/es/src/gis-map/utils/signal-control-area-controller/index.d.ts +12 -1
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +87 -52
- package/lib/src/gis-map/gis-map.vue.d.ts +7 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +7 -1
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +1 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.d.ts +12 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/package.json +1 -1
|
@@ -287,8 +287,8 @@ class C {
|
|
|
287
287
|
}
|
|
288
288
|
async makeMd5FromFile(e) {
|
|
289
289
|
try {
|
|
290
|
-
const
|
|
291
|
-
return { status: 0, message: "ok", result: F(
|
|
290
|
+
const i = await (await fetch(e)).text();
|
|
291
|
+
return { status: 0, message: "ok", result: F(i) };
|
|
292
292
|
} catch (t) {
|
|
293
293
|
return { status: -1, message: t.message };
|
|
294
294
|
}
|
|
@@ -305,11 +305,11 @@ class C {
|
|
|
305
305
|
if (t.status !== 0)
|
|
306
306
|
return t;
|
|
307
307
|
this.projectName = t.result, console.timeEnd("md5用时"), this.openDriveServer = e.server, await this.makeMd5FromFile(e.file);
|
|
308
|
-
const
|
|
308
|
+
const i = `http://${this.openDriveServer}/api/openDrive/uploadXodr`;
|
|
309
309
|
let o;
|
|
310
310
|
try {
|
|
311
311
|
o = await m.post(
|
|
312
|
-
|
|
312
|
+
i,
|
|
313
313
|
{},
|
|
314
314
|
{
|
|
315
315
|
params: {
|
|
@@ -324,15 +324,15 @@ class C {
|
|
|
324
324
|
if (o.status !== 200)
|
|
325
325
|
return { status: -1, message: o.statusText };
|
|
326
326
|
console.time("渲染用时");
|
|
327
|
-
const
|
|
327
|
+
const s = o.data.result.geoSetting;
|
|
328
328
|
A.setGeoData(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
329
|
+
s.geoReference,
|
|
330
|
+
s.offsetX,
|
|
331
|
+
s.offsetY
|
|
332
332
|
);
|
|
333
333
|
let l = o.data.result.json;
|
|
334
334
|
l.startsWith(window.location.protocol) || (l = `${window.location.protocol}//${e.server}${l}`);
|
|
335
|
-
const
|
|
335
|
+
const a = await (await fetch(l)).arrayBuffer(), r = S.inflate(a, { to: "string" }), c = JSON.parse(r);
|
|
336
336
|
await this.showAllLanes(
|
|
337
337
|
c,
|
|
338
338
|
((d = e.options) == null ? void 0 : d.showJunctionLane) || !1,
|
|
@@ -351,7 +351,7 @@ class C {
|
|
|
351
351
|
* @param projectName
|
|
352
352
|
*/
|
|
353
353
|
async showOpenDriveFromServer(e, t) {
|
|
354
|
-
const
|
|
354
|
+
const i = `http://${e}/api/openDrive/analyzeXodr`, o = await m.get(i, {
|
|
355
355
|
headers: {
|
|
356
356
|
projectName: t
|
|
357
357
|
},
|
|
@@ -362,9 +362,9 @@ class C {
|
|
|
362
362
|
});
|
|
363
363
|
if (o.status !== 200)
|
|
364
364
|
throw new Error(`OpenDriveRenderer: ${o.statusText}`);
|
|
365
|
-
let
|
|
366
|
-
|
|
367
|
-
const
|
|
365
|
+
let s = o.data.result.json;
|
|
366
|
+
s.startsWith(window.location.protocol) || (s = `${window.location.protocol}//${e}${s}`);
|
|
367
|
+
const n = await (await fetch(s)).arrayBuffer(), a = S.inflate(n, { to: "string" }), r = JSON.parse(a);
|
|
368
368
|
return await this.showAllLanes(r, !1, !1), { status: 0, message: "ok" };
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
@@ -374,14 +374,14 @@ class C {
|
|
|
374
374
|
* @param showRoadName 是否显示道路名称
|
|
375
375
|
* @returns
|
|
376
376
|
*/
|
|
377
|
-
async showAllLanes(e, t,
|
|
377
|
+
async showAllLanes(e, t, i) {
|
|
378
378
|
const o = await this.laneLayer.queryFeatures();
|
|
379
379
|
return o.features.length > 0 && this.laneLayer.applyEdits({
|
|
380
380
|
deleteFeatures: o.features
|
|
381
|
-
}), this.roadNameLayer.visible =
|
|
381
|
+
}), this.roadNameLayer.visible = i, new Promise((s) => {
|
|
382
382
|
let l = 0;
|
|
383
383
|
this.allLaneGraphics = [], this.allRefLineGraphics = [];
|
|
384
|
-
const
|
|
384
|
+
const n = [];
|
|
385
385
|
for (const r of e) {
|
|
386
386
|
if (!t && r.junction !== "-1")
|
|
387
387
|
continue;
|
|
@@ -432,15 +432,15 @@ class C {
|
|
|
432
432
|
sumoId: ""
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
|
-
this.allLaneGraphics.push(k),
|
|
435
|
+
this.allLaneGraphics.push(k), n.push(k);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
442
|
-
if (
|
|
443
|
-
const r =
|
|
440
|
+
const a = setInterval(() => {
|
|
441
|
+
if (n.length > 0 || this.allRefLineGraphics.length > 0) {
|
|
442
|
+
if (n.length > 0) {
|
|
443
|
+
const r = n.splice(0, 100);
|
|
444
444
|
this.laneLayer.applyEdits({
|
|
445
445
|
addFeatures: r
|
|
446
446
|
});
|
|
@@ -452,7 +452,7 @@ class C {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
} else
|
|
455
|
-
clearInterval(
|
|
455
|
+
clearInterval(a), s();
|
|
456
456
|
}, 10);
|
|
457
457
|
});
|
|
458
458
|
}
|
|
@@ -463,22 +463,24 @@ class C {
|
|
|
463
463
|
*/
|
|
464
464
|
showJunction(e) {
|
|
465
465
|
const t = [];
|
|
466
|
-
for (const
|
|
467
|
-
|
|
466
|
+
for (const i of e) {
|
|
467
|
+
if (!i)
|
|
468
|
+
continue;
|
|
469
|
+
i.nodeType = i.type;
|
|
468
470
|
const o = new p({
|
|
469
471
|
geometry: {
|
|
470
472
|
type: "point",
|
|
471
|
-
x:
|
|
472
|
-
y:
|
|
473
|
+
x: i.coordinates[0],
|
|
474
|
+
y: i.coordinates[1]
|
|
473
475
|
},
|
|
474
476
|
attributes: {
|
|
475
|
-
...
|
|
477
|
+
...i,
|
|
476
478
|
selected: !1,
|
|
477
479
|
type: "OpenDriveJunction"
|
|
478
480
|
},
|
|
479
481
|
symbol: {
|
|
480
482
|
type: "picture-marker",
|
|
481
|
-
url:
|
|
483
|
+
url: i.crossId ? "/GisViewerAssets/Images/point_green.png" : "/GisViewerAssets/Images/point_yellow.png",
|
|
482
484
|
width: 30,
|
|
483
485
|
height: 30
|
|
484
486
|
}
|
|
@@ -496,22 +498,22 @@ class C {
|
|
|
496
498
|
const o = (l = (await this.view.hitTest(t, {
|
|
497
499
|
include: [this.laneLayer, this.junctionLayer]
|
|
498
500
|
})).results) == null ? void 0 : l.filter(
|
|
499
|
-
(
|
|
501
|
+
(n) => n.type === "graphic"
|
|
500
502
|
);
|
|
501
503
|
if (o.length === 0) {
|
|
502
504
|
this.currentSectionCode !== "" && (this.currentSectionCode = "", this.highlightGraphic = void 0, this.highlightLayer.removeAll()), this.currentJunctionId !== "" && (this.currentJunctionId = "", this.view.closePopup());
|
|
503
505
|
return;
|
|
504
506
|
}
|
|
505
|
-
const
|
|
506
|
-
if (this.hitGraphic =
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
(h) => h.getAttribute("id") ===
|
|
507
|
+
const s = o[0];
|
|
508
|
+
if (this.hitGraphic = s.graphic, s.layer.id === "OpenDriveLane") {
|
|
509
|
+
const n = `${this.hitGraphic.attributes.roadId}+${this.hitGraphic.attributes.sectionId}`;
|
|
510
|
+
if (n === this.currentSectionCode || this.sectionLayer.graphics.findIndex(
|
|
511
|
+
(h) => h.getAttribute("id") === n
|
|
510
512
|
) >= 0)
|
|
511
513
|
return;
|
|
512
|
-
this.currentSectionCode =
|
|
514
|
+
this.currentSectionCode = n;
|
|
513
515
|
const r = this.allLaneGraphics.filter(
|
|
514
|
-
(h) => `${h.attributes.roadId}+${h.attributes.sectionId}` ===
|
|
516
|
+
(h) => `${h.attributes.roadId}+${h.attributes.sectionId}` === n
|
|
515
517
|
), c = I.union(
|
|
516
518
|
r.map((h) => h.geometry)
|
|
517
519
|
);
|
|
@@ -528,20 +530,20 @@ class C {
|
|
|
528
530
|
},
|
|
529
531
|
attributes: {
|
|
530
532
|
type: "OpenDriveSection",
|
|
531
|
-
id:
|
|
533
|
+
id: n,
|
|
532
534
|
selected: !1
|
|
533
535
|
}
|
|
534
536
|
}), this.highlightLayer.removeAll(), this.highlightLayer.add(this.highlightGraphic);
|
|
535
|
-
} else if (
|
|
536
|
-
const
|
|
537
|
-
if (
|
|
537
|
+
} else if (s.layer.id === "OpenDriveJunction") {
|
|
538
|
+
const n = this.hitGraphic.getAttribute("id");
|
|
539
|
+
if (n === this.currentJunctionId)
|
|
538
540
|
return;
|
|
539
|
-
this.currentJunctionId =
|
|
540
|
-
const
|
|
541
|
+
this.currentJunctionId = n;
|
|
542
|
+
const a = this.hitGraphic.getAttribute("name"), r = this.hitGraphic.getAttribute("crossId");
|
|
541
543
|
this.view.popup.open({
|
|
542
|
-
title:
|
|
544
|
+
title: a,
|
|
543
545
|
content: `<table>
|
|
544
|
-
<tr><td>路口编号</td><td>${
|
|
546
|
+
<tr><td>路口编号</td><td>${n}</td></tr>
|
|
545
547
|
<tr><td>信号机编号</td><td>${r || "无信控"}</td></tr>
|
|
546
548
|
</table>`,
|
|
547
549
|
location: this.hitGraphic.geometry
|
|
@@ -558,55 +560,55 @@ class C {
|
|
|
558
560
|
*/
|
|
559
561
|
monitorMouseClick() {
|
|
560
562
|
const e = j.debounce(async (t) => {
|
|
561
|
-
var
|
|
562
|
-
const o = (
|
|
563
|
+
var a;
|
|
564
|
+
const o = (a = (await this.view.hitTest(t, {
|
|
563
565
|
include: [this.highlightLayer, this.junctionLayer, this.sectionLayer]
|
|
564
|
-
})).results) == null ? void 0 :
|
|
566
|
+
})).results) == null ? void 0 : a.filter(
|
|
565
567
|
(r) => r.type === "graphic"
|
|
566
568
|
);
|
|
567
569
|
if (o.length === 0)
|
|
568
570
|
return;
|
|
569
|
-
const
|
|
571
|
+
const s = o[0].graphic, l = s.getAttribute("type"), n = s.getAttribute("id");
|
|
570
572
|
if (l === "OpenDriveJunction")
|
|
571
|
-
if (
|
|
573
|
+
if (s.getAttribute("selected") === !1) {
|
|
572
574
|
const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, c = await m.get(r, {
|
|
573
575
|
params: {
|
|
574
|
-
id:
|
|
576
|
+
id: n,
|
|
575
577
|
projectName: this.projectName
|
|
576
578
|
}
|
|
577
579
|
});
|
|
578
580
|
c.status === 200 && c.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
|
|
579
581
|
type: "OpenDriveJunction",
|
|
580
|
-
id:
|
|
582
|
+
id: n,
|
|
581
583
|
details: c.data.result
|
|
582
|
-
}),
|
|
584
|
+
}), s.setAttribute("selected", !0), s.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(s, 50));
|
|
583
585
|
} else {
|
|
584
586
|
this.openDriveClickCallback && this.openDriveClickCallback({
|
|
585
587
|
type: "OpenDriveJunction",
|
|
586
|
-
id:
|
|
588
|
+
id: n,
|
|
587
589
|
details: void 0
|
|
588
|
-
}),
|
|
589
|
-
const r =
|
|
590
|
-
|
|
590
|
+
}), s.setAttribute("selected", !1);
|
|
591
|
+
const r = s.getAttribute("crossId");
|
|
592
|
+
s.symbol.url = r ? "/GisViewerAssets/Images/point_green.png" : "/GisViewerAssets/Images/point_yellow.png", this.decreasePictureMarkerSize(s, 30);
|
|
591
593
|
}
|
|
592
594
|
else if (l === "OpenDriveSection")
|
|
593
|
-
if (
|
|
594
|
-
this.sectionLayer.remove(
|
|
595
|
+
if (s.getAttribute("selected"))
|
|
596
|
+
this.sectionLayer.remove(s), this.openDriveClickCallback && this.openDriveClickCallback({
|
|
595
597
|
type: "OpenDriveSection",
|
|
596
|
-
id:
|
|
598
|
+
id: n,
|
|
597
599
|
details: void 0
|
|
598
600
|
});
|
|
599
601
|
else {
|
|
600
|
-
this.highlightLayer.remove(
|
|
602
|
+
this.highlightLayer.remove(s), this.sectionLayer.add(s), s.setAttribute("selected", !0);
|
|
601
603
|
const r = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, c = await m.get(r, {
|
|
602
604
|
params: {
|
|
603
|
-
id:
|
|
605
|
+
id: n,
|
|
604
606
|
projectName: this.projectName
|
|
605
607
|
}
|
|
606
608
|
});
|
|
607
|
-
c.status === 200 && c.data.status === 0 && this.openDriveClickCallback && (
|
|
609
|
+
c.status === 200 && c.data.status === 0 && this.openDriveClickCallback && (s.setAttribute("edgeId", c.data.result.obj_id), this.openDriveClickCallback({
|
|
608
610
|
type: "OpenDriveSection",
|
|
609
|
-
id:
|
|
611
|
+
id: n,
|
|
610
612
|
details: c.data.result
|
|
611
613
|
}));
|
|
612
614
|
}
|
|
@@ -622,14 +624,14 @@ class C {
|
|
|
622
624
|
* @param targetSize
|
|
623
625
|
*/
|
|
624
626
|
increasePictureMarkerSize(e, t) {
|
|
625
|
-
const
|
|
626
|
-
const o = e.symbol,
|
|
627
|
-
|
|
627
|
+
const i = setInterval(() => {
|
|
628
|
+
const o = e.symbol, s = o.width;
|
|
629
|
+
s < t ? e.symbol = {
|
|
628
630
|
type: "picture-marker",
|
|
629
631
|
url: o.url,
|
|
630
|
-
width:
|
|
631
|
-
height:
|
|
632
|
-
} : clearInterval(
|
|
632
|
+
width: s + 1,
|
|
633
|
+
height: s + 1
|
|
634
|
+
} : clearInterval(i);
|
|
633
635
|
}, 20);
|
|
634
636
|
}
|
|
635
637
|
/**
|
|
@@ -638,46 +640,46 @@ class C {
|
|
|
638
640
|
* @param targetSize
|
|
639
641
|
*/
|
|
640
642
|
decreasePictureMarkerSize(e, t) {
|
|
641
|
-
const
|
|
642
|
-
const o = e.symbol,
|
|
643
|
-
|
|
643
|
+
const i = setInterval(() => {
|
|
644
|
+
const o = e.symbol, s = o.width;
|
|
645
|
+
s > t ? e.symbol = {
|
|
644
646
|
type: "picture-marker",
|
|
645
647
|
url: o.url,
|
|
646
|
-
width:
|
|
647
|
-
height:
|
|
648
|
-
} : clearInterval(
|
|
648
|
+
width: s - 1,
|
|
649
|
+
height: s - 1
|
|
650
|
+
} : clearInterval(i);
|
|
649
651
|
}, 20);
|
|
650
652
|
}
|
|
651
653
|
async getSumoInfo(e) {
|
|
652
654
|
switch (e.type) {
|
|
653
655
|
case "junction": {
|
|
654
|
-
const t = `http://${this.openDriveServer}/api/sumo/getSumoJunction`,
|
|
656
|
+
const t = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, i = await m.get(t, {
|
|
655
657
|
params: {
|
|
656
658
|
id: e.id,
|
|
657
659
|
projectName: this.projectName
|
|
658
660
|
}
|
|
659
661
|
});
|
|
660
|
-
return
|
|
662
|
+
return i.status === 200 ? i.data : { status: -1, message: `路口信息查询失败: ${e.id}` };
|
|
661
663
|
}
|
|
662
664
|
case "edge": {
|
|
663
665
|
const t = e.id.split("#");
|
|
664
|
-
let
|
|
665
|
-
|
|
666
|
+
let i = t[0];
|
|
667
|
+
i.startsWith("-") && (i = i.slice(1));
|
|
666
668
|
let o = 0;
|
|
667
669
|
t.length === 2 && (o = Number(t[1]));
|
|
668
|
-
const
|
|
669
|
-
(l) => l.getAttribute("roadId") ===
|
|
670
|
+
const s = this.allLaneGraphics.find(
|
|
671
|
+
(l) => l.getAttribute("roadId") === i && l.getAttribute("sectionIndex") === o
|
|
670
672
|
);
|
|
671
|
-
if (
|
|
672
|
-
const l = `${
|
|
673
|
+
if (s) {
|
|
674
|
+
const l = `${i}+${s.getAttribute(
|
|
673
675
|
"sectionId"
|
|
674
|
-
)}`,
|
|
676
|
+
)}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await m.get(n, {
|
|
675
677
|
params: {
|
|
676
678
|
id: l,
|
|
677
679
|
projectName: this.projectName
|
|
678
680
|
}
|
|
679
681
|
});
|
|
680
|
-
return
|
|
682
|
+
return a.status === 200 ? a.data : { status: -1, message: `路段信息查询失败: ${l}` };
|
|
681
683
|
} else
|
|
682
684
|
return { status: -1, message: "未知类型" };
|
|
683
685
|
}
|
|
@@ -689,13 +691,13 @@ class C {
|
|
|
689
691
|
* 清除OpenDrive内容
|
|
690
692
|
*/
|
|
691
693
|
async clearOpenDrive() {
|
|
692
|
-
var t,
|
|
694
|
+
var t, i;
|
|
693
695
|
let e = await this.laneLayer.queryFeatures();
|
|
694
696
|
e.features.length > 0 && await this.laneLayer.applyEdits({
|
|
695
697
|
deleteFeatures: e.features
|
|
696
698
|
}), e = await this.roadNameLayer.queryFeatures(), e.features.length > 0 && await this.roadNameLayer.applyEdits({
|
|
697
699
|
deleteFeatures: e.features
|
|
698
|
-
}), this.highlightLayer.removeAll(), this.junctionLayer.removeAll(), this.sectionLayer.removeAll(), this.flashLayer.removeAll(), (t = this.mouseMoveHandler) == null || t.remove(), this.mouseMoveHandler = void 0, (
|
|
700
|
+
}), this.highlightLayer.removeAll(), this.junctionLayer.removeAll(), this.sectionLayer.removeAll(), this.flashLayer.removeAll(), (t = this.mouseMoveHandler) == null || t.remove(), this.mouseMoveHandler = void 0, (i = this.mouseClickHandler) == null || i.remove(), this.mouseClickHandler = void 0;
|
|
699
701
|
}
|
|
700
702
|
/**
|
|
701
703
|
* 用sumo的id定位车道、基本段、路段
|
|
@@ -703,30 +705,30 @@ class C {
|
|
|
703
705
|
* @returns
|
|
704
706
|
*/
|
|
705
707
|
async findSumo(e) {
|
|
706
|
-
const { type: t, id:
|
|
708
|
+
const { type: t, id: i } = e, o = e.flash === void 0 ? !0 : e.flash;
|
|
707
709
|
if (t === "junction")
|
|
708
|
-
return await this.findJunction(
|
|
710
|
+
return await this.findJunction(i, o);
|
|
709
711
|
if (t === "edge") {
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
+
const s = i.split("+");
|
|
713
|
+
if (s.length > 2)
|
|
712
714
|
return { status: -1, message: "id格式错误" };
|
|
713
|
-
const l =
|
|
714
|
-
if (
|
|
715
|
+
const l = s.length === 2 ? Number(s[1]) : void 0, n = s[0].split("#");
|
|
716
|
+
if (n.length > 2)
|
|
715
717
|
return { status: -1, message: "id格式错误" };
|
|
716
|
-
const
|
|
717
|
-
return await this.findLane({ roadsectId:
|
|
718
|
+
const a = n[0], r = n.length === 2 ? Number(n[1]) : void 0;
|
|
719
|
+
return await this.findLane({ roadsectId: a, segmentId: r, laneId: l, flash: o });
|
|
718
720
|
} else
|
|
719
721
|
return { status: -1, message: "未知类型" };
|
|
720
722
|
}
|
|
721
723
|
async findJunction(e, t) {
|
|
722
|
-
const
|
|
724
|
+
const i = this.junctionLayer.graphics.find(
|
|
723
725
|
(o) => o.attributes.id === e
|
|
724
726
|
);
|
|
725
|
-
if (!
|
|
727
|
+
if (!i)
|
|
726
728
|
return { status: -1, message: "未找到。请检查路口编号" };
|
|
727
729
|
if (t) {
|
|
728
730
|
const o = new p({
|
|
729
|
-
geometry:
|
|
731
|
+
geometry: i.geometry,
|
|
730
732
|
symbol: {
|
|
731
733
|
type: "simple-marker",
|
|
732
734
|
style: "circle",
|
|
@@ -740,7 +742,7 @@ class C {
|
|
|
740
742
|
});
|
|
741
743
|
this.flashGraphic(o);
|
|
742
744
|
}
|
|
743
|
-
return await this.view.goTo(
|
|
745
|
+
return await this.view.goTo(i.geometry, { duration: 1e3 }), { status: 0, message: "ok" };
|
|
744
746
|
}
|
|
745
747
|
/**
|
|
746
748
|
* 用sumo的id定位车道、基本段、路段
|
|
@@ -748,41 +750,41 @@ class C {
|
|
|
748
750
|
* @returns
|
|
749
751
|
*/
|
|
750
752
|
async findLane(e) {
|
|
751
|
-
let { roadsectId: t, segmentId:
|
|
753
|
+
let { roadsectId: t, segmentId: i, laneId: o } = e;
|
|
752
754
|
t.startsWith("-") && (t = t.slice(1));
|
|
753
|
-
let
|
|
754
|
-
(
|
|
755
|
+
let s = this.allLaneGraphics.filter(
|
|
756
|
+
(a) => a.attributes.roadId === t
|
|
755
757
|
);
|
|
756
|
-
if (
|
|
758
|
+
if (s.length === 0)
|
|
757
759
|
return { status: -1, message: "未找到。请检查路段编号" };
|
|
758
|
-
if (
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
760
|
+
if (i !== void 0) {
|
|
761
|
+
const a = [];
|
|
762
|
+
if (s.forEach((r) => {
|
|
761
763
|
const c = Number(r.attributes.sectionId);
|
|
762
|
-
|
|
763
|
-
}),
|
|
764
|
+
a.indexOf(c) === -1 && a.push(c);
|
|
765
|
+
}), a.sort((r, c) => r - c), i > a.length - 1)
|
|
764
766
|
return { status: -1, message: "未找到。请检查基本段编号" };
|
|
765
|
-
|
|
766
|
-
(r) => Number(r.attributes.sectionId) ===
|
|
767
|
+
i = a[i], s = s.filter(
|
|
768
|
+
(r) => Number(r.attributes.sectionId) === i
|
|
767
769
|
);
|
|
768
770
|
}
|
|
769
771
|
if (o !== void 0) {
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
+
const a = [];
|
|
773
|
+
if (s.forEach((r) => {
|
|
772
774
|
const c = Number(r.attributes.laneId);
|
|
773
|
-
|
|
774
|
-
}),
|
|
775
|
+
a.indexOf(c) === -1 && a.push(c);
|
|
776
|
+
}), a.sort((r, c) => r - c), o > a.length - 1)
|
|
775
777
|
return { status: -1, message: "未找到。请检查车道编号" };
|
|
776
|
-
o =
|
|
778
|
+
o = a[o], s = s.filter(
|
|
777
779
|
(r) => Number(r.attributes.laneId) === o
|
|
778
780
|
);
|
|
779
781
|
}
|
|
780
|
-
const l =
|
|
781
|
-
(
|
|
782
|
-
),
|
|
782
|
+
const l = s.map(
|
|
783
|
+
(a) => a.geometry
|
|
784
|
+
), n = I.union(l);
|
|
783
785
|
if (e.flash) {
|
|
784
|
-
const
|
|
785
|
-
geometry:
|
|
786
|
+
const a = new p({
|
|
787
|
+
geometry: n,
|
|
786
788
|
symbol: {
|
|
787
789
|
type: "simple-fill",
|
|
788
790
|
color: [255, 0, 0, 0.5],
|
|
@@ -793,9 +795,9 @@ class C {
|
|
|
793
795
|
}
|
|
794
796
|
}
|
|
795
797
|
});
|
|
796
|
-
this.flashGraphic(
|
|
798
|
+
this.flashGraphic(a);
|
|
797
799
|
}
|
|
798
|
-
return await this.view.goTo(
|
|
800
|
+
return await this.view.goTo(n, { duration: 1e3 }), { status: 0, message: "ok" };
|
|
799
801
|
}
|
|
800
802
|
/**
|
|
801
803
|
* graphic渐隐渐显闪烁
|
|
@@ -803,9 +805,9 @@ class C {
|
|
|
803
805
|
*/
|
|
804
806
|
flashGraphic(e) {
|
|
805
807
|
this.flashLayer.removeAll(), this.flashLayer.add(e);
|
|
806
|
-
let t = 0,
|
|
808
|
+
let t = 0, i = !0;
|
|
807
809
|
const o = setInterval(() => {
|
|
808
|
-
|
|
810
|
+
i ? (this.flashLayer.opacity -= 0.02, this.flashLayer.opacity <= 0.1 && (i = !1, t++)) : (this.flashLayer.opacity += 0.02, this.flashLayer.opacity >= 1 && (i = !0)), t >= 5 && (this.flashLayer.removeAll(), this.flashLayer.opacity = 1, clearInterval(o));
|
|
809
811
|
}, 10);
|
|
810
812
|
}
|
|
811
813
|
/**
|
|
@@ -817,15 +819,15 @@ class C {
|
|
|
817
819
|
if ((!e || e.type === "junction") && this.junctionLayer.graphics.forEach((t) => {
|
|
818
820
|
if ((!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected")) {
|
|
819
821
|
t.setAttribute("selected", !1);
|
|
820
|
-
const
|
|
821
|
-
t.symbol.url =
|
|
822
|
+
const i = t.getAttribute("crossId");
|
|
823
|
+
t.symbol.url = i ? "/GisViewerAssets/Images/point_green.png" : "/GisViewerAssets/Images/point_yellow.png", this.decreasePictureMarkerSize(t, 30);
|
|
822
824
|
}
|
|
823
825
|
}), !e || e.type === "edge")
|
|
824
826
|
if (!e || !e.id || e.id === "")
|
|
825
827
|
this.sectionLayer.removeAll();
|
|
826
828
|
else {
|
|
827
829
|
const t = this.sectionLayer.graphics.find(
|
|
828
|
-
(
|
|
830
|
+
(i) => i.getAttribute("edgeId") === e.id
|
|
829
831
|
);
|
|
830
832
|
t && this.sectionLayer.remove(t);
|
|
831
833
|
}
|
|
@@ -845,17 +847,17 @@ class C {
|
|
|
845
847
|
}), { status: -1, message: "未找到路口" };
|
|
846
848
|
case "edge": {
|
|
847
849
|
const t = e.id.split("#");
|
|
848
|
-
let
|
|
849
|
-
|
|
850
|
+
let i = t[0];
|
|
851
|
+
i.startsWith("-") && (i = i.slice(1));
|
|
850
852
|
let o = 0;
|
|
851
853
|
t.length === 2 && (o = Number(t[1]));
|
|
852
|
-
const
|
|
853
|
-
(l) => l.getAttribute("roadId") ===
|
|
854
|
+
const s = this.allLaneGraphics.filter(
|
|
855
|
+
(l) => l.getAttribute("roadId") === i && l.getAttribute("sectionIndex") === o
|
|
854
856
|
);
|
|
855
|
-
if (
|
|
857
|
+
if (s.length > 0) {
|
|
856
858
|
const l = I.union(
|
|
857
|
-
|
|
858
|
-
),
|
|
859
|
+
s.map((a) => a.geometry)
|
|
860
|
+
), n = new p({
|
|
859
861
|
geometry: l,
|
|
860
862
|
symbol: {
|
|
861
863
|
type: "simple-fill",
|
|
@@ -872,7 +874,7 @@ class C {
|
|
|
872
874
|
selected: !0
|
|
873
875
|
}
|
|
874
876
|
});
|
|
875
|
-
return this.sectionLayer.add(
|
|
877
|
+
return this.sectionLayer.add(n), { status: 0, message: "ok" };
|
|
876
878
|
} else
|
|
877
879
|
return { status: -1, message: "未找到路段" };
|
|
878
880
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class r {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
this.crosses = [], this.subDistricts = [], this.areaColor = [
|
|
3
|
+
this.parentName = "", this.crosses = [], this.subDistricts = [], this.areaColor = [
|
|
4
4
|
Math.floor(Math.random() * 255),
|
|
5
5
|
Math.floor(Math.random() * 255),
|
|
6
6
|
Math.floor(Math.random() * 255)
|
|
@@ -8,7 +8,7 @@ class r {
|
|
|
8
8
|
for (const s of t.children)
|
|
9
9
|
if (s.children) {
|
|
10
10
|
const o = new r(s);
|
|
11
|
-
o.areaColor = this.areaColor, this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
|
|
11
|
+
o.parentName = this.name, o.areaColor = this.areaColor, this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
|
|
12
12
|
} else {
|
|
13
13
|
const o = {
|
|
14
14
|
id: s.id,
|
|
@@ -4,13 +4,24 @@ export default class SignalControlAreaController {
|
|
|
4
4
|
private districtControllerLayer;
|
|
5
5
|
private subDistrictControllerLayer;
|
|
6
6
|
private crossLayer;
|
|
7
|
+
private highlightLayer;
|
|
7
8
|
private eventHandle?;
|
|
8
9
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
9
10
|
showSignalControlArea(params: any): IResult;
|
|
10
11
|
clearSignalControlArea(): IResult;
|
|
11
12
|
locateSignalControlArea(params: {
|
|
12
13
|
id: string;
|
|
13
|
-
}): IResult
|
|
14
|
+
}): Promise<IResult>;
|
|
15
|
+
highlightSignalControlArea(params: {
|
|
16
|
+
id: string;
|
|
17
|
+
}): Promise<IResult>;
|
|
18
|
+
resetHighlight(): IResult;
|
|
19
|
+
/**
|
|
20
|
+
* 在区控\子区\路口图层中查找对应的graphic
|
|
21
|
+
* @param id
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
private findAreaGraphic;
|
|
14
25
|
/**
|
|
15
26
|
* 绘制区控与子区
|
|
16
27
|
* @param districtController
|