gisviewer-vue3-arcgis 1.0.250 → 1.0.252

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 (33) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +4 -1
  2. package/es/src/gis-map/gis-map.vue.mjs +155 -153
  3. package/es/src/gis-map/index.d.ts +2 -0
  4. package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
  5. package/es/src/gis-map/utils/dbscan-cluster/index.mjs +256 -0
  6. package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
  7. package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +143 -127
  8. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +87 -86
  9. package/es/src/gis-map/utils/overlay.d.ts +3 -8
  10. package/es/src/gis-map/utils/overlay.mjs +48 -52
  11. package/es/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
  12. package/es/src/gis-map/utils/signal-control-area/district-renderer.mjs +6 -2
  13. package/es/src/gis-map/utils/signal-control-area/show-area.mjs +15 -15
  14. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
  15. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +6 -2
  16. package/es/src/types/index.d.ts +33 -3
  17. package/lib/src/gis-map/gis-map.vue.d.ts +4 -1
  18. package/lib/src/gis-map/gis-map.vue.js +1 -1
  19. package/lib/src/gis-map/index.d.ts +2 -0
  20. package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
  21. package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -0
  22. package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
  23. package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -1
  24. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  25. package/lib/src/gis-map/utils/overlay.d.ts +3 -8
  26. package/lib/src/gis-map/utils/overlay.js +1 -1
  27. package/lib/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
  28. package/lib/src/gis-map/utils/signal-control-area/district-renderer.js +1 -1
  29. package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
  30. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
  31. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
  32. package/lib/src/types/index.d.ts +33 -3
  33. package/package.json +1 -1
@@ -308,11 +308,11 @@ class O {
308
308
  var t;
309
309
  try {
310
310
  const o = await (await fetch(e)).text();
311
- let r = (t = new F({
311
+ let n = (t = new F({
312
312
  ignoreAttributes: !1,
313
313
  allowBooleanAttributes: !0
314
314
  }).parse(o).OpenDRIVE.userData) == null ? void 0 : t.border;
315
- return r ? r = JSON.parse(r) : r = [], { status: 0, message: "ok", result: { md5: J(o), border: r } };
315
+ return n ? n = JSON.parse(n) : n = [], { status: 0, message: "ok", result: { md5: J(o), border: n } };
316
316
  } catch (s) {
317
317
  return { status: -1, message: s.message };
318
318
  }
@@ -359,7 +359,7 @@ class O {
359
359
  );
360
360
  let c = o.data.result.json;
361
361
  c.startsWith(window.location.protocol) || (c = `${window.location.protocol}//${e.server}${c}`);
362
- const a = await (await fetch(c)).arrayBuffer(), n = G.inflate(a, { to: "string" }), l = JSON.parse(n);
362
+ const a = await (await fetch(c)).arrayBuffer(), r = G.inflate(a, { to: "string" }), l = JSON.parse(r);
363
363
  if (await this.showAllLanes(
364
364
  l,
365
365
  ((y = e.options) == null ? void 0 : y.showJunctionLane) || !1,
@@ -397,8 +397,8 @@ class O {
397
397
  throw new Error(`OpenDriveRenderer: ${o.statusText}`);
398
398
  let i = o.data.result.json;
399
399
  i.startsWith(window.location.protocol) || (i = `${window.location.protocol}//${e}${i}`);
400
- const r = await (await fetch(i)).arrayBuffer(), a = G.inflate(r, { to: "string" }), n = JSON.parse(a);
401
- return await this.showAllLanes(n, !1, !1), { status: 0, message: "ok" };
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" };
402
402
  }
403
403
  /**
404
404
  * 显示所有车道
@@ -408,18 +408,19 @@ class O {
408
408
  * @returns
409
409
  */
410
410
  async showAllLanes(e, t, s) {
411
+ console.log(e);
411
412
  const o = await this.laneLayer.queryFeatures();
412
413
  return o.features.length > 0 && this.laneLayer.applyEdits({
413
414
  deleteFeatures: o.features
414
415
  }), this.roadNameLayer.visible = s, new Promise((i) => {
415
416
  let c = 0;
416
417
  this.allLaneGraphics = [], this.allRefLineGraphics = [];
417
- const r = [];
418
- for (const n of e) {
419
- if (!t && n.junction !== "-1")
418
+ const n = [];
419
+ for (const r of e) {
420
+ if (!t && r.junction !== "-1")
420
421
  continue;
421
- const { id: l, refLine: h } = n;
422
- let p = n.name;
422
+ const { id: l, refLine: h } = r;
423
+ let p = r.name;
423
424
  p.includes("(") && (p = p.slice(0, p.indexOf("("))), p = p.replace(/(.)/g, "$1 ");
424
425
  const y = new g({
425
426
  geometry: {
@@ -432,9 +433,9 @@ class O {
432
433
  roadName: p
433
434
  }
434
435
  });
435
- this.allRefLineGraphics.push(y), n.laneSections.sort((m, f) => Number(m.id) - Number(f.id));
436
- for (let m = 0; m < n.laneSections.length; m++) {
437
- const f = n.laneSections[m], d = Number(f.id);
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);
438
439
  for (const u of f.lanePaths) {
439
440
  const v = Number(u.id);
440
441
  if (v === 0)
@@ -456,10 +457,10 @@ class O {
456
457
  attributes: {
457
458
  ObjectID: c++,
458
459
  id: `${l}+${d}+${v}`,
459
- fromNode: n.fromNode,
460
- toNode: n.toNode,
460
+ fromNode: r.fromNode,
461
+ toNode: r.toNode,
461
462
  roadId: String(l),
462
- roadName: n.name,
463
+ roadName: r.name,
463
464
  sectionId: String(d),
464
465
  sectionIndex: m,
465
466
  laneId: v,
@@ -470,23 +471,23 @@ class O {
470
471
  rightLine: u.outerPath
471
472
  }
472
473
  });
473
- this.allLaneGraphics.push(j), r.push(j);
474
+ this.allLaneGraphics.push(j), n.push(j);
474
475
  }
475
476
  }
476
477
  }
477
478
  }
478
479
  const a = setInterval(() => {
479
- if (r.length > 0 || this.allRefLineGraphics.length > 0) {
480
- if (r.length > 0) {
481
- const n = r.splice(0, 100);
480
+ if (n.length > 0 || this.allRefLineGraphics.length > 0) {
481
+ if (n.length > 0) {
482
+ const r = n.splice(0, 100);
482
483
  this.laneLayer.applyEdits({
483
- addFeatures: n
484
+ addFeatures: r
484
485
  });
485
486
  }
486
487
  if (this.allRefLineGraphics.length > 0) {
487
- const n = this.allRefLineGraphics.splice(0, 10);
488
+ const r = this.allRefLineGraphics.splice(0, 10);
488
489
  this.roadNameLayer.applyEdits({
489
- addFeatures: n
490
+ addFeatures: r
490
491
  });
491
492
  }
492
493
  } else
@@ -513,7 +514,7 @@ class O {
513
514
  });
514
515
  let c = !0;
515
516
  if (s && (c = L.contains(s, i)), c) {
516
- const r = new g({
517
+ const n = new g({
517
518
  geometry: i,
518
519
  attributes: {
519
520
  ...o,
@@ -522,7 +523,7 @@ class O {
522
523
  },
523
524
  symbol: this.getCrossGraphicSymbol(o, "marker")
524
525
  });
525
- t.push(r);
526
+ t.push(n);
526
527
  }
527
528
  }
528
529
  this.junctionLayer.addMany(t);
@@ -536,7 +537,7 @@ class O {
536
537
  const o = (c = (await this.view.hitTest(t, {
537
538
  include: [this.laneLayer, this.junctionLayer]
538
539
  })).results) == null ? void 0 : c.filter(
539
- (r) => r.type === "graphic"
540
+ (n) => n.type === "graphic"
540
541
  );
541
542
  if (o.length === 0) {
542
543
  this.currentSectionCode !== "" && (this.currentSectionCode = "", this.highlightLayer.removeAll()), this.currentJunctionId !== "" && (this.currentJunctionId = ""), this.view.closePopup();
@@ -544,18 +545,18 @@ class O {
544
545
  }
545
546
  const i = o[0];
546
547
  if (this.hitGraphic = i.graphic, i.layer.id === "OpenDriveLane") {
547
- const r = `${this.hitGraphic.getAttribute(
548
+ const n = `${this.hitGraphic.getAttribute(
548
549
  "roadId"
549
550
  )}+${this.hitGraphic.getAttribute("sectionId")}`;
550
- if (this.currentSectionCode === r || this.selectedSectionIds.includes(r) || this.sectionLayer.graphics.findIndex(
551
- (d) => d.getAttribute("id") === r
551
+ if (this.currentSectionCode === n || this.selectedSectionIds.includes(n) || this.sectionLayer.graphics.findIndex(
552
+ (d) => d.getAttribute("id") === n
552
553
  ) >= 0)
553
554
  return;
554
- this.currentSectionCode = r;
555
- const n = this.allLaneGraphics.filter(
556
- (d) => `${d.attributes.roadId}+${d.attributes.sectionId}` === r
555
+ this.currentSectionCode = n;
556
+ const r = this.allLaneGraphics.filter(
557
+ (d) => `${d.attributes.roadId}+${d.attributes.sectionId}` === n
557
558
  ), l = L.union(
558
- n.map((d) => d.geometry)
559
+ r.map((d) => d.geometry)
559
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({
560
561
  geometry: l,
561
562
  symbol: {
@@ -569,11 +570,11 @@ class O {
569
570
  },
570
571
  attributes: {
571
572
  type: "OpenDriveSection",
572
- id: r,
573
+ id: n,
573
574
  selected: !1,
574
575
  fromNodeName: y,
575
576
  toNodeName: m,
576
- laneCount: n.length
577
+ laneCount: r.length
577
578
  },
578
579
  popupTemplate: {
579
580
  title: this.hitGraphic.getAttribute("roadName"),
@@ -600,10 +601,10 @@ class O {
600
601
  });
601
602
  this.highlightLayer.removeAll(), this.highlightLayer.add(f);
602
603
  } else if (i.layer.id === "OpenDriveJunction") {
603
- const r = this.hitGraphic.getAttribute("id");
604
- if (r === this.currentJunctionId)
604
+ const n = this.hitGraphic.getAttribute("id");
605
+ if (n === this.currentJunctionId)
605
606
  return;
606
- this.currentJunctionId = r;
607
+ this.currentJunctionId = n;
607
608
  }
608
609
  });
609
610
  this.mouseMoveHandler = this.view.on("pointer-move", async (t) => {
@@ -620,22 +621,22 @@ class O {
620
621
  const o = (a = (await this.view.hitTest(t, {
621
622
  include: [this.highlightLayer, this.junctionLayer, this.sectionLayer]
622
623
  })).results) == null ? void 0 : a.filter(
623
- (n) => n.type === "graphic"
624
+ (r) => r.type === "graphic"
624
625
  );
625
626
  if (o.length === 0)
626
627
  return;
627
- const i = o[0].graphic, c = i.getAttribute("type"), r = i.getAttribute("id");
628
+ const i = o[0].graphic, c = i.getAttribute("type"), n = i.getAttribute("id");
628
629
  if (c === "OpenDriveJunction")
629
630
  if (i.getAttribute("selected") === !1) {
630
- const n = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, l = await b.get(n, {
631
+ const r = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, l = await b.get(r, {
631
632
  params: {
632
- id: r,
633
+ id: n,
633
634
  projectName: this.projectName
634
635
  }
635
636
  });
636
637
  l.status === 200 && l.data.status === 0 && (this.openDriveClickCallback && this.openDriveClickCallback({
637
638
  type: "OpenDriveJunction",
638
- id: r,
639
+ id: n,
639
640
  details: l.data.result
640
641
  }), i.setAttribute("selected", !0), i.symbol = {
641
642
  type: "picture-marker",
@@ -646,7 +647,7 @@ class O {
646
647
  } else
647
648
  this.openDriveClickCallback && this.openDriveClickCallback({
648
649
  type: "OpenDriveJunction",
649
- id: r,
650
+ id: n,
650
651
  details: void 0
651
652
  }), i.setAttribute("selected", !1), i.symbol = this.getCrossGraphicSymbol(
652
653
  i.attributes,
@@ -654,10 +655,10 @@ class O {
654
655
  );
655
656
  else if (c === "OpenDriveSection")
656
657
  if (i.layer.id === "OpenDriveHighlight") {
657
- this.highlightLayer.remove(i), this.sectionLayer.add(i), i.setAttribute("selected", !0), this.selectedSectionIds.push(r);
658
- const n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, l = await b.get(n, {
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, {
659
660
  params: {
660
- id: r,
661
+ id: n,
661
662
  projectName: this.projectName
662
663
  }
663
664
  });
@@ -671,7 +672,7 @@ class O {
671
672
  }
672
673
  } else
673
674
  this.sectionLayer.remove(i), this.selectedSectionIds = this.selectedSectionIds.filter(
674
- (n) => n !== r
675
+ (r) => r !== n
675
676
  ), this.openDriveClickCallback && this.openDriveClickCallback({
676
677
  type: "OpenDriveSection",
677
678
  id: i.getAttribute("edgeId"),
@@ -738,7 +739,7 @@ class O {
738
739
  if (i) {
739
740
  const c = `${s}+${i.getAttribute(
740
741
  "sectionId"
741
- )}`, r = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await b.get(r, {
742
+ )}`, n = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, a = await b.get(n, {
742
743
  params: {
743
744
  id: c,
744
745
  projectName: this.projectName
@@ -780,11 +781,11 @@ class O {
780
781
  const i = s.split("_");
781
782
  if (i.length > 2)
782
783
  return { status: -1, message: "id格式错误" };
783
- const c = i.length === 2 ? Number(i[1]) : void 0, r = i[0].split("#");
784
- if (r.length > 2)
784
+ const c = i.length === 2 ? Number(i[1]) : void 0, n = i[0].split("#");
785
+ if (n.length > 2)
785
786
  return { status: -1, message: "id格式错误" };
786
- const a = r[0], n = r.length === 2 ? Number(r[1]) : void 0;
787
- return await this.findLane({ roadsectId: a, segmentId: n, laneId: c, flash: o });
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 });
788
789
  } else
789
790
  return { status: -1, message: "未知类型" };
790
791
  }
@@ -827,32 +828,32 @@ class O {
827
828
  return { status: -1, message: "未找到。请检查路段编号" };
828
829
  if (s !== void 0) {
829
830
  const a = [];
830
- if (i.forEach((n) => {
831
- const l = Number(n.attributes.sectionId);
831
+ if (i.forEach((r) => {
832
+ const l = Number(r.attributes.sectionId);
832
833
  a.indexOf(l) === -1 && a.push(l);
833
- }), a.sort((n, l) => n - l), s > a.length - 1)
834
+ }), a.sort((r, l) => r - l), s > a.length - 1)
834
835
  return { status: -1, message: "未找到。请检查基本段编号" };
835
836
  s = a[s], i = i.filter(
836
- (n) => Number(n.attributes.sectionId) === s
837
+ (r) => Number(r.attributes.sectionId) === s
837
838
  );
838
839
  }
839
840
  if (o !== void 0) {
840
841
  const a = [];
841
- if (i.forEach((n) => {
842
- const l = Number(n.attributes.laneId);
842
+ if (i.forEach((r) => {
843
+ const l = Number(r.attributes.laneId);
843
844
  a.indexOf(l) === -1 && a.push(l);
844
- }), a.sort((n, l) => n - l), o > a.length - 1)
845
+ }), a.sort((r, l) => r - l), o > a.length - 1)
845
846
  return { status: -1, message: "未找到。请检查车道编号" };
846
847
  o = a[o], i = i.filter(
847
- (n) => Number(n.attributes.laneId) === o
848
+ (r) => Number(r.attributes.laneId) === o
848
849
  );
849
850
  }
850
851
  const c = i.map(
851
852
  (a) => a.geometry
852
- ), r = L.union(c);
853
+ ), n = L.union(c);
853
854
  if (e.flash) {
854
855
  const a = new g({
855
- geometry: r,
856
+ geometry: n,
856
857
  symbol: {
857
858
  type: "simple-fill",
858
859
  color: [0, 255, 255, 0.6],
@@ -864,7 +865,7 @@ class O {
864
865
  });
865
866
  this.flashGraphic(a);
866
867
  }
867
- return await this.view.goTo(r, { duration: 1e3 }), { status: 0, message: "ok" };
868
+ return await this.view.goTo(n, { duration: 1e3 }), { status: 0, message: "ok" };
868
869
  }
869
870
  /**
870
871
  * graphic渐隐渐显闪烁
@@ -924,14 +925,14 @@ class O {
924
925
  (c) => c.getAttribute("roadId") === s && c.getAttribute("sectionIndex") === o
925
926
  )), i.length > 0) {
926
927
  const c = /* @__PURE__ */ new Map();
927
- return i.forEach((r) => {
928
- const a = r.getAttribute("roadId") + "+" + r.getAttribute("sectionId");
928
+ return i.forEach((n) => {
929
+ const a = n.getAttribute("roadId") + "+" + n.getAttribute("sectionId");
929
930
  this.selectedSectionIds.includes(a) || this.selectedSectionIds.push(a);
930
- let n = c.get(a);
931
- n ? n.push(r.geometry) : (n = [r.geometry], c.set(a, n));
932
- }), c.forEach(async (r, a) => {
933
- const n = L.union(r), l = new g({
934
- geometry: n,
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,
935
936
  symbol: {
936
937
  type: "simple-fill",
937
938
  color: [0, 255, 255, 0.5],
@@ -965,7 +966,7 @@ class O {
965
966
  outFields: ["*"]
966
967
  }), o = [], i = [];
967
968
  for (const a of s.features) {
968
- const n = a.getAttribute("roadId"), l = a.getAttribute("sectionIndex"), h = `${n}#${l}`;
969
+ const r = a.getAttribute("roadId"), l = a.getAttribute("sectionIndex"), h = `${r}#${l}`;
969
970
  if (o.indexOf(h) === -1) {
970
971
  o.push(h), this.selectSumo({
971
972
  type: "edge",
@@ -973,7 +974,7 @@ class O {
973
974
  });
974
975
  const p = `http://${this.openDriveServer}/api/sumo/getSumoEdge`, y = await b.get(p, {
975
976
  params: {
976
- id: `${n}+${a.getAttribute("sectionId")}`,
977
+ id: `${r}+${a.getAttribute("sectionId")}`,
977
978
  projectName: this.projectName
978
979
  }
979
980
  });
@@ -981,28 +982,28 @@ class O {
981
982
  }
982
983
  }
983
984
  const c = this.junctionLayer.graphics.filter((a) => {
984
- const n = a.geometry;
985
- return L.contains(t, n);
986
- }), r = [];
985
+ const r = a.geometry;
986
+ return L.contains(t, r);
987
+ }), n = [];
987
988
  for (const a of c) {
988
- const n = a.getAttribute("id");
989
+ const r = a.getAttribute("id");
989
990
  this.selectSumo({
990
991
  type: "junction",
991
- id: n
992
+ id: r
992
993
  });
993
994
  const l = `http://${this.openDriveServer}/api/sumo/getSumoJunction`, h = await b.get(l, {
994
995
  params: {
995
- id: n,
996
+ id: r,
996
997
  projectName: this.projectName
997
998
  }
998
999
  });
999
- h.status === 200 && h.data.status === 0 && r.push(h.data.result);
1000
+ h.status === 200 && h.data.status === 0 && n.push(h.data.result);
1000
1001
  }
1001
1002
  return {
1002
1003
  status: 0,
1003
1004
  message: "ok",
1004
1005
  result: {
1005
- junctions: r,
1006
+ junctions: n,
1006
1007
  edges: i
1007
1008
  }
1008
1009
  };
@@ -1012,13 +1013,13 @@ class O {
1012
1013
  if (s.length !== 2)
1013
1014
  return { status: -1, message: "车道编号格式错误" };
1014
1015
  const o = Number(s[1]), i = s[0].split("#"), c = i.length === 2 ? Number(i[1]) : 0;
1015
- let r = i[0];
1016
- r.startsWith("-") && (r = r.slice(1));
1017
- const a = this.allLaneGraphics.filter((I) => I.getAttribute("roadId") === r && I.getAttribute("sectionIndex") === c);
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);
1018
1019
  if (a.length === 0)
1019
1020
  return { status: -1, message: "未找到路段" };
1020
- const n = a.length - o, l = a.find(
1021
- (I) => Math.abs(I.getAttribute("laneId")) === n
1021
+ const r = a.length - o, l = a.find(
1022
+ (I) => Math.abs(I.getAttribute("laneId")) === r
1022
1023
  );
1023
1024
  if (!l)
1024
1025
  return { status: -1, message: "未找到车道" };
@@ -2,7 +2,7 @@ import Graphic from '@arcgis/core/Graphic';
2
2
  import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
3
3
  import MapView from '@arcgis/core/views/MapView';
4
4
  import SceneView from '@arcgis/core/views/SceneView';
5
- import { IMaskParam, IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
5
+ import { IClusterPointParams, IMaskParam, IOverlayParam, IResult } from '../../types';
6
6
  interface IOverlayOptions {
7
7
  id: string;
8
8
  }
@@ -73,13 +73,8 @@ export default class Overlay {
73
73
  * @memberof Overlay
74
74
  */
75
75
  showLayer(): void;
76
- /**
77
- * 添加点覆盖物
78
- * @param overlay
79
- * @param symbol
80
- * @param properties
81
- */
82
- addPoint(overlay: IOverlay, symbol: IPointSymbol, properties: any, visible?: boolean): IResult;
83
76
  private addOverlay;
77
+ private clusterLayer;
78
+ addClusterPoint(params: IClusterPointParams): void;
84
79
  }
85
80
  export {};
@@ -1,46 +1,47 @@
1
- import { Polygon as d } from "@arcgis/core/geometry";
2
- import * as l from "@arcgis/core/geometry/geometryEngine";
3
- import n from "@arcgis/core/Graphic";
4
- import c from "@arcgis/core/layers/GraphicsLayer";
5
- class u {
6
- constructor(e, s) {
1
+ import { Polygon as n } from "@arcgis/core/geometry";
2
+ import * as y from "@arcgis/core/geometry/geometryEngine";
3
+ import d from "@arcgis/core/Graphic";
4
+ import c from "@arcgis/core/layers/FeatureLayer";
5
+ import v from "@arcgis/core/layers/GraphicsLayer";
6
+ class L {
7
+ constructor(e, t) {
7
8
  this.defaultPointSymbol = {
8
9
  type: "simple-marker",
9
10
  style: "circle",
10
11
  color: "yellow",
11
12
  size: 10
12
- }, this.view = e, this.overlayLayer = new c({
13
- ...s
13
+ }, this.view = e, this.overlayLayer = new v({
14
+ ...t
14
15
  }), this.view.map.layers.add(this.overlayLayer);
15
16
  }
16
17
  addMask(e) {
17
18
  this.removeMask();
18
- const s = e.maskColor || [100, 100, 100, 0.8], i = e.maskSize || 100;
19
- let r = new d({
19
+ const t = e.maskColor || [100, 100, 100, 0.8], i = e.maskSize || 100;
20
+ let r = new n({
20
21
  rings: [e.geometry.rings[0]]
21
22
  });
22
- const t = r.centroid, a = l.geodesicBuffer(
23
- t,
23
+ const s = r.centroid, a = y.geodesicBuffer(
24
+ s,
24
25
  i,
25
26
  "kilometers"
26
27
  );
27
- let o = l.difference(
28
+ let o = y.difference(
28
29
  a,
29
30
  r
30
31
  );
31
32
  if (e.geometry.rings.length > 1)
32
- for (let y = 1; y < e.geometry.rings.length; y++)
33
- r = new d({
34
- rings: [e.geometry.rings[y]]
35
- }), o = l.difference(
33
+ for (let l = 1; l < e.geometry.rings.length; l++)
34
+ r = new n({
35
+ rings: [e.geometry.rings[l]]
36
+ }), o = y.difference(
36
37
  o,
37
38
  r
38
39
  );
39
- const h = new n({
40
+ const h = new d({
40
41
  geometry: o,
41
42
  symbol: {
42
43
  type: "simple-fill",
43
- color: s,
44
+ color: t,
44
45
  outline: {
45
46
  style: "long-dash",
46
47
  color: "white"
@@ -52,7 +53,7 @@ class u {
52
53
  }
53
54
  removeMask() {
54
55
  const e = this.overlayLayer.graphics.find(
55
- (s) => s.getAttribute("type") === "mask"
56
+ (t) => t.getAttribute("type") === "mask"
56
57
  );
57
58
  e && this.overlayLayer.remove(e);
58
59
  }
@@ -61,50 +62,51 @@ class u {
61
62
  * @param params
62
63
  */
63
64
  addOverlays(e) {
64
- let s = 0, i = 0;
65
+ let t = 0, i = 0;
66
+ e.defaultVisible == null && (e.defaultVisible = !0);
65
67
  for (const r of e.overlays) {
66
68
  r.properties ? (r.properties.type || (r.properties.type = e.type), r.properties.id || (r.properties.id = r.id)) : r.properties = { type: e.type, id: r.id };
67
- const t = r.symbol || e.defaultSymbol || this.defaultPointSymbol;
69
+ const s = r.symbol || e.defaultSymbol || this.defaultPointSymbol, a = r.visible == null ? e.defaultVisible : r.visible;
68
70
  this.addOverlay(
69
71
  r,
70
- t,
72
+ s,
71
73
  r.properties,
72
- r.visible
73
- ).message === "add" ? s++ : i++;
74
+ a
75
+ ).message === "add" ? t++ : i++;
74
76
  }
75
- return { status: 0, message: `新增${s}, 更新${i}` };
77
+ return { status: 0, message: `新增${t}, 更新${i}` };
76
78
  }
77
79
  /**
78
80
  * 按type移除覆盖物
79
81
  * @param types
80
82
  */
81
83
  removeOverlaysByType(e) {
82
- const s = this.overlayLayer.graphics.filter((i) => {
84
+ const t = this.overlayLayer.graphics.filter((i) => {
83
85
  const r = i.getAttribute("type");
84
86
  return e.includes(r);
85
87
  });
86
- return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
88
+ return this.overlayLayer.graphics.removeMany(t), { status: 0, message: `删除${t.length}` };
87
89
  }
88
90
  /**
89
91
  * 按id移除覆盖物
90
92
  * @param ids
91
93
  */
92
94
  removeOverlaysById(e) {
93
- const s = this.overlayLayer.graphics.filter((i) => {
95
+ const t = this.overlayLayer.graphics.filter((i) => {
94
96
  const r = i.getAttribute("id");
95
97
  return e.includes(r);
96
98
  });
97
- return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
99
+ return this.overlayLayer.graphics.removeMany(t), { status: 0, message: `删除${t.length}` };
98
100
  }
99
101
  /**
100
102
  * 按id显示或隐藏覆盖物
101
103
  * @param ids
102
104
  * @param isShow
103
105
  */
104
- isShowOverlaysByIds(e, s) {
106
+ isShowOverlaysByIds(e, t) {
105
107
  this.overlayLayer.graphics.map((i) => {
106
108
  const r = i.getAttribute("id");
107
- e.includes(r) ? i.visible = s : i.visible = !s;
109
+ e.includes(r) ? i.visible = t : i.visible = !t;
108
110
  });
109
111
  }
110
112
  /**
@@ -147,7 +149,7 @@ class u {
147
149
  async findGraphic(e) {
148
150
  var r;
149
151
  return (r = (await this.view.hitTest(e)).results) == null ? void 0 : r.filter(
150
- (t) => t.type === "graphic" && t.graphic.layer === this.overlayLayer
152
+ (s) => s.type === "graphic" && s.graphic.layer === this.overlayLayer
151
153
  );
152
154
  }
153
155
  /**
@@ -166,29 +168,23 @@ class u {
166
168
  showLayer() {
167
169
  this.overlayLayer.visible = !0;
168
170
  }
169
- /**
170
- * 添加点覆盖物
171
- * @param overlay
172
- * @param symbol
173
- * @param properties
174
- */
175
- addPoint(e, s, i, r) {
176
- let t, a = !0;
177
- return e.id && (t = this.overlayLayer.graphics.find(
171
+ addOverlay(e, t, i, r) {
172
+ let s, a = !0;
173
+ return e.id && (s = this.overlayLayer.graphics.find(
178
174
  (o) => o.getAttribute("id") === e.id
179
- )), t ? t.visible = r ?? t.visible : (r = r ?? !0, t = new n({
175
+ )), s ? s.visible = r : (s = new d({
180
176
  visible: r
181
- }), this.overlayLayer.add(t), a = !1), t.geometry = e.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
177
+ }), this.overlayLayer.add(s), a = !1), s.geometry = e.geometry, s.symbol = t, s.attributes = i, { status: 0, message: a ? "add" : "update" };
182
178
  }
183
- addOverlay(e, s, i, r) {
184
- let t, a = !0;
185
- return e.id && (t = this.overlayLayer.graphics.find(
186
- (o) => o.getAttribute("id") === e.id
187
- )), t ? t.visible = r ?? t.visible : (r = r ?? !0, t = new n({
188
- visible: r
189
- }), this.overlayLayer.add(t), a = !1), t.geometry = e.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
179
+ addClusterPoint(e) {
180
+ this.clusterLayer || (this.clusterLayer = new c({
181
+ id: "clusterPointLayer",
182
+ source: [],
183
+ outFields: ["*"],
184
+ geometryType: "point"
185
+ }), this.view.map.add(this.clusterLayer));
190
186
  }
191
187
  }
192
188
  export {
193
- u as default
189
+ L as default
194
190
  };
@@ -1,4 +1,4 @@
1
- import { IResult } from '../../../types';
1
+ import { IFindSignalControlAreaParams, IResult } from '../../../types';
2
2
  import DistrictController from './district-controller';
3
3
  export default class DistrictRenderer {
4
4
  private view;
@@ -33,7 +33,7 @@ export default class DistrictRenderer {
33
33
  * @param id 区控ID
34
34
  * @return 返回高亮区控的数量
35
35
  */
36
- highlightDistrict(id: string): Promise<number>;
36
+ highlightDistrict(params: IFindSignalControlAreaParams): Promise<number>;
37
37
  filter(id: string): void;
38
38
  resetFilter(): void;
39
39
  }