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