gisviewer-vue3-arcgis 1.0.262 → 1.0.264

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
- 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";
2
+ import * as j from "@arcgis/core/core/promiseUtils";
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], k = 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 (k.length <= 3) {
464
+ console.warn(`lane ${b} has less than 3 points`);
465
465
  continue;
466
466
  }
467
- A.push(f.innerPath[0]);
468
- const k = new S({
469
- rings: [A]
467
+ k.push(f.innerPath[0]);
468
+ const N = new S({
469
+ rings: [k]
470
470
  });
471
- if (k) {
472
- const j = new I({
473
- geometry: k,
471
+ if (N) {
472
+ const C = new I({
473
+ geometry: N,
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(C), r.push(C);
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 = j.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,50 @@ class O {
636
636
  * 监听鼠标点击事件,获取高亮要素的拓扑信息
637
637
  */
638
638
  monitorMouseClick() {
639
- const e = C.debounce(async (i) => {
639
+ const e = j.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;
649
+ console.log(i.attributes);
650
+ const l = i.getAttribute("type"), r = i.getAttribute("id");
651
+ if (l === "OpenDriveJunction")
652
+ if (i.getAttribute("selected") === !1) {
653
+ const c = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, n = await w.get(c, {
652
654
  params: {
653
- id: n,
655
+ id: r,
654
656
  projectName: this.projectName
655
657
  }
656
658
  });
657
- r.status === 200 && r.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
659
+ n.status === 200 && n.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
658
660
  type: "OpenDriveJunction",
659
- id: n,
660
- details: r.data.result
661
- }), t.setAttribute("selected", !0), t.symbol = {
661
+ id: r,
662
+ details: n.data.result
663
+ }), i.setAttribute("selected", !0), i.symbol = {
662
664
  type: "picture-marker",
663
665
  url: "/GisViewerAssets/Images/point_red.png",
664
666
  width: "20px",
665
667
  height: "20px"
666
- }, this.increasePictureMarkerSize(t, 50));
668
+ }, this.increasePictureMarkerSize(i, 50));
667
669
  } else
668
670
  this.openDriveClickCallback && this.openDriveClickCallback({
669
671
  type: "OpenDriveJunction",
670
- id: n,
672
+ id: r,
671
673
  details: void 0
672
- }), t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
673
- t.attributes,
674
+ }), i.setAttribute("selected", !1), i.symbol = this.getCrossGraphicSymbol(
675
+ i.attributes,
674
676
  this.view.scale < this.junctionScale ? "picture" : "marker"
675
677
  );
676
678
  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")
679
+ 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(
680
+ (n) => n.getAttribute("roadsectBaseIds") === i.getAttribute("roadsectBaseIds")
679
681
  ).forEach(
680
- (r) => r.symbol = {
682
+ (n) => n.symbol = {
681
683
  type: "simple-fill",
682
684
  color: [255, 69, 0],
683
685
  outline: {
@@ -685,10 +687,14 @@ class O {
685
687
  width: 2
686
688
  }
687
689
  }
688
- )) : (this.splitLaneLayer.graphics.filter(
689
- (r) => r.getAttribute("roadsectBaseIds") === t.getAttribute("roadsectBaseIds")
690
+ ), this.openDriveClickCallback && this.openDriveClickCallback({
691
+ type: "OpenDriveSection",
692
+ id: i.getAttribute("roadsectBaseIds"),
693
+ details: void 0
694
+ })) : (this.splitLaneLayer.graphics.filter(
695
+ (n) => n.getAttribute("roadsectBaseIds") === i.getAttribute("roadsectBaseIds")
690
696
  ).forEach(
691
- (r) => r.symbol = {
697
+ (n) => n.symbol = {
692
698
  type: "simple-fill",
693
699
  color: [255, 0, 0, 0.8],
694
700
  outline: {
@@ -696,16 +702,14 @@ class O {
696
702
  width: 1
697
703
  }
698
704
  }
699
- ), this.sectionLayer.remove(t), this.selectedSectionIds = this.selectedSectionIds.filter(
700
- (r) => r !== n
701
- ), this.openDriveClickCallback && this.openDriveClickCallback({
702
- type: "OpenDriveSection",
703
- id: t.getAttribute("edgeId"),
705
+ ), this.sectionLayer.remove(i), this.selectedSectionIds = [], this.openDriveClickCallback && this.openDriveClickCallback({
706
+ type: "CloseOpenDriveSection",
707
+ id: i.getAttribute("roadsectBaseIds"),
704
708
  details: void 0
705
709
  })));
706
710
  });
707
- this.mouseClickHandler = this.view.on("immediate-click", async (i) => {
708
- e(i).catch(() => {
711
+ this.mouseClickHandler = this.view.on("immediate-click", async (t) => {
712
+ e(t).catch(() => {
709
713
  });
710
714
  });
711
715
  }
@@ -714,14 +718,14 @@ class O {
714
718
  * @param graphic
715
719
  * @param targetSize
716
720
  */
717
- increasePictureMarkerSize(e, i) {
721
+ increasePictureMarkerSize(e, t) {
718
722
  const o = setInterval(() => {
719
- const s = e.symbol, t = s.width;
720
- t < i ? e.symbol = {
723
+ const s = e.symbol, i = s.width;
724
+ i < t ? e.symbol = {
721
725
  type: "picture-marker",
722
726
  url: s.url,
723
- width: t + 1,
724
- height: t + 1
727
+ width: i + 1,
728
+ height: i + 1
725
729
  } : clearInterval(o);
726
730
  }, 20);
727
731
  }
@@ -730,21 +734,21 @@ class O {
730
734
  * @param graphic
731
735
  * @param targetSize
732
736
  */
733
- decreasePictureMarkerSize(e, i) {
737
+ decreasePictureMarkerSize(e, t) {
734
738
  const o = setInterval(() => {
735
- const s = e.symbol, t = s.width;
736
- t > i ? e.symbol = {
739
+ const s = e.symbol, i = s.width;
740
+ i > t ? e.symbol = {
737
741
  type: "picture-marker",
738
742
  url: s.url,
739
- width: t - 1,
740
- height: t - 1
743
+ width: i - 1,
744
+ height: i - 1
741
745
  } : clearInterval(o);
742
746
  }, 20);
743
747
  }
744
748
  async getSumoInfo(e) {
745
749
  switch (e.type) {
746
750
  case "junction": {
747
- const i = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, o = await v.get(i, {
751
+ const t = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, o = await w.get(t, {
748
752
  params: {
749
753
  id: e.id,
750
754
  projectName: this.projectName
@@ -753,24 +757,24 @@ class O {
753
757
  return o.status === 200 ? o.data : { status: -1, message: `路口信息查询失败: ${e.id}` };
754
758
  }
755
759
  case "edge": {
756
- const i = e.id.split("#");
757
- let o = i[0];
760
+ const t = e.id.split("#");
761
+ let o = t[0];
758
762
  o.startsWith("-") && (o = o.slice(1));
759
763
  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
764
+ t.length === 2 && (s = Number(t[1]));
765
+ const i = this.allLaneGraphics.find(
766
+ (l) => l.getAttribute("roadId") === o && l.getAttribute("sectionIndex") === s
763
767
  );
764
- if (t) {
765
- const c = `${o}+${t.getAttribute(
768
+ if (i) {
769
+ const l = `${o}+${i.getAttribute(
766
770
  "sectionId"
767
- )}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await v.get(n, {
771
+ )}`, r = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await w.get(r, {
768
772
  params: {
769
- id: c,
773
+ id: l,
770
774
  projectName: this.projectName
771
775
  }
772
776
  });
773
- return a.status === 200 ? a.data : { status: -1, message: `路段信息查询失败: ${c}` };
777
+ return a.status === 200 ? a.data : { status: -1, message: `路段信息查询失败: ${l}` };
774
778
  } else
775
779
  return { status: -1, message: "未知类型" };
776
780
  }
@@ -785,13 +789,13 @@ class O {
785
789
  * 清除OpenDrive内容
786
790
  */
787
791
  async clearOpenDrive() {
788
- var i, o, s;
792
+ var t, o, s;
789
793
  let e = await this.laneLayer.queryFeatures();
790
794
  e.features.length > 0 && await this.laneLayer.applyEdits({
791
795
  deleteFeatures: e.features
792
796
  }), e = await this.roadNameLayer.queryFeatures(), e.features.length > 0 && await this.roadNameLayer.applyEdits({
793
797
  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;
798
+ }), 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
799
  }
796
800
  /**
797
801
  * 用sumo的id定位车道、基本段、路段
@@ -799,28 +803,28 @@ class O {
799
803
  * @returns
800
804
  */
801
805
  async findSumo(e) {
802
- const { type: i, id: o } = e, s = e.flash === void 0 ? !0 : e.flash;
803
- if (i === "junction")
806
+ const { type: t, id: o } = e, s = e.flash === void 0 ? !0 : e.flash;
807
+ if (t === "junction")
804
808
  return await this.findJunction(o, s);
805
- if (i === "edge") {
806
- const t = o.split("_");
807
- if (t.length > 2)
809
+ if (t === "edge") {
810
+ const i = o.split("_");
811
+ if (i.length > 2)
808
812
  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)
813
+ const l = i.length === 2 ? Number(i[1]) : void 0, r = i[0].split("#");
814
+ if (r.length > 2)
811
815
  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 });
816
+ const a = r[0], c = r.length === 2 ? Number(r[1]) : void 0;
817
+ return await this.findLane({ roadsectId: a, segmentId: c, laneId: l, flash: s });
814
818
  } else
815
819
  return { status: -1, message: "未知类型" };
816
820
  }
817
- async findJunction(e, i) {
821
+ async findJunction(e, t) {
818
822
  const o = this.junctionLayer.graphics.find(
819
823
  (s) => s.attributes.id === e
820
824
  );
821
825
  if (!o)
822
826
  return { status: -1, message: "未找到。请检查路口编号" };
823
- if (i) {
827
+ if (t) {
824
828
  const s = new I({
825
829
  geometry: o.geometry,
826
830
  symbol: {
@@ -844,41 +848,41 @@ class O {
844
848
  * @returns
845
849
  */
846
850
  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
851
+ let { roadsectId: t, segmentId: o, laneId: s } = e;
852
+ t.startsWith("-") && (t = t.slice(1));
853
+ let i = this.allLaneGraphics.filter(
854
+ (a) => a.attributes.roadId === t
851
855
  );
852
- if (t.length === 0)
856
+ if (i.length === 0)
853
857
  return { status: -1, message: "未找到。请检查路段编号" };
854
858
  if (o !== void 0) {
855
859
  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)
860
+ if (i.forEach((c) => {
861
+ const n = Number(c.attributes.sectionId);
862
+ a.indexOf(n) === -1 && a.push(n);
863
+ }), a.sort((c, n) => c - n), o > a.length - 1)
860
864
  return { status: -1, message: "未找到。请检查基本段编号" };
861
- o = a[o], t = t.filter(
862
- (l) => Number(l.attributes.sectionId) === o
865
+ o = a[o], i = i.filter(
866
+ (c) => Number(c.attributes.sectionId) === o
863
867
  );
864
868
  }
865
869
  if (s !== void 0) {
866
870
  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)
871
+ if (i.forEach((c) => {
872
+ const n = Number(c.attributes.laneId);
873
+ a.indexOf(n) === -1 && a.push(n);
874
+ }), a.sort((c, n) => c - n), s > a.length - 1)
871
875
  return { status: -1, message: "未找到。请检查车道编号" };
872
- s = a[s], t = t.filter(
873
- (l) => Number(l.attributes.laneId) === s
876
+ s = a[s], i = i.filter(
877
+ (c) => Number(c.attributes.laneId) === s
874
878
  );
875
879
  }
876
- const c = t.map(
880
+ const l = i.map(
877
881
  (a) => a.geometry
878
- ), n = L.union(c);
882
+ ), r = L.union(l);
879
883
  if (e.flash) {
880
884
  const a = new I({
881
- geometry: n,
885
+ geometry: r,
882
886
  symbol: {
883
887
  type: "simple-fill",
884
888
  color: [0, 255, 255, 0.6],
@@ -890,7 +894,7 @@ class O {
890
894
  });
891
895
  this.flashGraphic(a);
892
896
  }
893
- return await this.view.goTo(n, { duration: 1e3 }), { status: 0, message: "ok" };
897
+ return await this.view.goTo(r, { duration: 1e3 }), { status: 0, message: "ok" };
894
898
  }
895
899
  /**
896
900
  * graphic渐隐渐显闪烁
@@ -898,9 +902,9 @@ class O {
898
902
  */
899
903
  flashGraphic(e) {
900
904
  this.flashLayer.removeAll(), this.flashLayer.add(e);
901
- let i = 0, o = !0;
905
+ let t = 0, o = !0;
902
906
  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));
907
+ 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
908
  }, 10);
905
909
  }
906
910
  /**
@@ -909,19 +913,19 @@ class O {
909
913
  * @returns
910
914
  */
911
915
  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,
916
+ if (e ? e.type === "junction" && this.junctionLayer.graphics.forEach((t) => {
917
+ (!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected") && (t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
918
+ t.attributes,
915
919
  this.view.scale < this.junctionScale ? "picture" : "marker"
916
920
  ));
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) => {
921
+ }) : (this.highlightLayer.removeAll(), this.sectionLayer.removeAll(), this.selectedSectionIds = [], this.splitLaneLayer.removeAll()), !e || e.type === "edge") {
922
+ let t;
923
+ !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
924
  const s = o.getAttribute("id");
921
925
  this.selectedSectionIds = this.selectedSectionIds.filter(
922
- (t) => t !== s
926
+ (i) => i !== s
923
927
  );
924
- }), this.sectionLayer.removeMany(i));
928
+ }), this.sectionLayer.removeMany(t));
925
929
  }
926
930
  return { status: 0, message: "ok" };
927
931
  }
@@ -933,31 +937,31 @@ class O {
933
937
  async selectSumo(e) {
934
938
  switch (e.type) {
935
939
  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" };
940
+ return this.junctionLayer.graphics.forEach((t) => {
941
+ if (e.id === t.getAttribute("id"))
942
+ return t.setAttribute("selected", !0), t.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(t, 50), { status: 0, message: "ok" };
939
943
  }), { status: -1, message: "未找到路口" };
940
944
  case "edge": {
941
- const i = e.id.split("#");
942
- let o = String(i[0]);
945
+ const t = e.id.split("#");
946
+ let o = String(t[0]);
943
947
  o.startsWith("-") && (o = o.slice(1));
944
948
  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");
949
+ t.length === 2 && (s = Number(t[1]));
950
+ let i = [];
951
+ if (t.length === 1 ? i = this.allLaneGraphics.filter(
952
+ (l) => l.getAttribute("roadId") === o
953
+ ) : t.length === 2 && (i = this.allLaneGraphics.filter(
954
+ (l) => l.getAttribute("roadId") === o && l.getAttribute("sectionIndex") === s
955
+ )), i.length > 0) {
956
+ const l = /* @__PURE__ */ new Map();
957
+ return i.forEach((r) => {
958
+ const a = r.getAttribute("roadId") + "+" + r.getAttribute("sectionId");
955
959
  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,
960
+ let c = l.get(a);
961
+ c ? c.push(r.geometry) : (c = [r.geometry], l.set(a, c));
962
+ }), l.forEach(async (r, a) => {
963
+ const c = L.union(r), n = new I({
964
+ geometry: c,
961
965
  symbol: {
962
966
  type: "simple-fill",
963
967
  color: [0, 255, 255, 0.5],
@@ -974,7 +978,7 @@ class O {
974
978
  selected: !0
975
979
  }
976
980
  });
977
- this.sectionLayer.add(r), await this.view.goTo(r);
981
+ this.sectionLayer.add(n), await this.view.goTo(n);
978
982
  }), { status: 0, message: "ok" };
979
983
  } else
980
984
  return { status: -1, message: "未找到路段" };
@@ -984,96 +988,101 @@ class O {
984
988
  }
985
989
  }
986
990
  async geometrySearch(e) {
987
- const i = new S({
991
+ const t = new S({
988
992
  rings: [e]
989
993
  }), o = await this.laneLayer.queryFeatures({
990
- geometry: i,
994
+ geometry: t,
991
995
  outFields: ["*"]
992
- }), s = [], t = [];
996
+ }), s = [], i = [];
993
997
  for (const a of o.features) {
994
- const l = a.getAttribute("roadId"), r = a.getAttribute("sectionIndex"), d = `${l}#${r}`;
998
+ const c = a.getAttribute("roadId"), n = a.getAttribute("sectionIndex"), d = `${c}#${n}`;
995
999
  if (s.indexOf(d) === -1) {
996
1000
  s.push(d), this.selectSumo({
997
1001
  type: "edge",
998
1002
  id: d
999
1003
  });
1000
- const y = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, h = await v.get(y, {
1004
+ const y = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, h = await w.get(y, {
1001
1005
  params: {
1002
- id: `${l}+${a.getAttribute("sectionId")}`,
1006
+ id: `${c}+${a.getAttribute("sectionId")}`,
1003
1007
  projectName: this.projectName
1004
1008
  }
1005
1009
  });
1006
- h.status === 200 && h.data.status === 0 && t.push(h.data.result);
1010
+ h.status === 200 && h.data.status === 0 && i.push(h.data.result);
1007
1011
  }
1008
1012
  }
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");
1013
+ const l = this.junctionLayer.graphics.filter((a) => {
1014
+ const c = a.geometry;
1015
+ return L.contains(t, c);
1016
+ }), r = [];
1017
+ for (const a of l) {
1018
+ const c = a.getAttribute("id");
1015
1019
  this.selectSumo({
1016
1020
  type: "junction",
1017
- id: l
1021
+ id: c
1018
1022
  });
1019
- const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, d = await v.get(r, {
1023
+ const n = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, d = await w.get(n, {
1020
1024
  params: {
1021
- id: l,
1025
+ id: c,
1022
1026
  projectName: this.projectName
1023
1027
  }
1024
1028
  });
1025
- d.status === 200 && d.data.status === 0 && n.push(d.data.result);
1029
+ d.status === 200 && d.data.status === 0 && r.push(d.data.result);
1026
1030
  }
1027
1031
  return {
1028
1032
  status: 0,
1029
1033
  message: "ok",
1030
1034
  result: {
1031
- junctions: n,
1032
- edges: t
1035
+ junctions: r,
1036
+ edges: i
1033
1037
  }
1034
1038
  };
1035
1039
  }
1040
+ /**
1041
+ * 封闭车道,使用sumo的id
1042
+ * @param params
1043
+ * @returns
1044
+ */
1036
1045
  async splitLane(e) {
1037
1046
  const o = e.id.split("_");
1038
1047
  if (o.length !== 2)
1039
1048
  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);
1049
+ const s = Number(o[1]), i = o[0].split("#"), l = i.length === 2 ? Number(i[1]) : 0;
1050
+ let r = i[0];
1051
+ r.startsWith("-") && (r = r.slice(1));
1052
+ const a = this.allLaneGraphics.filter((b) => b.getAttribute("roadId") === r && b.getAttribute("sectionIndex") === l);
1044
1053
  if (a.length === 0)
1045
1054
  return { status: -1, message: "未找到路段" };
1046
- const l = a.length - s, r = a.find(
1047
- (g) => Math.abs(g.getAttribute("laneId")) === l
1055
+ const c = a.length - s, n = a.find(
1056
+ (b) => Math.abs(b.getAttribute("laneId")) === c
1048
1057
  );
1049
- if (!r)
1058
+ if (!n)
1050
1059
  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, {
1060
+ const d = e.start || 0, y = e.end || 100, h = G.lineString(n.getAttribute("leftLine")), u = x(h, d, y, {
1052
1061
  units: "meters"
1053
- }), p = G.lineString(r.getAttribute("rightLine")), m = x(p, d, y, {
1062
+ }), p = G.lineString(n.getAttribute("rightLine")), g = x(p, d, y, {
1054
1063
  units: "meters"
1055
- }), b = u.geometry.coordinates.concat(
1056
- m.geometry.coordinates.reverse()
1064
+ }), m = u.geometry.coordinates.concat(
1065
+ g.geometry.coordinates.reverse()
1057
1066
  );
1058
- b.push(b[b.length - 1]);
1067
+ m.push(m[m.length - 1]);
1059
1068
  const f = new I({
1060
1069
  geometry: new S({
1061
- rings: [b]
1070
+ rings: [m]
1062
1071
  }),
1063
1072
  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"),
1073
+ ObjectID: n.getAttribute("ObjectID"),
1074
+ id: n.getAttribute("id"),
1075
+ fromNode: n.getAttribute("fromNode"),
1076
+ toNode: n.getAttribute("toNode"),
1077
+ roadId: n.getAttribute("roadId"),
1078
+ roadName: n.getAttribute("roadName"),
1079
+ sectionId: n.getAttribute("sectionId"),
1080
+ sectionIndex: n.getAttribute("sectionIndex"),
1081
+ laneId: n.getAttribute("laneId"),
1082
+ type: n.getAttribute("type"),
1083
+ sumoId: n.getAttribute("sumoId"),
1075
1084
  leftLine: u.geometry.coordinates,
1076
- rightLine: m.geometry.coordinates
1085
+ rightLine: g.geometry.coordinates
1077
1086
  },
1078
1087
  symbol: {
1079
1088
  type: "simple-fill",
@@ -1083,39 +1092,100 @@ class O {
1083
1092
  }
1084
1093
  }
1085
1094
  });
1086
- return this.splitLaneLayer.add(f), N.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: b } };
1095
+ return this.splitLaneLayer.add(f), A.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: m } };
1087
1096
  }
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 = {
1097
+ /**
1098
+ * 封闭车道,使用可计算路网的id
1099
+ * @param params
1100
+ */
1101
+ blockLane(e) {
1102
+ const t = this.allLaneGraphics.filter((s) => {
1103
+ var l;
1104
+ let i = String(s.getAttribute("laneId"));
1105
+ 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);
1106
+ }), o = t.map((s) => {
1107
+ const i = s.clone();
1108
+ return console.log(
1109
+ t[0].getAttribute("roadsectBaseIds"),
1110
+ this.selectedSectionIds,
1111
+ this.selectedSectionIds.includes(
1112
+ t[0].getAttribute("roadsectBaseIds")
1113
+ )
1114
+ ), i.symbol = {
1095
1115
  type: "simple-fill",
1096
- color: [255, 0, 0, 0.8],
1116
+ color: this.selectedSectionIds.includes(
1117
+ t[0].getAttribute("roadsectBaseIds")
1118
+ ) ? [255, 69, 0, 0.8] : [255, 0, 0, 0.8],
1097
1119
  outline: {
1098
1120
  color: "red"
1099
1121
  }
1100
- }, t;
1122
+ }, i;
1101
1123
  });
1102
- this.splitLaneLayer.addMany(o), N.viewGoto(this.view, o);
1124
+ this.splitLaneLayer.addMany(o), A.viewGoto(this.view, o);
1103
1125
  }
1104
1126
  clearSplitLane() {
1105
1127
  this.splitLaneLayer.removeAll();
1106
1128
  }
1129
+ selectComputable(e) {
1130
+ if (e.type === "roadsectBase") {
1131
+ this.allLaneGraphics.forEach((o) => {
1132
+ o.getAttribute("roadsectBaseIds") || console.log(o.attributes);
1133
+ });
1134
+ const t = this.allLaneGraphics.filter((o) => {
1135
+ var s;
1136
+ return (s = o.getAttribute("roadsectBaseIds")) == null ? void 0 : s.includes(e.id);
1137
+ });
1138
+ if (t.length > 0) {
1139
+ const o = L.union(
1140
+ t.map((r) => r.geometry)
1141
+ ), s = t[0].getAttribute("roadsectBaseIds"), i = new I({
1142
+ geometry: o,
1143
+ symbol: {
1144
+ type: "simple-fill",
1145
+ color: [0, 255, 255, 0.5],
1146
+ style: "solid",
1147
+ outline: {
1148
+ color: [0, 255, 255],
1149
+ width: 1
1150
+ }
1151
+ },
1152
+ attributes: {
1153
+ type: "OpenDriveSection",
1154
+ roadsectBaseIds: s
1155
+ }
1156
+ });
1157
+ this.sectionLayer.removeAll(), this.sectionLayer.add(i), A.viewGoto(this.view, [i]), this.selectedSectionIds = [s];
1158
+ const l = this.splitLaneLayer.graphics.filter(
1159
+ (r) => {
1160
+ var a;
1161
+ return (a = r.getAttribute("roadsectBaseIds")) == null ? void 0 : a.includes(e.id);
1162
+ }
1163
+ );
1164
+ l.length > 0 && l.forEach(
1165
+ (r) => r.symbol = {
1166
+ type: "simple-fill",
1167
+ color: [255, 69, 0],
1168
+ outline: {
1169
+ color: "red",
1170
+ width: 2
1171
+ }
1172
+ }
1173
+ );
1174
+ }
1175
+ }
1176
+ }
1107
1177
  /**
1108
1178
  * 更新所有路口的symbol
1109
1179
  * @param symbolStyle
1110
1180
  */
1111
1181
  updateAllJunctionSymbol(e) {
1112
- const i = this.junctionLayer.graphics.clone();
1113
- this.junctionLayer.removeAll(), i.forEach((o) => {
1182
+ const t = this.junctionLayer.graphics.clone();
1183
+ this.junctionLayer.removeAll(), t.forEach((o) => {
1114
1184
  o.getAttribute("selected") || (o.symbol = this.getCrossGraphicSymbol(
1115
1185
  o.attributes,
1116
1186
  e
1117
1187
  ));
1118
- }), this.junctionLayer.addMany(i.toArray());
1188
+ }), this.junctionLayer.addMany(t.toArray());
1119
1189
  }
1120
1190
  /**
1121
1191
  * 生成路口点符号。在不同比例尺下,使用不同的符号
@@ -1123,16 +1193,16 @@ class O {
1123
1193
  * @param symbolType
1124
1194
  * @returns
1125
1195
  */
1126
- getCrossGraphicSymbol(e, i) {
1196
+ getCrossGraphicSymbol(e, t) {
1127
1197
  const o = e.crossId !== "" && e.crossId !== void 0 && e.crossId !== null;
1128
- if (i === "marker")
1198
+ if (t === "marker")
1129
1199
  return {
1130
1200
  type: "picture-marker",
1131
1201
  url: `/GisViewerAssets/Images/cross/${o ? "gis_xhj_blue" : "gis_lkcz_xz"}.png`,
1132
1202
  width: "32px",
1133
1203
  height: "32px"
1134
1204
  };
1135
- if (i === "picture")
1205
+ if (t === "picture")
1136
1206
  return o ? {
1137
1207
  type: "cim",
1138
1208
  data: {