gisviewer-vue3-arcgis 1.0.258 → 1.0.262

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.
Files changed (27) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +9 -1
  2. package/es/src/gis-map/gis-map.vue.mjs +96 -88
  3. package/es/src/gis-map/index.d.ts +8 -0
  4. package/es/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  5. package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
  6. package/es/src/gis-map/utils/dbscan-cluster/index.mjs +67 -76
  7. package/es/src/gis-map/utils/map-initializer.mjs +1 -1
  8. package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +2 -1
  9. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +369 -328
  10. package/es/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +51 -1
  11. package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +401 -20
  12. package/es/src/gis-map/utils/signal-control-area/show-area.mjs +23 -17
  13. package/es/src/types/index.d.ts +5 -0
  14. package/lib/src/gis-map/gis-map.vue.d.ts +9 -1
  15. package/lib/src/gis-map/gis-map.vue.js +1 -1
  16. package/lib/src/gis-map/index.d.ts +8 -0
  17. package/lib/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  18. package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
  19. package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -1
  20. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  21. package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +2 -1
  22. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  23. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +51 -1
  24. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -1
  25. package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
  26. package/lib/src/types/index.d.ts +5 -0
  27. package/package.json +1 -1
@@ -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
- import * as $ from "@arcgis/core/core/reactiveUtils.js";
4
- import { Polygon as S, Point as P } from "@arcgis/core/geometry";
3
+ import * as F from "@arcgis/core/core/reactiveUtils.js";
4
+ import { Polygon as S, Point as J } from "@arcgis/core/geometry";
5
5
  import * as L from "@arcgis/core/geometry/geometryEngine";
6
6
  import D from "@arcgis/core/layers/FeatureLayer";
7
7
  import w from "@arcgis/core/layers/GraphicsLayer";
8
- import * as k from "@turf/helpers";
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 v from "axios";
11
+ import { XMLParser as E } from "fast-xml-parser";
12
+ import B 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 N 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",
@@ -305,16 +310,16 @@ class O {
305
310
  return this.instance || (this.instance = new O(e)), this.instance;
306
311
  }
307
312
  async makeMd5FromFile(e) {
308
- var t;
313
+ var i;
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 n = (i = new E({
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 : i.border;
320
+ return n ? n = JSON.parse(n) : n = [], { status: 0, message: "ok", result: { md5: B(s), border: n } };
321
+ } catch (o) {
322
+ return { status: -1, message: o.message };
318
323
  }
319
324
  }
320
325
  /**
@@ -323,58 +328,64 @@ class O {
323
328
  * @returns
324
329
  */
325
330
  async showOpenDriveFromFile(e) {
326
- var y, m, f;
327
- this.openDriveClickCallback = e.selectedCallback, this.scaleWatch = $.watch(
331
+ var d, y, h;
332
+ this.openDriveClickCallback = e.selectedCallback, this.scaleWatch = F.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
- 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;
338
+ let i = e.file.split("/").pop() || "";
339
+ i = i.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 v.post(
344
+ o,
340
345
  {},
341
346
  {
342
347
  params: {
343
348
  url: e.file,
344
- projectName: t
349
+ projectName: i
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(
356
- i.geoReference,
357
- i.offsetX,
358
- i.offsetY
359
+ const t = s.data.result.geoSetting;
360
+ N.setGeoData(
361
+ t.geoReference,
362
+ t.offsetX,
363
+ t.offsetY
359
364
  );
360
- let c = o.data.result.json;
365
+ let c = s.data.result.json;
361
366
  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);
367
+ const n = await fetch(c);
368
+ let a;
369
+ if (c.endsWith("bin")) {
370
+ const u = await n.arrayBuffer(), p = M.inflate(u, { to: "string" });
371
+ a = JSON.parse(p);
372
+ } else
373
+ a = await n.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 r = T.useAppDataStore;
373
384
  return R(
374
- () => p.isSketching,
385
+ () => r.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
+ 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());
378
389
  }
379
390
  ), console.timeEnd("渲染用时"), { status: 0, message: "ok" };
380
391
  }
@@ -383,22 +394,28 @@ class O {
383
394
  * @param server
384
395
  * @param projectName
385
396
  */
386
- async showOpenDriveFromServer(e, t) {
387
- const s = `http://${e}/api/openDrive/analyzeXodr`, o = await b.get(s, {
397
+ async showOpenDriveFromServer(e, i) {
398
+ const o = `http://${e}/api/openDrive/analyzeXodr`, s = await v.get(o, {
388
399
  headers: {
389
- projectName: t
400
+ projectName: i
390
401
  },
391
402
  params: {
392
403
  analyze: !1,
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;
399
- 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" };
407
+ if (s.status !== 200)
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);
416
+ } else
417
+ n = await c.json();
418
+ return await this.showAllLanes(n, !1, !1), { status: 0, message: "ok" };
402
419
  }
403
420
  /**
404
421
  * 显示所有车道
@@ -407,68 +424,70 @@ 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) => {
427
+ async showAllLanes(e, i, 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((t) => {
432
+ var l;
416
433
  let c = 0;
417
434
  this.allLaneGraphics = [], this.allRefLineGraphics = [];
418
435
  const n = [];
419
436
  for (const r of e) {
420
- if (!t && r.junction !== "-1")
437
+ if (!i && r.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 } = r;
440
+ let h = r.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
448
  ObjectID: c++,
432
- roadId: l,
433
- roadName: p
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), 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)
442
459
  continue;
443
- const I = u.type, M = [...u.outerPath], A = u.innerPath.concat(
444
- M.reverse()
460
+ const P = f.type, $ = [...f.outerPath], A = f.innerPath.concat(
461
+ $.reverse()
445
462
  );
446
463
  if (A.length <= 3) {
447
- console.warn(`lane ${v} has less than 3 points`);
464
+ console.warn(`lane ${g} has less than 3 points`);
448
465
  continue;
449
466
  }
450
- A.push(u.innerPath[0]);
451
- const N = new S({
467
+ A.push(f.innerPath[0]);
468
+ const k = new S({
452
469
  rings: [A]
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
475
  ObjectID: c++,
459
- id: `${l}+${d}+${v}`,
476
+ id: `${d}+${b}+${g}`,
460
477
  fromNode: r.fromNode,
461
478
  toNode: r.toNode,
462
- roadId: String(l),
479
+ roadId: String(d),
463
480
  roadName: r.name,
464
- sectionId: String(d),
465
- sectionIndex: m,
466
- laneId: v,
467
- type: I,
481
+ sectionId: String(b),
482
+ sectionIndex: p,
483
+ laneId: g,
484
+ type: P,
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: (l = m.roadsectBaseIds) == null ? void 0 : l.toString()
472
491
  }
473
492
  });
474
493
  this.allLaneGraphics.push(j), n.push(j);
@@ -491,7 +510,7 @@ class O {
491
510
  });
492
511
  }
493
512
  } else
494
- clearInterval(a), i();
513
+ clearInterval(a), t();
495
514
  }, 10);
496
515
  });
497
516
  }
@@ -501,64 +520,64 @@ class O {
501
520
  * @returns
502
521
  */
503
522
  showJunction(e) {
504
- const t = [];
505
- let s;
506
- this.xodrBorder.length > 0 && (s = new S({
523
+ const i = [];
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 t = new J({
531
+ x: s.coordinates[0],
532
+ y: s.coordinates[1]
514
533
  });
515
534
  let c = !0;
516
- if (s && (c = L.contains(s, i)), c) {
517
- const n = new g({
518
- geometry: i,
535
+ if (o && (c = L.contains(o, t)), c) {
536
+ const n = new I({
537
+ geometry: t,
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
+ i.push(n);
527
546
  }
528
547
  }
529
- this.junctionLayer.addMany(t);
548
+ this.junctionLayer.addMany(i);
530
549
  }
531
550
  /**
532
551
  * 监听鼠标移动事件,高亮显示鼠标所在路段和路口
533
552
  */
534
553
  monitorMouseMove() {
535
- const e = C.debounce(async (t) => {
554
+ const e = C.debounce(async (i) => {
536
555
  var c;
537
- const o = (c = (await this.view.hitTest(t, {
556
+ const s = (c = (await this.view.hitTest(i, {
538
557
  include: [this.laneLayer, this.junctionLayer]
539
558
  })).results) == null ? void 0 : c.filter(
540
559
  (n) => n.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];
547
- if (this.hitGraphic = i.graphic, i.layer.id === "OpenDriveLane") {
565
+ const t = s[0];
566
+ if (this.hitGraphic = t.graphic, t.layer.id === "OpenDriveLane") {
548
567
  const n = `${this.hitGraphic.getAttribute(
549
568
  "roadId"
550
569
  )}+${this.hitGraphic.getAttribute("sectionId")}`;
551
570
  if (this.currentSectionCode === n || this.selectedSectionIds.includes(n) || this.sectionLayer.graphics.findIndex(
552
- (d) => d.getAttribute("id") === n
571
+ (m) => m.getAttribute("id") === n
553
572
  ) >= 0)
554
573
  return;
555
574
  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,
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,
562
581
  symbol: {
563
582
  type: "simple-fill",
564
583
  color: [0, 255, 255, 0.5],
@@ -572,9 +591,10 @@ class O {
572
591
  type: "OpenDriveSection",
573
592
  id: n,
574
593
  selected: !1,
575
- fromNodeName: y,
576
- toNodeName: m,
577
- laneCount: r.length
594
+ fromNodeName: h,
595
+ toNodeName: u,
596
+ laneCount: l.length,
597
+ roadsectBaseIds: this.hitGraphic.getAttribute("roadsectBaseIds")
578
598
  },
579
599
  popupTemplate: {
580
600
  title: this.hitGraphic.getAttribute("roadName"),
@@ -599,16 +619,16 @@ class O {
599
619
  ]
600
620
  }
601
621
  });
602
- this.highlightLayer.removeAll(), this.highlightLayer.add(f);
603
- } else if (i.layer.id === "OpenDriveJunction") {
622
+ this.highlightLayer.removeAll(), this.highlightLayer.add(p);
623
+ } else if (t.layer.id === "OpenDriveJunction") {
604
624
  const n = this.hitGraphic.getAttribute("id");
605
625
  if (n === this.currentJunctionId)
606
626
  return;
607
627
  this.currentJunctionId = n;
608
628
  }
609
629
  });
610
- this.mouseMoveHandler = this.view.on("pointer-move", async (t) => {
611
- e(t).catch(() => {
630
+ this.mouseMoveHandler = this.view.on("pointer-move", async (i) => {
631
+ e(i).catch(() => {
612
632
  });
613
633
  });
614
634
  }
@@ -616,71 +636,76 @@ class O {
616
636
  * 监听鼠标点击事件,获取高亮要素的拓扑信息
617
637
  */
618
638
  monitorMouseClick() {
619
- const e = C.debounce(async (t) => {
639
+ const e = C.debounce(async (i) => {
620
640
  var a;
621
- const o = (a = (await this.view.hitTest(t, {
641
+ const s = (a = (await this.view.hitTest(i, {
622
642
  include: [this.highlightLayer, this.junctionLayer, this.sectionLayer]
623
643
  })).results) == null ? void 0 : a.filter(
624
- (r) => r.type === "graphic"
644
+ (l) => l.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");
648
+ const t = s[0].graphic, c = t.getAttribute("type"), n = t.getAttribute("id");
629
649
  if (c === "OpenDriveJunction")
630
- if (i.getAttribute("selected") === !1) {
631
- const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, l = await b.get(r, {
650
+ if (t.getAttribute("selected") === !1) {
651
+ const l = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, r = await v.get(l, {
632
652
  params: {
633
653
  id: n,
634
654
  projectName: this.projectName
635
655
  }
636
656
  });
637
- l.status === 200 && l.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
657
+ r.status === 200 && r.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
638
658
  type: "OpenDriveJunction",
639
659
  id: n,
640
- details: l.data.result
641
- }), i.setAttribute("selected", !0), i.symbol = {
660
+ details: r.data.result
661
+ }), t.setAttribute("selected", !0), t.symbol = {
642
662
  type: "picture-marker",
643
663
  url: "/GisViewerAssets/Images/point_red.png",
644
664
  width: "20px",
645
665
  height: "20px"
646
- }, this.increasePictureMarkerSize(i, 50));
666
+ }, this.increasePictureMarkerSize(t, 50));
647
667
  } else
648
668
  this.openDriveClickCallback && this.openDriveClickCallback({
649
669
  type: "OpenDriveJunction",
650
670
  id: n,
651
671
  details: void 0
652
- }), i.setAttribute("selected", !1), i.symbol = this.getCrossGraphicSymbol(
653
- i.attributes,
672
+ }), t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
673
+ t.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
+ 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
+ ).forEach(
680
+ (r) => r.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
+ (r) => r.getAttribute("roadsectBaseIds") === t.getAttribute("roadsectBaseIds")
690
+ ).forEach(
691
+ (r) => r.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(t), this.selectedSectionIds = this.selectedSectionIds.filter(
700
+ (r) => r !== n
701
+ ), this.openDriveClickCallback && this.openDriveClickCallback({
702
+ type: "OpenDriveSection",
703
+ id: t.getAttribute("edgeId"),
704
+ details: void 0
705
+ })));
681
706
  });
682
- this.mouseClickHandler = this.view.on("immediate-click", async (t) => {
683
- e(t).catch(() => {
707
+ this.mouseClickHandler = this.view.on("immediate-click", async (i) => {
708
+ e(i).catch(() => {
684
709
  });
685
710
  });
686
711
  }
@@ -689,15 +714,15 @@ class O {
689
714
  * @param graphic
690
715
  * @param targetSize
691
716
  */
692
- increasePictureMarkerSize(e, t) {
693
- const s = setInterval(() => {
694
- const o = e.symbol, i = o.width;
695
- i < t ? e.symbol = {
717
+ increasePictureMarkerSize(e, i) {
718
+ const o = setInterval(() => {
719
+ const s = e.symbol, t = s.width;
720
+ t < i ? e.symbol = {
696
721
  type: "picture-marker",
697
- url: o.url,
698
- width: i + 1,
699
- height: i + 1
700
- } : clearInterval(s);
722
+ url: s.url,
723
+ width: t + 1,
724
+ height: t + 1
725
+ } : clearInterval(o);
701
726
  }, 20);
702
727
  }
703
728
  /**
@@ -705,41 +730,41 @@ class O {
705
730
  * @param graphic
706
731
  * @param targetSize
707
732
  */
708
- decreasePictureMarkerSize(e, t) {
709
- const s = setInterval(() => {
710
- const o = e.symbol, i = o.width;
711
- i > t ? e.symbol = {
733
+ decreasePictureMarkerSize(e, i) {
734
+ const o = setInterval(() => {
735
+ const s = e.symbol, t = s.width;
736
+ t > i ? e.symbol = {
712
737
  type: "picture-marker",
713
- url: o.url,
714
- width: i - 1,
715
- height: i - 1
716
- } : clearInterval(s);
738
+ url: s.url,
739
+ width: t - 1,
740
+ height: t - 1
741
+ } : clearInterval(o);
717
742
  }, 20);
718
743
  }
719
744
  async getSumoInfo(e) {
720
745
  switch (e.type) {
721
746
  case "junction": {
722
- const t = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, s = await b.get(t, {
747
+ const i = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, o = await v.get(i, {
723
748
  params: {
724
749
  id: e.id,
725
750
  projectName: this.projectName
726
751
  }
727
752
  });
728
- return s.status === 200 ? s.data : { status: -1, message: `路口信息查询失败: ${e.id}` };
753
+ return o.status === 200 ? o.data : { status: -1, message: `路口信息查询失败: ${e.id}` };
729
754
  }
730
755
  case "edge": {
731
- 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]));
736
- const i = this.allLaneGraphics.find(
737
- (c) => c.getAttribute("roadId") === s && c.getAttribute("sectionIndex") === o
756
+ const i = e.id.split("#");
757
+ let o = i[0];
758
+ o.startsWith("-") && (o = o.slice(1));
759
+ 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
738
763
  );
739
- if (i) {
740
- const c = `${s}+${i.getAttribute(
764
+ if (t) {
765
+ const c = `${o}+${t.getAttribute(
741
766
  "sectionId"
742
- )}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await b.get(n, {
767
+ )}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await v.get(n, {
743
768
  params: {
744
769
  id: c,
745
770
  projectName: this.projectName
@@ -760,13 +785,13 @@ class O {
760
785
  * 清除OpenDrive内容
761
786
  */
762
787
  async clearOpenDrive() {
763
- var t, s, o;
788
+ var i, o, s;
764
789
  let e = await this.laneLayer.queryFeatures();
765
790
  e.features.length > 0 && await this.laneLayer.applyEdits({
766
791
  deleteFeatures: e.features
767
792
  }), e = await this.roadNameLayer.queryFeatures(), e.features.length > 0 && await this.roadNameLayer.applyEdits({
768
793
  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;
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;
770
795
  }
771
796
  /**
772
797
  * 用sumo的id定位车道、基本段、路段
@@ -774,30 +799,30 @@ class O {
774
799
  * @returns
775
800
  */
776
801
  async findSumo(e) {
777
- const { type: t, id: s } = e, o = e.flash === void 0 ? !0 : e.flash;
778
- if (t === "junction")
779
- return await this.findJunction(s, o);
780
- if (t === "edge") {
781
- const i = s.split("_");
782
- if (i.length > 2)
802
+ const { type: i, id: o } = e, s = e.flash === void 0 ? !0 : e.flash;
803
+ if (i === "junction")
804
+ return await this.findJunction(o, s);
805
+ if (i === "edge") {
806
+ const t = o.split("_");
807
+ if (t.length > 2)
783
808
  return { status: -1, message: "id格式错误" };
784
- const c = i.length === 2 ? Number(i[1]) : void 0, n = i[0].split("#");
809
+ const c = t.length === 2 ? Number(t[1]) : void 0, n = t[0].split("#");
785
810
  if (n.length > 2)
786
811
  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 });
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 });
789
814
  } else
790
815
  return { status: -1, message: "未知类型" };
791
816
  }
792
- async findJunction(e, t) {
793
- const s = this.junctionLayer.graphics.find(
794
- (o) => o.attributes.id === e
817
+ async findJunction(e, i) {
818
+ const o = this.junctionLayer.graphics.find(
819
+ (s) => s.attributes.id === e
795
820
  );
796
- if (!s)
821
+ if (!o)
797
822
  return { status: -1, message: "未找到。请检查路口编号" };
798
- if (t) {
799
- const o = new g({
800
- geometry: s.geometry,
823
+ if (i) {
824
+ const s = new I({
825
+ geometry: o.geometry,
801
826
  symbol: {
802
827
  type: "simple-marker",
803
828
  style: "circle",
@@ -809,9 +834,9 @@ class O {
809
834
  }
810
835
  }
811
836
  });
812
- this.flashGraphic(o);
837
+ this.flashGraphic(s);
813
838
  }
814
- return await this.view.goTo(s.geometry, { duration: 1e3 }), { status: 0, message: "ok" };
839
+ return await this.view.goTo(o.geometry, { duration: 1e3 }), { status: 0, message: "ok" };
815
840
  }
816
841
  /**
817
842
  * 用sumo的id定位车道、基本段、路段
@@ -819,40 +844,40 @@ class O {
819
844
  * @returns
820
845
  */
821
846
  async findLane(e) {
822
- let { roadsectId: t, segmentId: s, laneId: o } = e;
823
- t.startsWith("-") && (t = t.slice(1));
824
- let i = this.allLaneGraphics.filter(
825
- (a) => a.attributes.roadId === t
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
826
851
  );
827
- if (i.length === 0)
852
+ if (t.length === 0)
828
853
  return { status: -1, message: "未找到。请检查路段编号" };
829
- if (s !== void 0) {
854
+ if (o !== void 0) {
830
855
  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)
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)
835
860
  return { status: -1, message: "未找到。请检查基本段编号" };
836
- s = a[s], i = i.filter(
837
- (r) => Number(r.attributes.sectionId) === s
861
+ o = a[o], t = t.filter(
862
+ (l) => Number(l.attributes.sectionId) === o
838
863
  );
839
864
  }
840
- if (o !== void 0) {
865
+ if (s !== void 0) {
841
866
  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)
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)
846
871
  return { status: -1, message: "未找到。请检查车道编号" };
847
- o = a[o], i = i.filter(
848
- (r) => Number(r.attributes.laneId) === o
872
+ s = a[s], t = t.filter(
873
+ (l) => Number(l.attributes.laneId) === s
849
874
  );
850
875
  }
851
- const c = i.map(
876
+ const c = t.map(
852
877
  (a) => a.geometry
853
878
  ), n = L.union(c);
854
879
  if (e.flash) {
855
- const a = new g({
880
+ const a = new I({
856
881
  geometry: n,
857
882
  symbol: {
858
883
  type: "simple-fill",
@@ -873,9 +898,9 @@ class O {
873
898
  */
874
899
  flashGraphic(e) {
875
900
  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));
901
+ let i = 0, o = !0;
902
+ 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));
879
904
  }, 10);
880
905
  }
881
906
  /**
@@ -884,19 +909,19 @@ class O {
884
909
  * @returns
885
910
  */
886
911
  unselectSumo(e) {
887
- if ((!e || e.type === "junction") && this.junctionLayer.graphics.forEach((t) => {
888
- (!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected") && (t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
889
- t.attributes,
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,
890
915
  this.view.scale < this.junctionScale ? "picture" : "marker"
891
916
  ));
892
917
  }), !e || e.type === "edge") {
893
- 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");
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) => {
920
+ const s = o.getAttribute("id");
896
921
  this.selectedSectionIds = this.selectedSectionIds.filter(
897
- (i) => i !== o
922
+ (t) => t !== s
898
923
  );
899
- }), this.sectionLayer.removeMany(t));
924
+ }), this.sectionLayer.removeMany(i));
900
925
  }
901
926
  return { status: 0, message: "ok" };
902
927
  }
@@ -908,31 +933,31 @@ class O {
908
933
  async selectSumo(e) {
909
934
  switch (e.type) {
910
935
  case "junction":
911
- return this.junctionLayer.graphics.forEach((t) => {
912
- if (e.id === t.getAttribute("id"))
913
- return t.setAttribute("selected", !0), t.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(t, 50), { status: 0, message: "ok" };
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" };
914
939
  }), { status: -1, message: "未找到路口" };
915
940
  case "edge": {
916
- 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]));
921
- let i = [];
922
- if (t.length === 1 ? i = this.allLaneGraphics.filter(
923
- (c) => c.getAttribute("roadId") === s
924
- ) : t.length === 2 && (i = this.allLaneGraphics.filter(
925
- (c) => c.getAttribute("roadId") === s && c.getAttribute("sectionIndex") === o
926
- )), i.length > 0) {
941
+ const i = e.id.split("#");
942
+ let o = String(i[0]);
943
+ o.startsWith("-") && (o = o.slice(1));
944
+ 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) {
927
952
  const c = /* @__PURE__ */ new Map();
928
- return i.forEach((n) => {
953
+ return t.forEach((n) => {
929
954
  const a = n.getAttribute("roadId") + "+" + n.getAttribute("sectionId");
930
955
  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));
956
+ let l = c.get(a);
957
+ l ? l.push(n.geometry) : (l = [n.geometry], c.set(a, l));
933
958
  }), c.forEach(async (n, a) => {
934
- const r = L.union(n), l = new g({
935
- geometry: r,
959
+ const l = L.union(n), r = new I({
960
+ geometry: l,
936
961
  symbol: {
937
962
  type: "simple-fill",
938
963
  color: [0, 255, 255, 0.5],
@@ -949,7 +974,7 @@ class O {
949
974
  selected: !0
950
975
  }
951
976
  });
952
- this.sectionLayer.add(l), await this.view.goTo(l);
977
+ this.sectionLayer.add(r), await this.view.goTo(r);
953
978
  }), { status: 0, message: "ok" };
954
979
  } else
955
980
  return { status: -1, message: "未找到路段" };
@@ -959,96 +984,96 @@ class O {
959
984
  }
960
985
  }
961
986
  async geometrySearch(e) {
962
- const t = new S({
987
+ const i = new S({
963
988
  rings: [e]
964
- }), s = await this.laneLayer.queryFeatures({
965
- geometry: t,
989
+ }), o = await this.laneLayer.queryFeatures({
990
+ geometry: i,
966
991
  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({
992
+ }), s = [], t = [];
993
+ for (const a of o.features) {
994
+ const l = a.getAttribute("roadId"), r = a.getAttribute("sectionIndex"), d = `${l}#${r}`;
995
+ if (s.indexOf(d) === -1) {
996
+ s.push(d), this.selectSumo({
972
997
  type: "edge",
973
- id: h
998
+ id: d
974
999
  });
975
- const p = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, y = await b.get(p, {
1000
+ const y = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, h = await v.get(y, {
976
1001
  params: {
977
- id: `${r}+${a.getAttribute("sectionId")}`,
1002
+ id: `${l}+${a.getAttribute("sectionId")}`,
978
1003
  projectName: this.projectName
979
1004
  }
980
1005
  });
981
- y.status === 200 && y.data.status === 0 && i.push(y.data.result);
1006
+ h.status === 200 && h.data.status === 0 && t.push(h.data.result);
982
1007
  }
983
1008
  }
984
1009
  const c = this.junctionLayer.graphics.filter((a) => {
985
- const r = a.geometry;
986
- return L.contains(t, r);
1010
+ const l = a.geometry;
1011
+ return L.contains(i, l);
987
1012
  }), n = [];
988
1013
  for (const a of c) {
989
- const r = a.getAttribute("id");
1014
+ const l = a.getAttribute("id");
990
1015
  this.selectSumo({
991
1016
  type: "junction",
992
- id: r
1017
+ id: l
993
1018
  });
994
- const l = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, h = await b.get(l, {
1019
+ const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, d = await v.get(r, {
995
1020
  params: {
996
- id: r,
1021
+ id: l,
997
1022
  projectName: this.projectName
998
1023
  }
999
1024
  });
1000
- h.status === 200 && h.data.status === 0 && n.push(h.data.result);
1025
+ d.status === 200 && d.data.status === 0 && n.push(d.data.result);
1001
1026
  }
1002
1027
  return {
1003
1028
  status: 0,
1004
1029
  message: "ok",
1005
1030
  result: {
1006
1031
  junctions: n,
1007
- edges: i
1032
+ edges: t
1008
1033
  }
1009
1034
  };
1010
1035
  }
1011
1036
  async splitLane(e) {
1012
- const s = e.id.split("_");
1013
- if (s.length !== 2)
1037
+ const o = e.id.split("_");
1038
+ if (o.length !== 2)
1014
1039
  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];
1040
+ const s = Number(o[1]), t = o[0].split("#"), c = t.length === 2 ? Number(t[1]) : 0;
1041
+ let n = t[0];
1017
1042
  n.startsWith("-") && (n = n.slice(1));
1018
- const a = this.allLaneGraphics.filter((I) => I.getAttribute("roadId") === n && I.getAttribute("sectionIndex") === c);
1043
+ const a = this.allLaneGraphics.filter((g) => g.getAttribute("roadId") === n && g.getAttribute("sectionIndex") === c);
1019
1044
  if (a.length === 0)
1020
1045
  return { status: -1, message: "未找到路段" };
1021
- const r = a.length - o, l = a.find(
1022
- (I) => Math.abs(I.getAttribute("laneId")) === r
1046
+ const l = a.length - s, r = a.find(
1047
+ (g) => Math.abs(g.getAttribute("laneId")) === l
1023
1048
  );
1024
- if (!l)
1049
+ if (!r)
1025
1050
  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, {
1051
+ const d = e.start || 0, y = e.end || 100, h = G.lineString(r.getAttribute("leftLine")), u = x(h, d, y, {
1027
1052
  units: "meters"
1028
- }), f = k.lineString(l.getAttribute("rightLine")), d = x(f, h, p, {
1053
+ }), p = G.lineString(r.getAttribute("rightLine")), m = x(p, d, y, {
1029
1054
  units: "meters"
1030
- }), u = m.geometry.coordinates.concat(
1031
- d.geometry.coordinates.reverse()
1055
+ }), b = u.geometry.coordinates.concat(
1056
+ m.geometry.coordinates.reverse()
1032
1057
  );
1033
- u.push(u[u.length - 1]);
1034
- const v = new g({
1058
+ b.push(b[b.length - 1]);
1059
+ const f = new I({
1035
1060
  geometry: new S({
1036
- rings: [u]
1061
+ rings: [b]
1037
1062
  }),
1038
1063
  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
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"),
1075
+ leftLine: u.geometry.coordinates,
1076
+ rightLine: m.geometry.coordinates
1052
1077
  },
1053
1078
  symbol: {
1054
1079
  type: "simple-fill",
@@ -1058,7 +1083,23 @@ class O {
1058
1083
  }
1059
1084
  }
1060
1085
  });
1061
- return this.splitLaneLayer.add(v), this.view.goTo(v), { status: 0, message: "ok", result: { coordinates: u } };
1086
+ return this.splitLaneLayer.add(f), N.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: b } };
1087
+ }
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 = {
1095
+ type: "simple-fill",
1096
+ color: [255, 0, 0, 0.8],
1097
+ outline: {
1098
+ color: "red"
1099
+ }
1100
+ }, t;
1101
+ });
1102
+ this.splitLaneLayer.addMany(o), N.viewGoto(this.view, o);
1062
1103
  }
1063
1104
  clearSplitLane() {
1064
1105
  this.splitLaneLayer.removeAll();
@@ -1068,13 +1109,13 @@ class O {
1068
1109
  * @param symbolStyle
1069
1110
  */
1070
1111
  updateAllJunctionSymbol(e) {
1071
- const t = this.junctionLayer.graphics.clone();
1072
- this.junctionLayer.removeAll(), t.forEach((s) => {
1073
- s.getAttribute("selected") || (s.symbol = this.getCrossGraphicSymbol(
1074
- s.attributes,
1112
+ const i = this.junctionLayer.graphics.clone();
1113
+ this.junctionLayer.removeAll(), i.forEach((o) => {
1114
+ o.getAttribute("selected") || (o.symbol = this.getCrossGraphicSymbol(
1115
+ o.attributes,
1075
1116
  e
1076
1117
  ));
1077
- }), this.junctionLayer.addMany(t.toArray());
1118
+ }), this.junctionLayer.addMany(i.toArray());
1078
1119
  }
1079
1120
  /**
1080
1121
  * 生成路口点符号。在不同比例尺下,使用不同的符号
@@ -1082,17 +1123,17 @@ class O {
1082
1123
  * @param symbolType
1083
1124
  * @returns
1084
1125
  */
1085
- getCrossGraphicSymbol(e, t) {
1086
- const s = e.crossId !== "" && e.crossId !== void 0 && e.crossId !== null;
1087
- if (t === "marker")
1126
+ getCrossGraphicSymbol(e, i) {
1127
+ const o = e.crossId !== "" && e.crossId !== void 0 && e.crossId !== null;
1128
+ if (i === "marker")
1088
1129
  return {
1089
1130
  type: "picture-marker",
1090
- url: `/GisViewerAssets/Images/cross/${s ? "gis_xhj_blue" : "gis_lkcz_xz"}.png`,
1131
+ url: `/GisViewerAssets/Images/cross/${o ? "gis_xhj_blue" : "gis_lkcz_xz"}.png`,
1091
1132
  width: "32px",
1092
1133
  height: "32px"
1093
1134
  };
1094
- if (t === "picture")
1095
- return s ? {
1135
+ if (i === "picture")
1136
+ return o ? {
1096
1137
  type: "cim",
1097
1138
  data: {
1098
1139
  type: "CIMSymbolReference",
@@ -1130,7 +1171,7 @@ class O {
1130
1171
  height: 12,
1131
1172
  horizontalAlignment: "Center",
1132
1173
  offsetX: 0,
1133
- offsetY: s ? 25 : 15,
1174
+ offsetY: o ? 25 : 15,
1134
1175
  haloSize: 2,
1135
1176
  haloSymbol: {
1136
1177
  type: "CIMPolygonSymbol",