gisviewer-vue3-arcgis 1.0.262 → 1.0.263

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.
@@ -1,19 +1,19 @@
1
1
  import I from "@arcgis/core/Graphic";
2
2
  import * as C from "@arcgis/core/core/promiseUtils";
3
- import * as F from "@arcgis/core/core/reactiveUtils.js";
4
- import { Polygon as S, Point as J } from "@arcgis/core/geometry";
3
+ import * as $ from "@arcgis/core/core/reactiveUtils.js";
4
+ import { Polygon as S, Point as F } from "@arcgis/core/geometry";
5
5
  import * as L from "@arcgis/core/geometry/geometryEngine";
6
6
  import D from "@arcgis/core/layers/FeatureLayer";
7
- import w from "@arcgis/core/layers/GraphicsLayer";
7
+ import v from "@arcgis/core/layers/GraphicsLayer";
8
8
  import * as G from "@turf/helpers";
9
9
  import { lineSliceAlong as x } from "@turf/line-slice-along";
10
- import v from "axios";
11
- import { XMLParser as E } from "fast-xml-parser";
12
- import B from "md5";
10
+ import w from "axios";
11
+ import { XMLParser as J } from "fast-xml-parser";
12
+ import E from "md5";
13
13
  import M from "pako";
14
14
  import { watch as R } from "vue";
15
15
  import T from "../../stores/index.mjs";
16
- import N from "../common-utils.mjs";
16
+ import A from "../common-utils.mjs";
17
17
  class O {
18
18
  constructor(e) {
19
19
  this.junctionNames = /* @__PURE__ */ new Map(), this.junctionScale = 5e3, this.xodrBorder = [], this.projectName = "", this.openDriveServer = "", this.currentSectionCode = "", this.selectedSectionIds = [], this.currentJunctionId = "", this.view = e, this.laneLayer = new D({
@@ -294,7 +294,7 @@ class O {
294
294
  }
295
295
  }
296
296
  ]
297
- }), this.junctionLayer = new w({ id: "OpenDriveJunction" }), this.sectionLayer = new w({ id: "OpenDriveSection" }), this.highlightLayer = new w({ id: "OpenDriveHighlight" }), this.flashLayer = new w({ id: "OpenDriveFlash" }), this.drawLayer = new w({ id: "Draw" }), this.splitLaneLayer = new w({ id: "SplitLane" }), this.borderLayer = new w({ id: "OpenDriveBorder" }), this.view.map.addMany([
297
+ }), this.junctionLayer = new v({ id: "OpenDriveJunction" }), this.sectionLayer = new v({ id: "OpenDriveSection" }), this.highlightLayer = new v({ id: "OpenDriveHighlight" }), this.flashLayer = new v({ id: "OpenDriveFlash" }), this.drawLayer = new v({ id: "Draw" }), this.splitLaneLayer = new v({ id: "SplitLane" }), this.borderLayer = new v({ id: "OpenDriveBorder" }), this.view.map.addMany([
298
298
  this.laneLayer,
299
299
  this.sectionLayer,
300
300
  this.roadNameLayer,
@@ -310,14 +310,14 @@ class O {
310
310
  return this.instance || (this.instance = new O(e)), this.instance;
311
311
  }
312
312
  async makeMd5FromFile(e) {
313
- var i;
313
+ var t;
314
314
  try {
315
315
  const s = await (await fetch(e)).text();
316
- let n = (i = new E({
316
+ let r = (t = new J({
317
317
  ignoreAttributes: !1,
318
318
  allowBooleanAttributes: !0
319
- }).parse(s).OpenDRIVE.userData) == null ? void 0 : i.border;
320
- return n ? n = JSON.parse(n) : n = [], { status: 0, message: "ok", result: { md5: B(s), border: n } };
319
+ }).parse(s).OpenDRIVE.userData) == null ? void 0 : t.border;
320
+ return r ? r = JSON.parse(r) : r = [], { status: 0, message: "ok", result: { md5: E(s), border: r } };
321
321
  } catch (o) {
322
322
  return { status: -1, message: o.message };
323
323
  }
@@ -329,24 +329,24 @@ class O {
329
329
  */
330
330
  async showOpenDriveFromFile(e) {
331
331
  var d, y, h;
332
- this.openDriveClickCallback = e.selectedCallback, this.scaleWatch = F.watch(
332
+ this.openDriveClickCallback = e.selectedCallback, this.scaleWatch = $.watch(
333
333
  () => this.view.scale,
334
334
  (u, p) => {
335
335
  u > this.junctionScale && p <= this.junctionScale ? this.updateAllJunctionSymbol("marker") : u <= this.junctionScale && p > this.junctionScale && this.updateAllJunctionSymbol("picture");
336
336
  }
337
337
  );
338
- let i = e.file.split("/").pop() || "";
339
- i = i.split(".").slice(0, -1).join("."), this.openDriveServer = e.server;
338
+ let t = e.file.split("/").pop() || "";
339
+ t = t.split(".").slice(0, -1).join("."), this.openDriveServer = e.server;
340
340
  const o = `http://${this.openDriveServer}/api/openDrive/uploadXodr`;
341
341
  let s;
342
342
  try {
343
- s = await v.post(
343
+ s = await w.post(
344
344
  o,
345
345
  {},
346
346
  {
347
347
  params: {
348
348
  url: e.file,
349
- projectName: i
349
+ projectName: t
350
350
  }
351
351
  }
352
352
  );
@@ -356,21 +356,21 @@ class O {
356
356
  if (s.status !== 200)
357
357
  return { status: -1, message: s.statusText };
358
358
  console.time("渲染用时");
359
- const t = s.data.result.geoSetting;
360
- N.setGeoData(
361
- t.geoReference,
362
- t.offsetX,
363
- t.offsetY
359
+ const i = s.data.result.geoSetting;
360
+ A.setGeoData(
361
+ i.geoReference,
362
+ i.offsetX,
363
+ i.offsetY
364
364
  );
365
- let c = s.data.result.json;
366
- c.startsWith(window.location.protocol) || (c = `${window.location.protocol}//${e.server}${c}`);
367
- const n = await fetch(c);
365
+ let l = s.data.result.json;
366
+ l.startsWith(window.location.protocol) || (l = `${window.location.protocol}//${e.server}${l}`);
367
+ const r = await fetch(l);
368
368
  let a;
369
- if (c.endsWith("bin")) {
370
- const u = await n.arrayBuffer(), p = M.inflate(u, { to: "string" });
369
+ if (l.endsWith("bin")) {
370
+ const u = await r.arrayBuffer(), p = M.inflate(u, { to: "string" });
371
371
  a = JSON.parse(p);
372
372
  } else
373
- a = await n.json();
373
+ a = await r.json();
374
374
  if (await this.showAllLanes(
375
375
  a,
376
376
  ((d = e.options) == null ? void 0 : d.showJunctionLane) || !1,
@@ -380,12 +380,12 @@ class O {
380
380
  this.showJunction(u);
381
381
  }
382
382
  e.options && e.options.centerMap !== !1 && await this.view.goTo(this.allLaneGraphics), this.mouseMoveHandler || this.monitorMouseMove(), this.mouseClickHandler || this.monitorMouseClick();
383
- const r = T.useAppDataStore;
383
+ const n = T.useAppDataStore;
384
384
  return R(
385
- () => r.isSketching,
385
+ () => n.isSketching,
386
386
  () => {
387
387
  var u, p;
388
- r.isSketching ? ((u = this.mouseMoveHandler) == null || u.remove(), this.mouseMoveHandler = void 0, (p = this.mouseClickHandler) == null || p.remove(), this.mouseClickHandler = void 0) : (this.monitorMouseMove(), this.monitorMouseClick());
388
+ n.isSketching ? ((u = this.mouseMoveHandler) == null || u.remove(), this.mouseMoveHandler = void 0, (p = this.mouseClickHandler) == null || p.remove(), this.mouseClickHandler = void 0) : (this.monitorMouseMove(), this.monitorMouseClick());
389
389
  }
390
390
  ), console.timeEnd("渲染用时"), { status: 0, message: "ok" };
391
391
  }
@@ -394,10 +394,10 @@ class O {
394
394
  * @param server
395
395
  * @param projectName
396
396
  */
397
- async showOpenDriveFromServer(e, i) {
398
- const o = `http://${e}/api/openDrive/analyzeXodr`, s = await v.get(o, {
397
+ async showOpenDriveFromServer(e, t) {
398
+ const o = `http://${e}/api/openDrive/analyzeXodr`, s = await w.get(o, {
399
399
  headers: {
400
- projectName: i
400
+ projectName: t
401
401
  },
402
402
  params: {
403
403
  analyze: !1,
@@ -406,16 +406,16 @@ class O {
406
406
  });
407
407
  if (s.status !== 200)
408
408
  throw new Error(`OpenDriveRenderer: ${s.statusText}`);
409
- let t = s.data.result.json;
410
- t.startsWith(window.location.protocol) || (t = `${window.location.protocol}//${e}${t}`);
411
- const c = await fetch(t);
412
- let n;
413
- if (t.endsWith("bin")) {
414
- const a = await c.arrayBuffer(), l = M.inflate(a, { to: "string" });
415
- n = JSON.parse(l);
409
+ let i = s.data.result.json;
410
+ i.startsWith(window.location.protocol) || (i = `${window.location.protocol}//${e}${i}`);
411
+ const l = await fetch(i);
412
+ let r;
413
+ if (i.endsWith("bin")) {
414
+ const a = await l.arrayBuffer(), c = M.inflate(a, { to: "string" });
415
+ r = JSON.parse(c);
416
416
  } else
417
- n = await c.json();
418
- return await this.showAllLanes(n, !1, !1), { status: 0, message: "ok" };
417
+ r = await l.json();
418
+ return await this.showAllLanes(r, !1, !1), { status: 0, message: "ok" };
419
419
  }
420
420
  /**
421
421
  * 显示所有车道
@@ -424,20 +424,20 @@ class O {
424
424
  * @param showRoadName 是否显示道路名称
425
425
  * @returns
426
426
  */
427
- async showAllLanes(e, i, o) {
427
+ async showAllLanes(e, t, o) {
428
428
  const s = await this.laneLayer.queryFeatures();
429
429
  return s.features.length > 0 && this.laneLayer.applyEdits({
430
430
  deleteFeatures: s.features
431
- }), this.roadNameLayer.visible = o, new Promise((t) => {
432
- var l;
433
- let c = 0;
431
+ }), this.roadNameLayer.visible = o, new Promise((i) => {
432
+ var c;
433
+ let l = 0;
434
434
  this.allLaneGraphics = [], this.allRefLineGraphics = [];
435
- const n = [];
436
- for (const r of e) {
437
- if (!i && r.junction !== "-1")
435
+ const r = [];
436
+ for (const n of e) {
437
+ if (!t && n.junction !== "-1")
438
438
  continue;
439
- const { id: d, refLine: y } = r;
440
- let h = r.name;
439
+ const { id: d, refLine: y } = n;
440
+ let h = n.name;
441
441
  h.includes("(") && (h = h.slice(0, h.indexOf("("))), h = h.replace(/(.)/g, "$1 ");
442
442
  const u = new I({
443
443
  geometry: {
@@ -445,72 +445,72 @@ class O {
445
445
  paths: [y]
446
446
  },
447
447
  attributes: {
448
- ObjectID: c++,
448
+ ObjectID: l++,
449
449
  roadId: d,
450
450
  roadName: h
451
451
  }
452
452
  });
453
- this.allRefLineGraphics.push(u), r.laneSections.sort((p, m) => Number(p.id) - Number(m.id));
454
- for (let p = 0; p < r.laneSections.length; p++) {
455
- const m = r.laneSections[p], b = Number(m.id);
456
- for (const f of m.lanePaths) {
457
- const g = Number(f.id);
458
- if (g === 0)
453
+ this.allRefLineGraphics.push(u), n.laneSections.sort((p, g) => Number(p.id) - Number(g.id));
454
+ for (let p = 0; p < n.laneSections.length; p++) {
455
+ const g = n.laneSections[p], m = Number(g.id);
456
+ for (const f of g.lanePaths) {
457
+ const b = Number(f.id);
458
+ if (b === 0)
459
459
  continue;
460
- const P = f.type, $ = [...f.outerPath], A = f.innerPath.concat(
461
- $.reverse()
460
+ const B = f.type, P = [...f.outerPath], N = f.innerPath.concat(
461
+ P.reverse()
462
462
  );
463
- if (A.length <= 3) {
464
- console.warn(`lane ${g} has less than 3 points`);
463
+ if (N.length <= 3) {
464
+ console.warn(`lane ${b} has less than 3 points`);
465
465
  continue;
466
466
  }
467
- A.push(f.innerPath[0]);
467
+ N.push(f.innerPath[0]);
468
468
  const k = new S({
469
- rings: [A]
469
+ rings: [N]
470
470
  });
471
471
  if (k) {
472
472
  const j = new I({
473
473
  geometry: k,
474
474
  attributes: {
475
- ObjectID: c++,
476
- id: `${d}+${b}+${g}`,
477
- fromNode: r.fromNode,
478
- toNode: r.toNode,
475
+ ObjectID: l++,
476
+ id: `${d}+${m}+${b}`,
477
+ fromNode: n.fromNode,
478
+ toNode: n.toNode,
479
479
  roadId: String(d),
480
- roadName: r.name,
481
- sectionId: String(b),
480
+ roadName: n.name,
481
+ sectionId: String(m),
482
482
  sectionIndex: p,
483
- laneId: g,
484
- type: P,
483
+ laneId: b,
484
+ type: B,
485
485
  sumoId: "",
486
486
  // 记录左右边线的起始点,用于按长度高亮车道的一部分
487
487
  leftLine: f.innerPath,
488
488
  rightLine: f.outerPath,
489
489
  // array转为逗号分隔的字符串
490
- roadsectBaseIds: (l = m.roadsectBaseIds) == null ? void 0 : l.toString()
490
+ roadsectBaseIds: (c = g.roadsectBaseIds) == null ? void 0 : c.toString()
491
491
  }
492
492
  });
493
- this.allLaneGraphics.push(j), n.push(j);
493
+ this.allLaneGraphics.push(j), r.push(j);
494
494
  }
495
495
  }
496
496
  }
497
497
  }
498
498
  const a = setInterval(() => {
499
- if (n.length > 0 || this.allRefLineGraphics.length > 0) {
500
- if (n.length > 0) {
501
- const r = n.splice(0, 100);
499
+ if (r.length > 0 || this.allRefLineGraphics.length > 0) {
500
+ if (r.length > 0) {
501
+ const n = r.splice(0, 100);
502
502
  this.laneLayer.applyEdits({
503
- addFeatures: r
503
+ addFeatures: n
504
504
  });
505
505
  }
506
506
  if (this.allRefLineGraphics.length > 0) {
507
- const r = this.allRefLineGraphics.splice(0, 10);
507
+ const n = this.allRefLineGraphics.splice(0, 10);
508
508
  this.roadNameLayer.applyEdits({
509
- addFeatures: r
509
+ addFeatures: n
510
510
  });
511
511
  }
512
512
  } else
513
- clearInterval(a), t();
513
+ clearInterval(a), i();
514
514
  }, 10);
515
515
  });
516
516
  }
@@ -520,21 +520,21 @@ class O {
520
520
  * @returns
521
521
  */
522
522
  showJunction(e) {
523
- const i = [];
523
+ const t = [];
524
524
  let o;
525
525
  this.xodrBorder.length > 0 && (o = new S({
526
526
  rings: [this.xodrBorder]
527
527
  }));
528
528
  for (const s of e)
529
529
  if (s && (this.junctionNames.set(s.id, s.name), s.nodeType = s.type, s.crossId)) {
530
- const t = new J({
530
+ const i = new F({
531
531
  x: s.coordinates[0],
532
532
  y: s.coordinates[1]
533
533
  });
534
- let c = !0;
535
- if (o && (c = L.contains(o, t)), c) {
536
- const n = new I({
537
- geometry: t,
534
+ let l = !0;
535
+ if (o && (l = L.contains(o, i)), l) {
536
+ const r = new I({
537
+ geometry: i,
538
538
  attributes: {
539
539
  ...s,
540
540
  selected: !1,
@@ -542,42 +542,42 @@ class O {
542
542
  },
543
543
  symbol: this.getCrossGraphicSymbol(s, "marker")
544
544
  });
545
- i.push(n);
545
+ t.push(r);
546
546
  }
547
547
  }
548
- this.junctionLayer.addMany(i);
548
+ this.junctionLayer.addMany(t);
549
549
  }
550
550
  /**
551
551
  * 监听鼠标移动事件,高亮显示鼠标所在路段和路口
552
552
  */
553
553
  monitorMouseMove() {
554
- const e = C.debounce(async (i) => {
555
- var c;
556
- const s = (c = (await this.view.hitTest(i, {
554
+ const e = C.debounce(async (t) => {
555
+ var l;
556
+ const s = (l = (await this.view.hitTest(t, {
557
557
  include: [this.laneLayer, this.junctionLayer]
558
- })).results) == null ? void 0 : c.filter(
559
- (n) => n.type === "graphic"
558
+ })).results) == null ? void 0 : l.filter(
559
+ (r) => r.type === "graphic"
560
560
  );
561
561
  if (s.length === 0) {
562
562
  this.currentSectionCode !== "" && (this.currentSectionCode = "", this.highlightLayer.removeAll()), this.currentJunctionId !== "" && (this.currentJunctionId = ""), this.view.closePopup();
563
563
  return;
564
564
  }
565
- const t = s[0];
566
- if (this.hitGraphic = t.graphic, t.layer.id === "OpenDriveLane") {
567
- const n = `${this.hitGraphic.getAttribute(
565
+ const i = s[0];
566
+ if (this.hitGraphic = i.graphic, i.layer.id === "OpenDriveLane") {
567
+ const r = `${this.hitGraphic.getAttribute(
568
568
  "roadId"
569
- )}+${this.hitGraphic.getAttribute("sectionId")}`;
570
- if (this.currentSectionCode === n || this.selectedSectionIds.includes(n) || this.sectionLayer.graphics.findIndex(
571
- (m) => m.getAttribute("id") === n
569
+ )}+${this.hitGraphic.getAttribute("sectionId")}`, a = this.hitGraphic.getAttribute("roadsectBaseIds");
570
+ if (this.currentSectionCode === r || this.selectedSectionIds.includes(a) || this.sectionLayer.graphics.findIndex(
571
+ (m) => m.getAttribute("id") === r
572
572
  ) >= 0)
573
573
  return;
574
- this.currentSectionCode = n;
575
- const l = this.allLaneGraphics.filter(
576
- (m) => `${m.attributes.roadId}+${m.attributes.sectionId}` === n
577
- ), r = L.union(
578
- l.map((m) => m.geometry)
579
- ), d = this.hitGraphic.getAttribute("fromNode"), y = this.hitGraphic.getAttribute("toNode"), h = this.junctionNames.get(d) || d, u = this.junctionNames.get(y) || y, p = new I({
580
- geometry: r,
574
+ this.currentSectionCode = r;
575
+ const n = this.allLaneGraphics.filter(
576
+ (m) => `${m.attributes.roadId}+${m.attributes.sectionId}` === r
577
+ ), d = L.union(
578
+ n.map((m) => m.geometry)
579
+ ), y = this.hitGraphic.getAttribute("fromNode"), h = this.hitGraphic.getAttribute("toNode"), u = this.junctionNames.get(y) || y, p = this.junctionNames.get(h) || h, g = new I({
580
+ geometry: d,
581
581
  symbol: {
582
582
  type: "simple-fill",
583
583
  color: [0, 255, 255, 0.5],
@@ -589,11 +589,11 @@ class O {
589
589
  },
590
590
  attributes: {
591
591
  type: "OpenDriveSection",
592
- id: n,
592
+ id: r,
593
593
  selected: !1,
594
- fromNodeName: h,
595
- toNodeName: u,
596
- laneCount: l.length,
594
+ fromNodeName: u,
595
+ toNodeName: p,
596
+ laneCount: n.length,
597
597
  roadsectBaseIds: this.hitGraphic.getAttribute("roadsectBaseIds")
598
598
  },
599
599
  popupTemplate: {
@@ -619,16 +619,16 @@ class O {
619
619
  ]
620
620
  }
621
621
  });
622
- this.highlightLayer.removeAll(), this.highlightLayer.add(p);
623
- } else if (t.layer.id === "OpenDriveJunction") {
624
- const n = this.hitGraphic.getAttribute("id");
625
- if (n === this.currentJunctionId)
622
+ this.highlightLayer.removeAll(), this.highlightLayer.add(g);
623
+ } else if (i.layer.id === "OpenDriveJunction") {
624
+ const r = this.hitGraphic.getAttribute("id");
625
+ if (r === this.currentJunctionId)
626
626
  return;
627
- this.currentJunctionId = n;
627
+ this.currentJunctionId = r;
628
628
  }
629
629
  });
630
- this.mouseMoveHandler = this.view.on("pointer-move", async (i) => {
631
- e(i).catch(() => {
630
+ this.mouseMoveHandler = this.view.on("pointer-move", async (t) => {
631
+ e(t).catch(() => {
632
632
  });
633
633
  });
634
634
  }
@@ -636,48 +636,48 @@ class O {
636
636
  * 监听鼠标点击事件,获取高亮要素的拓扑信息
637
637
  */
638
638
  monitorMouseClick() {
639
- const e = C.debounce(async (i) => {
639
+ const e = C.debounce(async (t) => {
640
640
  var a;
641
- const s = (a = (await this.view.hitTest(i, {
641
+ const s = (a = (await this.view.hitTest(t, {
642
642
  include: [this.highlightLayer, this.junctionLayer, this.sectionLayer]
643
643
  })).results) == null ? void 0 : a.filter(
644
- (l) => l.type === "graphic"
644
+ (c) => c.type === "graphic"
645
645
  );
646
646
  if (s.length === 0)
647
647
  return;
648
- const t = s[0].graphic, c = t.getAttribute("type"), n = t.getAttribute("id");
649
- if (c === "OpenDriveJunction")
650
- if (t.getAttribute("selected") === !1) {
651
- const l = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, r = await v.get(l, {
648
+ const i = s[0].graphic, l = i.getAttribute("type"), r = i.getAttribute("id");
649
+ if (l === "OpenDriveJunction")
650
+ if (i.getAttribute("selected") === !1) {
651
+ const c = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, n = await w.get(c, {
652
652
  params: {
653
- id: n,
653
+ id: r,
654
654
  projectName: this.projectName
655
655
  }
656
656
  });
657
- r.status === 200 && r.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
657
+ n.status === 200 && n.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
658
658
  type: "OpenDriveJunction",
659
- id: n,
660
- details: r.data.result
661
- }), t.setAttribute("selected", !0), t.symbol = {
659
+ id: r,
660
+ details: n.data.result
661
+ }), i.setAttribute("selected", !0), i.symbol = {
662
662
  type: "picture-marker",
663
663
  url: "/GisViewerAssets/Images/point_red.png",
664
664
  width: "20px",
665
665
  height: "20px"
666
- }, this.increasePictureMarkerSize(t, 50));
666
+ }, this.increasePictureMarkerSize(i, 50));
667
667
  } else
668
668
  this.openDriveClickCallback && this.openDriveClickCallback({
669
669
  type: "OpenDriveJunction",
670
- id: n,
670
+ id: r,
671
671
  details: void 0
672
- }), t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
673
- t.attributes,
672
+ }), i.setAttribute("selected", !1), i.symbol = this.getCrossGraphicSymbol(
673
+ i.attributes,
674
674
  this.view.scale < this.junctionScale ? "picture" : "marker"
675
675
  );
676
676
  else
677
- c === "OpenDriveSection" && (t.layer.id === "OpenDriveHighlight" ? (this.highlightLayer.remove(t), this.sectionLayer.add(t), t.setAttribute("selected", !0), this.selectedSectionIds.push(n), this.splitLaneLayer.graphics.filter(
678
- (r) => r.getAttribute("roadsectBaseIds") === t.getAttribute("roadsectBaseIds")
677
+ l === "OpenDriveSection" && (i.layer.id === "OpenDriveHighlight" ? (this.highlightLayer.removeAll(), this.sectionLayer.removeAll(), this.selectedSectionIds = [], this.sectionLayer.add(i), i.setAttribute("selected", !0), this.selectedSectionIds.push(r), this.splitLaneLayer.graphics.filter(
678
+ (n) => n.getAttribute("roadsectBaseIds") === i.getAttribute("roadsectBaseIds")
679
679
  ).forEach(
680
- (r) => r.symbol = {
680
+ (n) => n.symbol = {
681
681
  type: "simple-fill",
682
682
  color: [255, 69, 0],
683
683
  outline: {
@@ -686,9 +686,9 @@ class O {
686
686
  }
687
687
  }
688
688
  )) : (this.splitLaneLayer.graphics.filter(
689
- (r) => r.getAttribute("roadsectBaseIds") === t.getAttribute("roadsectBaseIds")
689
+ (n) => n.getAttribute("roadsectBaseIds") === i.getAttribute("roadsectBaseIds")
690
690
  ).forEach(
691
- (r) => r.symbol = {
691
+ (n) => n.symbol = {
692
692
  type: "simple-fill",
693
693
  color: [255, 0, 0, 0.8],
694
694
  outline: {
@@ -696,16 +696,14 @@ class O {
696
696
  width: 1
697
697
  }
698
698
  }
699
- ), this.sectionLayer.remove(t), this.selectedSectionIds = this.selectedSectionIds.filter(
700
- (r) => r !== n
701
- ), this.openDriveClickCallback && this.openDriveClickCallback({
699
+ ), this.sectionLayer.remove(i), this.selectedSectionIds = [], this.openDriveClickCallback && this.openDriveClickCallback({
702
700
  type: "OpenDriveSection",
703
- id: t.getAttribute("edgeId"),
701
+ id: i.getAttribute("edgeId"),
704
702
  details: void 0
705
703
  })));
706
704
  });
707
- this.mouseClickHandler = this.view.on("immediate-click", async (i) => {
708
- e(i).catch(() => {
705
+ this.mouseClickHandler = this.view.on("immediate-click", async (t) => {
706
+ e(t).catch(() => {
709
707
  });
710
708
  });
711
709
  }
@@ -714,14 +712,14 @@ class O {
714
712
  * @param graphic
715
713
  * @param targetSize
716
714
  */
717
- increasePictureMarkerSize(e, i) {
715
+ increasePictureMarkerSize(e, t) {
718
716
  const o = setInterval(() => {
719
- const s = e.symbol, t = s.width;
720
- t < i ? e.symbol = {
717
+ const s = e.symbol, i = s.width;
718
+ i < t ? e.symbol = {
721
719
  type: "picture-marker",
722
720
  url: s.url,
723
- width: t + 1,
724
- height: t + 1
721
+ width: i + 1,
722
+ height: i + 1
725
723
  } : clearInterval(o);
726
724
  }, 20);
727
725
  }
@@ -730,21 +728,21 @@ class O {
730
728
  * @param graphic
731
729
  * @param targetSize
732
730
  */
733
- decreasePictureMarkerSize(e, i) {
731
+ decreasePictureMarkerSize(e, t) {
734
732
  const o = setInterval(() => {
735
- const s = e.symbol, t = s.width;
736
- t > i ? e.symbol = {
733
+ const s = e.symbol, i = s.width;
734
+ i > t ? e.symbol = {
737
735
  type: "picture-marker",
738
736
  url: s.url,
739
- width: t - 1,
740
- height: t - 1
737
+ width: i - 1,
738
+ height: i - 1
741
739
  } : clearInterval(o);
742
740
  }, 20);
743
741
  }
744
742
  async getSumoInfo(e) {
745
743
  switch (e.type) {
746
744
  case "junction": {
747
- const i = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, o = await v.get(i, {
745
+ const t = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, o = await w.get(t, {
748
746
  params: {
749
747
  id: e.id,
750
748
  projectName: this.projectName
@@ -753,24 +751,24 @@ class O {
753
751
  return o.status === 200 ? o.data : { status: -1, message: `路口信息查询失败: ${e.id}` };
754
752
  }
755
753
  case "edge": {
756
- const i = e.id.split("#");
757
- let o = i[0];
754
+ const t = e.id.split("#");
755
+ let o = t[0];
758
756
  o.startsWith("-") && (o = o.slice(1));
759
757
  let s = 0;
760
- i.length === 2 && (s = Number(i[1]));
761
- const t = this.allLaneGraphics.find(
762
- (c) => c.getAttribute("roadId") === o && c.getAttribute("sectionIndex") === s
758
+ t.length === 2 && (s = Number(t[1]));
759
+ const i = this.allLaneGraphics.find(
760
+ (l) => l.getAttribute("roadId") === o && l.getAttribute("sectionIndex") === s
763
761
  );
764
- if (t) {
765
- const c = `${o}+${t.getAttribute(
762
+ if (i) {
763
+ const l = `${o}+${i.getAttribute(
766
764
  "sectionId"
767
- )}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await v.get(n, {
765
+ )}`, r = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await w.get(r, {
768
766
  params: {
769
- id: c,
767
+ id: l,
770
768
  projectName: this.projectName
771
769
  }
772
770
  });
773
- return a.status === 200 ? a.data : { status: -1, message: `路段信息查询失败: ${c}` };
771
+ return a.status === 200 ? a.data : { status: -1, message: `路段信息查询失败: ${l}` };
774
772
  } else
775
773
  return { status: -1, message: "未知类型" };
776
774
  }
@@ -785,13 +783,13 @@ class O {
785
783
  * 清除OpenDrive内容
786
784
  */
787
785
  async clearOpenDrive() {
788
- var i, o, s;
786
+ var t, o, s;
789
787
  let e = await this.laneLayer.queryFeatures();
790
788
  e.features.length > 0 && await this.laneLayer.applyEdits({
791
789
  deleteFeatures: e.features
792
790
  }), e = await this.roadNameLayer.queryFeatures(), e.features.length > 0 && await this.roadNameLayer.applyEdits({
793
791
  deleteFeatures: e.features
794
- }), this.highlightLayer.removeAll(), this.junctionLayer.removeAll(), this.sectionLayer.removeAll(), this.flashLayer.removeAll(), this.borderLayer.removeAll(), (i = this.mouseMoveHandler) == null || i.remove(), this.mouseMoveHandler = void 0, (o = this.mouseClickHandler) == null || o.remove(), this.mouseClickHandler = void 0, (s = this.scaleWatch) == null || s.remove(), this.scaleWatch = void 0;
792
+ }), this.highlightLayer.removeAll(), this.junctionLayer.removeAll(), this.sectionLayer.removeAll(), this.flashLayer.removeAll(), this.borderLayer.removeAll(), (t = this.mouseMoveHandler) == null || t.remove(), this.mouseMoveHandler = void 0, (o = this.mouseClickHandler) == null || o.remove(), this.mouseClickHandler = void 0, (s = this.scaleWatch) == null || s.remove(), this.scaleWatch = void 0;
795
793
  }
796
794
  /**
797
795
  * 用sumo的id定位车道、基本段、路段
@@ -799,28 +797,28 @@ class O {
799
797
  * @returns
800
798
  */
801
799
  async findSumo(e) {
802
- const { type: i, id: o } = e, s = e.flash === void 0 ? !0 : e.flash;
803
- if (i === "junction")
800
+ const { type: t, id: o } = e, s = e.flash === void 0 ? !0 : e.flash;
801
+ if (t === "junction")
804
802
  return await this.findJunction(o, s);
805
- if (i === "edge") {
806
- const t = o.split("_");
807
- if (t.length > 2)
803
+ if (t === "edge") {
804
+ const i = o.split("_");
805
+ if (i.length > 2)
808
806
  return { status: -1, message: "id格式错误" };
809
- const c = t.length === 2 ? Number(t[1]) : void 0, n = t[0].split("#");
810
- if (n.length > 2)
807
+ const l = i.length === 2 ? Number(i[1]) : void 0, r = i[0].split("#");
808
+ if (r.length > 2)
811
809
  return { status: -1, message: "id格式错误" };
812
- const a = n[0], l = n.length === 2 ? Number(n[1]) : void 0;
813
- return await this.findLane({ roadsectId: a, segmentId: l, laneId: c, flash: s });
810
+ const a = r[0], c = r.length === 2 ? Number(r[1]) : void 0;
811
+ return await this.findLane({ roadsectId: a, segmentId: c, laneId: l, flash: s });
814
812
  } else
815
813
  return { status: -1, message: "未知类型" };
816
814
  }
817
- async findJunction(e, i) {
815
+ async findJunction(e, t) {
818
816
  const o = this.junctionLayer.graphics.find(
819
817
  (s) => s.attributes.id === e
820
818
  );
821
819
  if (!o)
822
820
  return { status: -1, message: "未找到。请检查路口编号" };
823
- if (i) {
821
+ if (t) {
824
822
  const s = new I({
825
823
  geometry: o.geometry,
826
824
  symbol: {
@@ -844,41 +842,41 @@ class O {
844
842
  * @returns
845
843
  */
846
844
  async findLane(e) {
847
- let { roadsectId: i, segmentId: o, laneId: s } = e;
848
- i.startsWith("-") && (i = i.slice(1));
849
- let t = this.allLaneGraphics.filter(
850
- (a) => a.attributes.roadId === i
845
+ let { roadsectId: t, segmentId: o, laneId: s } = e;
846
+ t.startsWith("-") && (t = t.slice(1));
847
+ let i = this.allLaneGraphics.filter(
848
+ (a) => a.attributes.roadId === t
851
849
  );
852
- if (t.length === 0)
850
+ if (i.length === 0)
853
851
  return { status: -1, message: "未找到。请检查路段编号" };
854
852
  if (o !== void 0) {
855
853
  const a = [];
856
- if (t.forEach((l) => {
857
- const r = Number(l.attributes.sectionId);
858
- a.indexOf(r) === -1 && a.push(r);
859
- }), a.sort((l, r) => l - r), o > a.length - 1)
854
+ if (i.forEach((c) => {
855
+ const n = Number(c.attributes.sectionId);
856
+ a.indexOf(n) === -1 && a.push(n);
857
+ }), a.sort((c, n) => c - n), o > a.length - 1)
860
858
  return { status: -1, message: "未找到。请检查基本段编号" };
861
- o = a[o], t = t.filter(
862
- (l) => Number(l.attributes.sectionId) === o
859
+ o = a[o], i = i.filter(
860
+ (c) => Number(c.attributes.sectionId) === o
863
861
  );
864
862
  }
865
863
  if (s !== void 0) {
866
864
  const a = [];
867
- if (t.forEach((l) => {
868
- const r = Number(l.attributes.laneId);
869
- a.indexOf(r) === -1 && a.push(r);
870
- }), a.sort((l, r) => l - r), s > a.length - 1)
865
+ if (i.forEach((c) => {
866
+ const n = Number(c.attributes.laneId);
867
+ a.indexOf(n) === -1 && a.push(n);
868
+ }), a.sort((c, n) => c - n), s > a.length - 1)
871
869
  return { status: -1, message: "未找到。请检查车道编号" };
872
- s = a[s], t = t.filter(
873
- (l) => Number(l.attributes.laneId) === s
870
+ s = a[s], i = i.filter(
871
+ (c) => Number(c.attributes.laneId) === s
874
872
  );
875
873
  }
876
- const c = t.map(
874
+ const l = i.map(
877
875
  (a) => a.geometry
878
- ), n = L.union(c);
876
+ ), r = L.union(l);
879
877
  if (e.flash) {
880
878
  const a = new I({
881
- geometry: n,
879
+ geometry: r,
882
880
  symbol: {
883
881
  type: "simple-fill",
884
882
  color: [0, 255, 255, 0.6],
@@ -890,7 +888,7 @@ class O {
890
888
  });
891
889
  this.flashGraphic(a);
892
890
  }
893
- return await this.view.goTo(n, { duration: 1e3 }), { status: 0, message: "ok" };
891
+ return await this.view.goTo(r, { duration: 1e3 }), { status: 0, message: "ok" };
894
892
  }
895
893
  /**
896
894
  * graphic渐隐渐显闪烁
@@ -898,9 +896,9 @@ class O {
898
896
  */
899
897
  flashGraphic(e) {
900
898
  this.flashLayer.removeAll(), this.flashLayer.add(e);
901
- let i = 0, o = !0;
899
+ let t = 0, o = !0;
902
900
  const s = setInterval(() => {
903
- o ? (this.flashLayer.opacity -= 0.02, this.flashLayer.opacity <= 0.1 && (o = !1, i++)) : (this.flashLayer.opacity += 0.02, this.flashLayer.opacity >= 1 && (o = !0)), i >= 5 && (this.flashLayer.removeAll(), this.flashLayer.opacity = 1, clearInterval(s));
901
+ o ? (this.flashLayer.opacity -= 0.02, this.flashLayer.opacity <= 0.1 && (o = !1, t++)) : (this.flashLayer.opacity += 0.02, this.flashLayer.opacity >= 1 && (o = !0)), t >= 5 && (this.flashLayer.removeAll(), this.flashLayer.opacity = 1, clearInterval(s));
904
902
  }, 10);
905
903
  }
906
904
  /**
@@ -909,19 +907,19 @@ class O {
909
907
  * @returns
910
908
  */
911
909
  unselectSumo(e) {
912
- if ((!e || e.type === "junction") && this.junctionLayer.graphics.forEach((i) => {
913
- (!e || !e.id || e.id === "" || e.id === i.getAttribute("id")) && i.getAttribute("selected") && (i.setAttribute("selected", !1), i.symbol = this.getCrossGraphicSymbol(
914
- i.attributes,
910
+ if (e ? e.type === "junction" && this.junctionLayer.graphics.forEach((t) => {
911
+ (!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected") && (t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
912
+ t.attributes,
915
913
  this.view.scale < this.junctionScale ? "picture" : "marker"
916
914
  ));
917
- }), !e || e.type === "edge") {
918
- let i;
919
- !e || !e.id || e.id === "" ? i = this.sectionLayer.graphics.toArray() : i = this.sectionLayer.graphics.filter((o) => o.getAttribute("edgeId") === e.id).toArray(), i.length > 0 && (i.forEach((o) => {
915
+ }) : (this.highlightLayer.removeAll(), this.sectionLayer.removeAll(), this.selectedSectionIds = [], this.splitLaneLayer.removeAll()), !e || e.type === "edge") {
916
+ let t;
917
+ !e || !e.id || e.id === "" ? t = this.sectionLayer.graphics.toArray() : t = this.sectionLayer.graphics.filter((o) => o.getAttribute("edgeId") === e.id).toArray(), t.length > 0 && (t.forEach((o) => {
920
918
  const s = o.getAttribute("id");
921
919
  this.selectedSectionIds = this.selectedSectionIds.filter(
922
- (t) => t !== s
920
+ (i) => i !== s
923
921
  );
924
- }), this.sectionLayer.removeMany(i));
922
+ }), this.sectionLayer.removeMany(t));
925
923
  }
926
924
  return { status: 0, message: "ok" };
927
925
  }
@@ -933,31 +931,31 @@ class O {
933
931
  async selectSumo(e) {
934
932
  switch (e.type) {
935
933
  case "junction":
936
- return this.junctionLayer.graphics.forEach((i) => {
937
- if (e.id === i.getAttribute("id"))
938
- return i.setAttribute("selected", !0), i.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(i, 50), { status: 0, message: "ok" };
934
+ return this.junctionLayer.graphics.forEach((t) => {
935
+ if (e.id === t.getAttribute("id"))
936
+ return t.setAttribute("selected", !0), t.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(t, 50), { status: 0, message: "ok" };
939
937
  }), { status: -1, message: "未找到路口" };
940
938
  case "edge": {
941
- const i = e.id.split("#");
942
- let o = String(i[0]);
939
+ const t = e.id.split("#");
940
+ let o = String(t[0]);
943
941
  o.startsWith("-") && (o = o.slice(1));
944
942
  let s = 0;
945
- i.length === 2 && (s = Number(i[1]));
946
- let t = [];
947
- if (i.length === 1 ? t = this.allLaneGraphics.filter(
948
- (c) => c.getAttribute("roadId") === o
949
- ) : i.length === 2 && (t = this.allLaneGraphics.filter(
950
- (c) => c.getAttribute("roadId") === o && c.getAttribute("sectionIndex") === s
951
- )), t.length > 0) {
952
- const c = /* @__PURE__ */ new Map();
953
- return t.forEach((n) => {
954
- const a = n.getAttribute("roadId") + "+" + n.getAttribute("sectionId");
943
+ t.length === 2 && (s = Number(t[1]));
944
+ let i = [];
945
+ if (t.length === 1 ? i = this.allLaneGraphics.filter(
946
+ (l) => l.getAttribute("roadId") === o
947
+ ) : t.length === 2 && (i = this.allLaneGraphics.filter(
948
+ (l) => l.getAttribute("roadId") === o && l.getAttribute("sectionIndex") === s
949
+ )), i.length > 0) {
950
+ const l = /* @__PURE__ */ new Map();
951
+ return i.forEach((r) => {
952
+ const a = r.getAttribute("roadId") + "+" + r.getAttribute("sectionId");
955
953
  this.selectedSectionIds.includes(a) || this.selectedSectionIds.push(a);
956
- let l = c.get(a);
957
- l ? l.push(n.geometry) : (l = [n.geometry], c.set(a, l));
958
- }), c.forEach(async (n, a) => {
959
- const l = L.union(n), r = new I({
960
- geometry: l,
954
+ let c = l.get(a);
955
+ c ? c.push(r.geometry) : (c = [r.geometry], l.set(a, c));
956
+ }), l.forEach(async (r, a) => {
957
+ const c = L.union(r), n = new I({
958
+ geometry: c,
961
959
  symbol: {
962
960
  type: "simple-fill",
963
961
  color: [0, 255, 255, 0.5],
@@ -974,7 +972,7 @@ class O {
974
972
  selected: !0
975
973
  }
976
974
  });
977
- this.sectionLayer.add(r), await this.view.goTo(r);
975
+ this.sectionLayer.add(n), await this.view.goTo(n);
978
976
  }), { status: 0, message: "ok" };
979
977
  } else
980
978
  return { status: -1, message: "未找到路段" };
@@ -984,96 +982,101 @@ class O {
984
982
  }
985
983
  }
986
984
  async geometrySearch(e) {
987
- const i = new S({
985
+ const t = new S({
988
986
  rings: [e]
989
987
  }), o = await this.laneLayer.queryFeatures({
990
- geometry: i,
988
+ geometry: t,
991
989
  outFields: ["*"]
992
- }), s = [], t = [];
990
+ }), s = [], i = [];
993
991
  for (const a of o.features) {
994
- const l = a.getAttribute("roadId"), r = a.getAttribute("sectionIndex"), d = `${l}#${r}`;
992
+ const c = a.getAttribute("roadId"), n = a.getAttribute("sectionIndex"), d = `${c}#${n}`;
995
993
  if (s.indexOf(d) === -1) {
996
994
  s.push(d), this.selectSumo({
997
995
  type: "edge",
998
996
  id: d
999
997
  });
1000
- const y = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, h = await v.get(y, {
998
+ const y = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, h = await w.get(y, {
1001
999
  params: {
1002
- id: `${l}+${a.getAttribute("sectionId")}`,
1000
+ id: `${c}+${a.getAttribute("sectionId")}`,
1003
1001
  projectName: this.projectName
1004
1002
  }
1005
1003
  });
1006
- h.status === 200 && h.data.status === 0 && t.push(h.data.result);
1004
+ h.status === 200 && h.data.status === 0 && i.push(h.data.result);
1007
1005
  }
1008
1006
  }
1009
- const c = this.junctionLayer.graphics.filter((a) => {
1010
- const l = a.geometry;
1011
- return L.contains(i, l);
1012
- }), n = [];
1013
- for (const a of c) {
1014
- const l = a.getAttribute("id");
1007
+ const l = this.junctionLayer.graphics.filter((a) => {
1008
+ const c = a.geometry;
1009
+ return L.contains(t, c);
1010
+ }), r = [];
1011
+ for (const a of l) {
1012
+ const c = a.getAttribute("id");
1015
1013
  this.selectSumo({
1016
1014
  type: "junction",
1017
- id: l
1015
+ id: c
1018
1016
  });
1019
- const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, d = await v.get(r, {
1017
+ const n = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, d = await w.get(n, {
1020
1018
  params: {
1021
- id: l,
1019
+ id: c,
1022
1020
  projectName: this.projectName
1023
1021
  }
1024
1022
  });
1025
- d.status === 200 && d.data.status === 0 && n.push(d.data.result);
1023
+ d.status === 200 && d.data.status === 0 && r.push(d.data.result);
1026
1024
  }
1027
1025
  return {
1028
1026
  status: 0,
1029
1027
  message: "ok",
1030
1028
  result: {
1031
- junctions: n,
1032
- edges: t
1029
+ junctions: r,
1030
+ edges: i
1033
1031
  }
1034
1032
  };
1035
1033
  }
1034
+ /**
1035
+ * 封闭车道,使用sumo的id
1036
+ * @param params
1037
+ * @returns
1038
+ */
1036
1039
  async splitLane(e) {
1037
1040
  const o = e.id.split("_");
1038
1041
  if (o.length !== 2)
1039
1042
  return { status: -1, message: "车道编号格式错误" };
1040
- const s = Number(o[1]), t = o[0].split("#"), c = t.length === 2 ? Number(t[1]) : 0;
1041
- let n = t[0];
1042
- n.startsWith("-") && (n = n.slice(1));
1043
- const a = this.allLaneGraphics.filter((g) => g.getAttribute("roadId") === n && g.getAttribute("sectionIndex") === c);
1043
+ const s = Number(o[1]), i = o[0].split("#"), l = i.length === 2 ? Number(i[1]) : 0;
1044
+ let r = i[0];
1045
+ r.startsWith("-") && (r = r.slice(1));
1046
+ const a = this.allLaneGraphics.filter((b) => b.getAttribute("roadId") === r && b.getAttribute("sectionIndex") === l);
1044
1047
  if (a.length === 0)
1045
1048
  return { status: -1, message: "未找到路段" };
1046
- const l = a.length - s, r = a.find(
1047
- (g) => Math.abs(g.getAttribute("laneId")) === l
1049
+ const c = a.length - s, n = a.find(
1050
+ (b) => Math.abs(b.getAttribute("laneId")) === c
1048
1051
  );
1049
- if (!r)
1052
+ if (!n)
1050
1053
  return { status: -1, message: "未找到车道" };
1051
- const d = e.start || 0, y = e.end || 100, h = G.lineString(r.getAttribute("leftLine")), u = x(h, d, y, {
1054
+ const d = e.start || 0, y = e.end || 100, h = G.lineString(n.getAttribute("leftLine")), u = x(h, d, y, {
1052
1055
  units: "meters"
1053
- }), p = G.lineString(r.getAttribute("rightLine")), m = x(p, d, y, {
1056
+ }), p = G.lineString(n.getAttribute("rightLine")), g = x(p, d, y, {
1054
1057
  units: "meters"
1055
- }), b = u.geometry.coordinates.concat(
1056
- m.geometry.coordinates.reverse()
1058
+ }), m = u.geometry.coordinates.concat(
1059
+ g.geometry.coordinates.reverse()
1057
1060
  );
1058
- b.push(b[b.length - 1]);
1061
+ m.push(m[m.length - 1]);
1059
1062
  const f = new I({
1060
1063
  geometry: new S({
1061
- rings: [b]
1064
+ rings: [m]
1062
1065
  }),
1063
1066
  attributes: {
1064
- ObjectID: r.getAttribute("ObjectID"),
1065
- id: r.getAttribute("id"),
1066
- fromNode: r.getAttribute("fromNode"),
1067
- toNode: r.getAttribute("toNode"),
1068
- roadId: r.getAttribute("roadId"),
1069
- roadName: r.getAttribute("roadName"),
1070
- sectionId: r.getAttribute("sectionId"),
1071
- sectionIndex: r.getAttribute("sectionIndex"),
1072
- laneId: r.getAttribute("laneId"),
1073
- type: r.getAttribute("type"),
1074
- sumoId: r.getAttribute("sumoId"),
1067
+ ObjectID: n.getAttribute("ObjectID"),
1068
+ id: n.getAttribute("id"),
1069
+ fromNode: n.getAttribute("fromNode"),
1070
+ toNode: n.getAttribute("toNode"),
1071
+ roadId: n.getAttribute("roadId"),
1072
+ roadName: n.getAttribute("roadName"),
1073
+ sectionId: n.getAttribute("sectionId"),
1074
+ sectionIndex: n.getAttribute("sectionIndex"),
1075
+ laneId: n.getAttribute("laneId"),
1076
+ type: n.getAttribute("type"),
1077
+ sumoId: n.getAttribute("sumoId"),
1075
1078
  leftLine: u.geometry.coordinates,
1076
- rightLine: m.geometry.coordinates
1079
+ rightLine: g.geometry.coordinates
1077
1080
  },
1078
1081
  symbol: {
1079
1082
  type: "simple-fill",
@@ -1083,39 +1086,100 @@ class O {
1083
1086
  }
1084
1087
  }
1085
1088
  });
1086
- return this.splitLaneLayer.add(f), N.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: b } };
1089
+ return this.splitLaneLayer.add(f), A.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: m } };
1087
1090
  }
1088
- blockOpenDriveLane(e) {
1089
- const o = this.allLaneGraphics.filter((s) => {
1090
- let t = String(s.getAttribute("laneId"));
1091
- return t.startsWith("-") && (t = t.slice(1)), s.getAttribute("roadId") === e.roadsectId && s.getAttribute("roadsectBaseIds").includes(e.roadsectBaseId) && t === String(e.laneId);
1092
- }).map((s) => {
1093
- const t = s.clone();
1094
- return t.symbol = {
1091
+ /**
1092
+ * 封闭车道,使用可计算路网的id
1093
+ * @param params
1094
+ */
1095
+ blockLane(e) {
1096
+ const t = this.allLaneGraphics.filter((s) => {
1097
+ var l;
1098
+ let i = String(s.getAttribute("laneId"));
1099
+ return i.startsWith("-") && (i = i.slice(1)), s.getAttribute("roadId") === e.roadsectId && ((l = s.getAttribute("roadsectBaseIds")) == null ? void 0 : l.includes(e.roadsectBaseId)) && i === String(e.laneId);
1100
+ }), o = t.map((s) => {
1101
+ const i = s.clone();
1102
+ return console.log(
1103
+ t[0].getAttribute("roadsectBaseIds"),
1104
+ this.selectedSectionIds,
1105
+ this.selectedSectionIds.includes(
1106
+ t[0].getAttribute("roadsectBaseIds")
1107
+ )
1108
+ ), i.symbol = {
1095
1109
  type: "simple-fill",
1096
- color: [255, 0, 0, 0.8],
1110
+ color: this.selectedSectionIds.includes(
1111
+ t[0].getAttribute("roadsectBaseIds")
1112
+ ) ? [255, 69, 0, 0.8] : [255, 0, 0, 0.8],
1097
1113
  outline: {
1098
1114
  color: "red"
1099
1115
  }
1100
- }, t;
1116
+ }, i;
1101
1117
  });
1102
- this.splitLaneLayer.addMany(o), N.viewGoto(this.view, o);
1118
+ this.splitLaneLayer.addMany(o), A.viewGoto(this.view, o);
1103
1119
  }
1104
1120
  clearSplitLane() {
1105
1121
  this.splitLaneLayer.removeAll();
1106
1122
  }
1123
+ selectComputable(e) {
1124
+ if (e.type === "roadsectBase") {
1125
+ this.allLaneGraphics.forEach((o) => {
1126
+ o.getAttribute("roadsectBaseIds") || console.log(o.attributes);
1127
+ });
1128
+ const t = this.allLaneGraphics.filter((o) => {
1129
+ var s;
1130
+ return (s = o.getAttribute("roadsectBaseIds")) == null ? void 0 : s.includes(e.id);
1131
+ });
1132
+ if (t.length > 0) {
1133
+ const o = L.union(
1134
+ t.map((r) => r.geometry)
1135
+ ), s = t[0].getAttribute("roadsectBaseIds"), i = new I({
1136
+ geometry: o,
1137
+ symbol: {
1138
+ type: "simple-fill",
1139
+ color: [0, 255, 255, 0.5],
1140
+ style: "solid",
1141
+ outline: {
1142
+ color: [0, 255, 255],
1143
+ width: 1
1144
+ }
1145
+ },
1146
+ attributes: {
1147
+ type: "OpenDriveSection",
1148
+ roadsectBaseIds: s
1149
+ }
1150
+ });
1151
+ this.sectionLayer.removeAll(), this.sectionLayer.add(i), A.viewGoto(this.view, [i]), this.selectedSectionIds = [s];
1152
+ const l = this.splitLaneLayer.graphics.filter(
1153
+ (r) => {
1154
+ var a;
1155
+ return (a = r.getAttribute("roadsectBaseIds")) == null ? void 0 : a.includes(e.id);
1156
+ }
1157
+ );
1158
+ l.length > 0 && l.forEach(
1159
+ (r) => r.symbol = {
1160
+ type: "simple-fill",
1161
+ color: [255, 69, 0],
1162
+ outline: {
1163
+ color: "red",
1164
+ width: 2
1165
+ }
1166
+ }
1167
+ );
1168
+ }
1169
+ }
1170
+ }
1107
1171
  /**
1108
1172
  * 更新所有路口的symbol
1109
1173
  * @param symbolStyle
1110
1174
  */
1111
1175
  updateAllJunctionSymbol(e) {
1112
- const i = this.junctionLayer.graphics.clone();
1113
- this.junctionLayer.removeAll(), i.forEach((o) => {
1176
+ const t = this.junctionLayer.graphics.clone();
1177
+ this.junctionLayer.removeAll(), t.forEach((o) => {
1114
1178
  o.getAttribute("selected") || (o.symbol = this.getCrossGraphicSymbol(
1115
1179
  o.attributes,
1116
1180
  e
1117
1181
  ));
1118
- }), this.junctionLayer.addMany(i.toArray());
1182
+ }), this.junctionLayer.addMany(t.toArray());
1119
1183
  }
1120
1184
  /**
1121
1185
  * 生成路口点符号。在不同比例尺下,使用不同的符号
@@ -1123,16 +1187,16 @@ class O {
1123
1187
  * @param symbolType
1124
1188
  * @returns
1125
1189
  */
1126
- getCrossGraphicSymbol(e, i) {
1190
+ getCrossGraphicSymbol(e, t) {
1127
1191
  const o = e.crossId !== "" && e.crossId !== void 0 && e.crossId !== null;
1128
- if (i === "marker")
1192
+ if (t === "marker")
1129
1193
  return {
1130
1194
  type: "picture-marker",
1131
1195
  url: `/GisViewerAssets/Images/cross/${o ? "gis_xhj_blue" : "gis_lkcz_xz"}.png`,
1132
1196
  width: "32px",
1133
1197
  height: "32px"
1134
1198
  };
1135
- if (i === "picture")
1199
+ if (t === "picture")
1136
1200
  return o ? {
1137
1201
  type: "cim",
1138
1202
  data: {