gisviewer-vue3-arcgis 1.0.159 → 1.0.161

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,21 +1,22 @@
1
- import y from "@arcgis/core/Graphic";
2
- import * as j from "@arcgis/core/core/promiseUtils";
1
+ import g from "@arcgis/core/Graphic";
2
+ import * as C from "@arcgis/core/core/promiseUtils";
3
+ import * as $ from "@arcgis/core/core/reactiveUtils.js";
3
4
  import { Polygon as N } from "@arcgis/core/geometry";
4
5
  import * as L from "@arcgis/core/geometry/geometryEngine";
5
6
  import k from "@arcgis/core/layers/FeatureLayer";
6
7
  import I from "@arcgis/core/layers/GraphicsLayer";
7
- import * as G from "@turf/helpers";
8
- import { lineSliceAlong as C } from "@turf/line-slice-along";
8
+ import * as D from "@turf/helpers";
9
+ import { lineSliceAlong as G } from "@turf/line-slice-along";
9
10
  import b from "axios";
10
- import { XMLParser as $ } from "fast-xml-parser";
11
- import F from "md5";
12
- import O from "pako";
13
- import { watch as P } from "vue";
14
- import J from "../../stores/index.mjs";
15
- import E from "../common-utils.mjs";
16
- class x {
11
+ import { XMLParser as F } from "fast-xml-parser";
12
+ import P from "md5";
13
+ import x from "pako";
14
+ import { watch as E } from "vue";
15
+ import R from "../../stores/index.mjs";
16
+ import J from "../common-utils.mjs";
17
+ class M {
17
18
  constructor(e) {
18
- this.junctionNames = /* @__PURE__ */ new Map(), this.projectName = "", this.openDriveServer = "", this.currentSectionCode = "", this.selectedSectionIds = [], this.currentJunctionId = "", this.view = e, this.laneLayer = new k({
19
+ this.junctionNames = /* @__PURE__ */ new Map(), this.junctionScale = 5e3, this.projectName = "", this.openDriveServer = "", this.currentSectionCode = "", this.selectedSectionIds = [], this.currentJunctionId = "", this.view = e, this.laneLayer = new k({
19
20
  id: "OpenDriveLane",
20
21
  fields: [
21
22
  {
@@ -290,9 +291,9 @@ class x {
290
291
  ]
291
292
  }), this.junctionLayer = new I({ id: "OpenDriveJunction" }), this.sectionLayer = new I({ id: "OpenDriveSection" }), this.highlightLayer = new I({ id: "OpenDriveHighlight" }), this.flashLayer = new I({ id: "OpenDriveFlash" }), this.drawLayer = new I({ id: "Draw" }), this.splitLaneLayer = new I({ id: "SplitLane" }), this.borderLayer = new I({ id: "OpenDriveBorder" }), this.view.map.addMany([
292
293
  this.laneLayer,
293
- this.junctionLayer,
294
294
  this.sectionLayer,
295
295
  this.roadNameLayer,
296
+ this.junctionLayer,
296
297
  this.highlightLayer,
297
298
  this.flashLayer,
298
299
  this.drawLayer,
@@ -301,16 +302,16 @@ class x {
301
302
  ]);
302
303
  }
303
304
  static getInstance(e) {
304
- return this.instance || (this.instance = new x(e)), this.instance;
305
+ return this.instance || (this.instance = new M(e)), this.instance;
305
306
  }
306
307
  async makeMd5FromFile(e) {
307
308
  var t;
308
309
  try {
309
- const r = await (await fetch(e)).text(), n = (t = new $({
310
+ const r = await (await fetch(e)).text(), n = (t = new F({
310
311
  ignoreAttributes: !1,
311
312
  allowBooleanAttributes: !0
312
313
  }).parse(r).OpenDRIVE.userData) == null ? void 0 : t.border;
313
- return { status: 0, message: "ok", result: { md5: F(r), border: n } };
314
+ return { status: 0, message: "ok", result: { md5: P(r), border: n } };
314
315
  } catch (i) {
315
316
  return { status: -1, message: i.message };
316
317
  }
@@ -321,8 +322,23 @@ class x {
321
322
  * @returns
322
323
  */
323
324
  async showOpenDriveFromFile(e) {
324
- var f, p;
325
- this.openDriveClickCallback = e.selectedCallback, console.time("md5用时");
325
+ var f, y;
326
+ this.openDriveClickCallback = e.selectedCallback, $.watch(
327
+ () => this.view.scale,
328
+ (p, h) => {
329
+ p > this.junctionScale && h <= this.junctionScale ? (console.log(p, h), this.junctionLayer.graphics.forEach((m) => {
330
+ m.symbol = this.getCrossGraphicSymbol(
331
+ m.attributes,
332
+ "marker"
333
+ );
334
+ })) : p <= this.junctionScale && h > this.junctionScale && (console.log(p, h), this.junctionLayer.graphics.forEach((m) => {
335
+ m.symbol = this.getCrossGraphicSymbol(
336
+ m.attributes,
337
+ "picture"
338
+ );
339
+ }));
340
+ }
341
+ ), console.time("md5用时");
326
342
  const t = await this.makeMd5FromFile(e.file);
327
343
  if (t.status !== 0)
328
344
  return t;
@@ -340,34 +356,34 @@ class x {
340
356
  }
341
357
  }
342
358
  );
343
- } catch (m) {
344
- return { status: -1, message: m.message };
359
+ } catch (p) {
360
+ return { status: -1, message: p.message };
345
361
  }
346
362
  if (r.status !== 200)
347
363
  return { status: -1, message: r.statusText };
348
364
  console.time("渲染用时");
349
365
  const s = r.data.result.geoSetting;
350
- E.setGeoData(
366
+ J.setGeoData(
351
367
  s.geoReference,
352
368
  s.offsetX,
353
369
  s.offsetY
354
370
  );
355
371
  let c = r.data.result.json;
356
372
  c.startsWith(window.location.protocol) || (c = `${window.location.protocol}//${e.server}${c}`);
357
- const a = await (await fetch(c)).arrayBuffer(), o = O.inflate(a, { to: "string" }), l = JSON.parse(o);
373
+ const a = await (await fetch(c)).arrayBuffer(), o = x.inflate(a, { to: "string" }), l = JSON.parse(o);
358
374
  await this.showAllLanes(
359
375
  l,
360
376
  ((f = e.options) == null ? void 0 : f.showJunctionLane) || !1,
361
- ((p = e.options) == null ? void 0 : p.showRoadName) || !0
377
+ ((y = e.options) == null ? void 0 : y.showRoadName) || !0
362
378
  );
363
379
  const d = r.data.result.junctions;
364
380
  this.showJunction(d), e.options && e.options.centerMap !== !1 && await this.view.goTo(this.allLaneGraphics), this.mouseMoveHandler || this.monitorMouseMove(), this.mouseClickHandler || this.monitorMouseClick();
365
- const h = J.useAppDataStore;
366
- return P(
367
- () => h.isSketching,
381
+ const u = R.useAppDataStore;
382
+ return E(
383
+ () => u.isSketching,
368
384
  () => {
369
- var m, g;
370
- h.isSketching ? ((m = this.mouseMoveHandler) == null || m.remove(), this.mouseMoveHandler = void 0, (g = this.mouseClickHandler) == null || g.remove(), this.mouseClickHandler = void 0) : (this.monitorMouseMove(), this.monitorMouseClick());
385
+ var p, h;
386
+ u.isSketching ? ((p = this.mouseMoveHandler) == null || p.remove(), this.mouseMoveHandler = void 0, (h = this.mouseClickHandler) == null || h.remove(), this.mouseClickHandler = void 0) : (this.monitorMouseMove(), this.monitorMouseClick());
371
387
  }
372
388
  ), console.timeEnd("渲染用时"), { status: 0, message: "ok" };
373
389
  }
@@ -390,7 +406,7 @@ class x {
390
406
  throw new Error(`OpenDriveRenderer: ${r.statusText}`);
391
407
  let s = r.data.result.json;
392
408
  s.startsWith(window.location.protocol) || (s = `${window.location.protocol}//${e}${s}`);
393
- const n = await (await fetch(s)).arrayBuffer(), a = O.inflate(n, { to: "string" }), o = JSON.parse(a);
409
+ const n = await (await fetch(s)).arrayBuffer(), a = x.inflate(n, { to: "string" }), o = JSON.parse(a);
394
410
  return await this.showAllLanes(o, !1, !1), { status: 0, message: "ok" };
395
411
  }
396
412
  /**
@@ -412,9 +428,9 @@ class x {
412
428
  if (!t && o.junction !== "-1")
413
429
  continue;
414
430
  const { id: l, refLine: d } = o;
415
- let h = o.name;
416
- h.includes("(") && (h = h.slice(0, h.indexOf("("))), h = h.replace(/(.)/g, "$1 ");
417
- const f = new y({
431
+ let u = o.name;
432
+ u.includes("(") && (u = u.slice(0, u.indexOf("("))), u = u.replace(/(.)/g, "$1 ");
433
+ const f = new g({
418
434
  geometry: {
419
435
  type: "polyline",
420
436
  paths: [d]
@@ -422,48 +438,48 @@ class x {
422
438
  attributes: {
423
439
  ObjectID: c++,
424
440
  roadId: l,
425
- roadName: h
441
+ roadName: u
426
442
  }
427
443
  });
428
- this.allRefLineGraphics.push(f), o.laneSections.sort((p, m) => Number(p.id) - Number(m.id));
429
- for (let p = 0; p < o.laneSections.length; p++) {
430
- const m = o.laneSections[p], g = Number(m.id);
431
- for (const u of m.lanePaths) {
432
- const w = Number(u.id);
433
- if (w === 0)
444
+ this.allRefLineGraphics.push(f), o.laneSections.sort((y, p) => Number(y.id) - Number(p.id));
445
+ for (let y = 0; y < o.laneSections.length; y++) {
446
+ const p = o.laneSections[y], h = Number(p.id);
447
+ for (const m of p.lanePaths) {
448
+ const v = Number(m.id);
449
+ if (v === 0)
434
450
  continue;
435
- const v = u.type, M = [...u.outerPath], S = u.innerPath.concat(
436
- M.reverse()
451
+ const w = m.type, O = [...m.outerPath], S = m.innerPath.concat(
452
+ O.reverse()
437
453
  );
438
454
  if (S.length <= 3) {
439
- console.warn(`lane ${w} has less than 3 points`);
455
+ console.warn(`lane ${v} has less than 3 points`);
440
456
  continue;
441
457
  }
442
- S.push(u.innerPath[0]);
458
+ S.push(m.innerPath[0]);
443
459
  const A = new N({
444
460
  rings: [S]
445
461
  });
446
462
  if (A) {
447
- const D = new y({
463
+ const j = new g({
448
464
  geometry: A,
449
465
  attributes: {
450
466
  ObjectID: c++,
451
- id: `${l}+${g}+${w}`,
467
+ id: `${l}+${h}+${v}`,
452
468
  fromNode: o.fromNode,
453
469
  toNode: o.toNode,
454
470
  roadId: String(l),
455
471
  roadName: o.name,
456
- sectionId: String(g),
457
- sectionIndex: p,
458
- laneId: w,
459
- type: v,
472
+ sectionId: String(h),
473
+ sectionIndex: y,
474
+ laneId: v,
475
+ type: w,
460
476
  sumoId: "",
461
477
  // 记录左右边线的起始点,用于按长度高亮车道的一部分
462
- leftLine: u.innerPath,
463
- rightLine: u.outerPath
478
+ leftLine: m.innerPath,
479
+ rightLine: m.outerPath
464
480
  }
465
481
  });
466
- this.allLaneGraphics.push(D), n.push(D);
482
+ this.allLaneGraphics.push(j), n.push(j);
467
483
  }
468
484
  }
469
485
  }
@@ -498,7 +514,7 @@ class x {
498
514
  if (!i)
499
515
  continue;
500
516
  this.junctionNames.set(i.id, i.name), i.nodeType = i.type;
501
- const r = new y({
517
+ const r = new g({
502
518
  geometry: {
503
519
  type: "point",
504
520
  x: i.coordinates[0],
@@ -509,31 +525,34 @@ class x {
509
525
  selected: !1,
510
526
  type: "OpenDriveJunction"
511
527
  },
512
- symbol: {
513
- type: "picture-marker",
514
- url: i.crossId ? "/GisViewerAssets/Images/xhj_1.png" : "/GisViewerAssets/Images/xhj_2.png",
515
- width: "18px",
516
- height: "28px",
517
- yoffset: "9px"
518
- },
519
- popupTemplate: {
520
- title: i.name,
521
- content: [
522
- {
523
- type: "fields",
524
- fieldInfos: [
525
- {
526
- fieldName: "id",
527
- label: "路口编号"
528
- },
529
- {
530
- fieldName: "crossId",
531
- label: "信号机编号"
532
- }
533
- ]
534
- }
535
- ]
536
- }
528
+ symbol: this.getCrossGraphicSymbol(i, "marker")
529
+ // symbol: {
530
+ // type: 'picture-marker',
531
+ // url: junctionTableData.crossId
532
+ // ? '/GisViewerAssets/Images/xhj_1.png'
533
+ // : '/GisViewerAssets/Images/xhj_2.png',
534
+ // width: '18px',
535
+ // height: '28px',
536
+ // yoffset: '9px'
537
+ // } as any,
538
+ // popupTemplate: {
539
+ // title: junctionTableData.name,
540
+ // content: [
541
+ // {
542
+ // type: 'fields',
543
+ // fieldInfos: [
544
+ // {
545
+ // fieldName: 'id',
546
+ // label: '路口编号'
547
+ // },
548
+ // {
549
+ // fieldName: 'crossId',
550
+ // label: '信号机编号'
551
+ // }
552
+ // ]
553
+ // }
554
+ // ]
555
+ // }
537
556
  });
538
557
  t.push(r);
539
558
  }
@@ -543,7 +562,7 @@ class x {
543
562
  * 监听鼠标移动事件,高亮显示鼠标所在路段和路口
544
563
  */
545
564
  monitorMouseMove() {
546
- const e = j.debounce(async (t) => {
565
+ const e = C.debounce(async (t) => {
547
566
  var c;
548
567
  const r = (c = (await this.view.hitTest(t, {
549
568
  include: [this.laneLayer, this.junctionLayer]
@@ -560,15 +579,15 @@ class x {
560
579
  "roadId"
561
580
  )}+${this.hitGraphic.getAttribute("sectionId")}`;
562
581
  if (this.currentSectionCode === n || this.selectedSectionIds.includes(n) || this.sectionLayer.graphics.findIndex(
563
- (u) => u.getAttribute("id") === n
582
+ (h) => h.getAttribute("id") === n
564
583
  ) >= 0)
565
584
  return;
566
585
  this.currentSectionCode = n;
567
586
  const o = this.allLaneGraphics.filter(
568
- (u) => `${u.attributes.roadId}+${u.attributes.sectionId}` === n
587
+ (h) => `${h.attributes.roadId}+${h.attributes.sectionId}` === n
569
588
  ), l = L.union(
570
- o.map((u) => u.geometry)
571
- ), d = this.hitGraphic.getAttribute("fromNode"), h = this.hitGraphic.getAttribute("toNode"), f = this.junctionNames.get(d) || d, p = this.junctionNames.get(h) || h, m = new y({
589
+ o.map((h) => h.geometry)
590
+ ), d = this.hitGraphic.getAttribute("fromNode"), u = this.hitGraphic.getAttribute("toNode"), f = this.junctionNames.get(d) || d, y = this.junctionNames.get(u) || u, p = new g({
572
591
  geometry: l,
573
592
  symbol: {
574
593
  type: "simple-fill",
@@ -584,7 +603,7 @@ class x {
584
603
  id: n,
585
604
  selected: !1,
586
605
  fromNodeName: f,
587
- toNodeName: p,
606
+ toNodeName: y,
588
607
  laneCount: o.length
589
608
  },
590
609
  popupTemplate: {
@@ -610,20 +629,12 @@ class x {
610
629
  ]
611
630
  }
612
631
  });
613
- this.highlightLayer.removeAll(), this.highlightLayer.add(m);
614
- const g = this.view.toMap(t);
615
- this.view.openPopup({
616
- features: [m],
617
- location: g
618
- });
632
+ this.highlightLayer.removeAll(), this.highlightLayer.add(p);
619
633
  } else if (s.layer.id === "OpenDriveJunction") {
620
634
  const n = this.hitGraphic.getAttribute("id");
621
635
  if (n === this.currentJunctionId)
622
636
  return;
623
- this.currentJunctionId = n, this.view.openPopup({
624
- features: [this.hitGraphic],
625
- location: this.hitGraphic.geometry
626
- });
637
+ this.currentJunctionId = n;
627
638
  }
628
639
  });
629
640
  this.mouseMoveHandler = this.view.on("pointer-move", async (t) => {
@@ -635,7 +646,7 @@ class x {
635
646
  * 监听鼠标点击事件,获取高亮要素的拓扑信息
636
647
  */
637
648
  monitorMouseClick() {
638
- const e = j.debounce(async (t) => {
649
+ const e = C.debounce(async (t) => {
639
650
  var a;
640
651
  const r = (a = (await this.view.hitTest(t, {
641
652
  include: [this.highlightLayer, this.junctionLayer, this.sectionLayer]
@@ -657,16 +668,21 @@ class x {
657
668
  type: "OpenDriveJunction",
658
669
  id: n,
659
670
  details: l.data.result
660
- }), s.setAttribute("selected", !0), s.symbol.url = "/GisViewerAssets/Images/point_red.png", this.increasePictureMarkerSize(s, 50));
661
- } else {
671
+ }), s.setAttribute("selected", !0), s.symbol = {
672
+ type: "picture-marker",
673
+ url: "/GisViewerAssets/Images/point_red.png",
674
+ width: "20px",
675
+ height: "20px"
676
+ }, this.increasePictureMarkerSize(s, 50));
677
+ } else
662
678
  this.openDriveClickCallback && this.openDriveClickCallback({
663
679
  type: "OpenDriveJunction",
664
680
  id: n,
665
681
  details: void 0
666
- }), s.setAttribute("selected", !1);
667
- const o = s.getAttribute("crossId");
668
- s.symbol.url = o ? "/GisViewerAssets/Images/point_green.png" : "/GisViewerAssets/Images/point_yellow.png", this.decreasePictureMarkerSize(s, 30);
669
- }
682
+ }), s.setAttribute("selected", !1), s.symbol = this.getCrossGraphicSymbol(
683
+ s.attributes,
684
+ this.view.scale < this.junctionScale ? "picture" : "marker"
685
+ );
670
686
  else if (c === "OpenDriveSection")
671
687
  if (s.layer.id === "OpenDriveHighlight") {
672
688
  this.highlightLayer.remove(s), this.sectionLayer.add(s), s.setAttribute("selected", !0), this.selectedSectionIds.push(n);
@@ -807,15 +823,15 @@ class x {
807
823
  if (!i)
808
824
  return { status: -1, message: "未找到。请检查路口编号" };
809
825
  if (t) {
810
- const r = new y({
826
+ const r = new g({
811
827
  geometry: i.geometry,
812
828
  symbol: {
813
829
  type: "simple-marker",
814
830
  style: "circle",
815
831
  size: 30,
816
- color: [0, 0, 255, 0.6],
832
+ color: [0, 255, 255, 0.8],
817
833
  outline: {
818
- color: "blue",
834
+ color: [0, 255, 255],
819
835
  width: 1
820
836
  }
821
837
  }
@@ -863,7 +879,7 @@ class x {
863
879
  (a) => a.geometry
864
880
  ), n = L.union(c);
865
881
  if (e.flash) {
866
- const a = new y({
882
+ const a = new g({
867
883
  geometry: n,
868
884
  symbol: {
869
885
  type: "simple-fill",
@@ -896,11 +912,10 @@ class x {
896
912
  */
897
913
  unselectSumo(e) {
898
914
  if ((!e || e.type === "junction") && this.junctionLayer.graphics.forEach((t) => {
899
- if ((!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected")) {
900
- t.setAttribute("selected", !1);
901
- const i = t.getAttribute("crossId");
902
- t.symbol.url = i ? "/GisViewerAssets/Images/point_green.png" : "/GisViewerAssets/Images/point_yellow.png", this.decreasePictureMarkerSize(t, 30);
903
- }
915
+ (!e || !e.id || e.id === "" || e.id === t.getAttribute("id")) && t.getAttribute("selected") && (t.setAttribute("selected", !1), t.symbol = this.getCrossGraphicSymbol(
916
+ t.attributes,
917
+ this.view.scale < this.junctionScale ? "picture" : "marker"
918
+ ));
904
919
  }), !e || e.type === "edge") {
905
920
  let t;
906
921
  !e || !e.id || e.id === "" ? t = this.sectionLayer.graphics.toArray() : t = this.sectionLayer.graphics.filter((i) => i.getAttribute("edgeId") === e.id).toArray(), t.length > 0 && (t.forEach((i) => {
@@ -943,7 +958,7 @@ class x {
943
958
  let o = c.get(a);
944
959
  o ? o.push(n.geometry) : (o = [n.geometry], c.set(a, o));
945
960
  }), c.forEach((n, a) => {
946
- const o = L.union(n), l = new y({
961
+ const o = L.union(n), l = new g({
947
962
  geometry: o,
948
963
  symbol: {
949
964
  type: "simple-fill",
@@ -984,7 +999,7 @@ class x {
984
999
  type: "edge",
985
1000
  id: d
986
1001
  });
987
- const h = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, f = await b.get(h, {
1002
+ const u = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, f = await b.get(u, {
988
1003
  params: {
989
1004
  id: `${o}+${a.getAttribute("sectionId")}`,
990
1005
  projectName: this.projectName
@@ -1027,25 +1042,25 @@ class x {
1027
1042
  const r = Number(i[1]), s = i[0].split("#"), c = s.length === 2 ? Number(s[1]) : 0;
1028
1043
  let n = s[0];
1029
1044
  n.startsWith("-") && (n = n.slice(1));
1030
- const a = this.allLaneGraphics.filter((v) => v.getAttribute("roadId") === n && v.getAttribute("sectionIndex") === c);
1045
+ const a = this.allLaneGraphics.filter((w) => w.getAttribute("roadId") === n && w.getAttribute("sectionIndex") === c);
1031
1046
  if (a.length === 0)
1032
1047
  return { status: -1, message: "未找到路段" };
1033
1048
  const o = a.length - r, l = a.find(
1034
- (v) => Math.abs(v.getAttribute("laneId")) === o
1049
+ (w) => Math.abs(w.getAttribute("laneId")) === o
1035
1050
  );
1036
1051
  if (!l)
1037
1052
  return { status: -1, message: "未找到车道" };
1038
- const d = e.start || 0, h = e.end || 100, f = G.lineString(l.getAttribute("leftLine")), p = C(f, d, h, {
1053
+ const d = e.start || 0, u = e.end || 100, f = D.lineString(l.getAttribute("leftLine")), y = G(f, d, u, {
1039
1054
  units: "meters"
1040
- }), m = G.lineString(l.getAttribute("rightLine")), g = C(m, d, h, {
1055
+ }), p = D.lineString(l.getAttribute("rightLine")), h = G(p, d, u, {
1041
1056
  units: "meters"
1042
- }), u = p.geometry.coordinates.concat(
1043
- g.geometry.coordinates.reverse()
1057
+ }), m = y.geometry.coordinates.concat(
1058
+ h.geometry.coordinates.reverse()
1044
1059
  );
1045
- u.push(u[u.length - 1]);
1046
- const w = new y({
1060
+ m.push(m[m.length - 1]);
1061
+ const v = new g({
1047
1062
  geometry: new N({
1048
- rings: [u]
1063
+ rings: [m]
1049
1064
  }),
1050
1065
  attributes: {
1051
1066
  ObjectID: l.getAttribute("ObjectID"),
@@ -1059,8 +1074,8 @@ class x {
1059
1074
  laneId: l.getAttribute("laneId"),
1060
1075
  type: l.getAttribute("type"),
1061
1076
  sumoId: l.getAttribute("sumoId"),
1062
- leftLine: p.geometry.coordinates,
1063
- rightLine: g.geometry.coordinates
1077
+ leftLine: y.geometry.coordinates,
1078
+ rightLine: h.geometry.coordinates
1064
1079
  },
1065
1080
  symbol: {
1066
1081
  type: "simple-fill",
@@ -1070,12 +1085,123 @@ class x {
1070
1085
  }
1071
1086
  }
1072
1087
  });
1073
- return this.splitLaneLayer.add(w), this.view.goTo(w), { status: 0, message: "ok", result: e };
1088
+ return this.splitLaneLayer.add(v), this.view.goTo(v), { status: 0, message: "ok", result: e };
1074
1089
  }
1075
1090
  clearSplitLane() {
1076
1091
  this.splitLaneLayer.removeAll();
1077
1092
  }
1093
+ /**
1094
+ * 生成路口点符号。在不同比例尺下,使用不同的符号
1095
+ * @param attributes
1096
+ * @param symbolType
1097
+ * @returns
1098
+ */
1099
+ getCrossGraphicSymbol(e, t) {
1100
+ const i = e.crossId !== "" && e.crossId !== void 0 && e.crossId !== null;
1101
+ if (t === "marker")
1102
+ return {
1103
+ type: "picture-marker",
1104
+ url: `/GisViewerAssets/Images/xhj_${i ? 4 : 2}.png`,
1105
+ width: "18px",
1106
+ height: "28px",
1107
+ yOffset: "12px"
1108
+ };
1109
+ if (t === "picture")
1110
+ return i ? {
1111
+ type: "cim",
1112
+ data: {
1113
+ type: "CIMSymbolReference",
1114
+ primitiveOverrides: [
1115
+ {
1116
+ // 将textGraphic的TextString替换为graphic.attributes.name
1117
+ type: "CIMPrimitiveOverride",
1118
+ primitiveName: "textGraphic",
1119
+ propertyName: "TextString",
1120
+ valueExpressionInfo: {
1121
+ type: "CIMExpressionInfo",
1122
+ title: "Custom",
1123
+ expression: 'Replace($feature.name, "与", "/") + " " + $feature.crossId',
1124
+ returnType: "Default"
1125
+ }
1126
+ }
1127
+ ],
1128
+ symbol: {
1129
+ type: "CIMPointSymbol",
1130
+ symbolLayers: [
1131
+ // 路口名称
1132
+ {
1133
+ type: "CIMVectorMarker",
1134
+ size: 32,
1135
+ colorLocked: !0,
1136
+ anchorPointUnits: "Relative",
1137
+ frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
1138
+ markerGraphics: [
1139
+ {
1140
+ type: "CIMMarkerGraphic",
1141
+ primitiveName: "textGraphic",
1142
+ geometry: { x: 0, y: 0 },
1143
+ symbol: {
1144
+ type: "CIMTextSymbol",
1145
+ height: 12,
1146
+ horizontalAlignment: "Center",
1147
+ offsetX: 0,
1148
+ offsetY: i ? 50 : 40,
1149
+ haloSize: 2,
1150
+ haloSymbol: {
1151
+ type: "CIMPolygonSymbol",
1152
+ symbolLayers: [
1153
+ {
1154
+ type: "CIMSolidFill",
1155
+ enable: !0,
1156
+ color: [255, 255, 255, 255]
1157
+ }
1158
+ ]
1159
+ },
1160
+ symbol: {
1161
+ type: "CIMPolygonSymbol",
1162
+ symbolLayers: [
1163
+ {
1164
+ type: "CIMSolidFill",
1165
+ enable: !0,
1166
+ color: [0, 0, 0, 255]
1167
+ }
1168
+ ]
1169
+ },
1170
+ verticalAlignment: "Center"
1171
+ },
1172
+ textString: ""
1173
+ }
1174
+ ],
1175
+ scaleSymbolsProportionally: !0,
1176
+ respectFrame: !0
1177
+ },
1178
+ // 路口图标
1179
+ {
1180
+ type: "CIMPictureMarker",
1181
+ enable: !0,
1182
+ anchorPoint: {
1183
+ x: 0,
1184
+ y: 0
1185
+ },
1186
+ anchorPointUnits: "Relative",
1187
+ size: 45,
1188
+ rotateClockwise: !0,
1189
+ textureFilter: "Picture",
1190
+ url: "/GisViewerAssets/Images/xhj_4.png",
1191
+ offsetY: i ? 22 : 15
1192
+ }
1193
+ ]
1194
+ }
1195
+ }
1196
+ } : {
1197
+ type: "picture-marker",
1198
+ url: "/GisViewerAssets/Images/xhj_2.png",
1199
+ width: "27px",
1200
+ height: "42px",
1201
+ yOffset: "22px"
1202
+ };
1203
+ }
1078
1204
  }
1079
1205
  export {
1080
- x as default
1206
+ M as default
1081
1207
  };