gisviewer-vue3-arcgis 1.0.209 → 1.0.210

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,17 +1,17 @@
1
- import u from "@arcgis/core/Graphic";
2
- import o from "@arcgis/core/layers/FeatureLayer";
3
- import y from "@turf/buffer";
4
- import c from "@turf/convex";
1
+ import y from "@arcgis/core/Graphic";
2
+ import l from "@arcgis/core/layers/FeatureLayer";
3
+ import c from "@turf/buffer";
4
+ import p from "@turf/convex";
5
5
  import * as n from "@turf/helpers";
6
- import p from "concaveman";
7
- import h from "../../stores/index.mjs";
8
- import m from "./district-controller.mjs";
9
- class x {
6
+ import h from "concaveman";
7
+ import m from "../../stores/index.mjs";
8
+ import g from "./district-controller.mjs";
9
+ class S {
10
10
  constructor(e) {
11
- var i;
11
+ var t;
12
12
  this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0, this.districtGraphics = [], this.subDistrictGraphics = [], this.signalGraphics = [], this.view = e, this.hasGpu = localStorage.getItem("gpu") !== "Unknown";
13
- const t = h.useAppDataStore.mapConfig;
14
- this.openDriveServer = (i = t.openDriveServer) == null ? void 0 : i.url, this.districtControllerDashLayer = new o({
13
+ const s = m.useAppDataStore.mapConfig;
14
+ this.openDriveServer = (t = s.openDriveServer) == null ? void 0 : t.url, this.districtControllerDashLayer = new l({
15
15
  id: "districtController",
16
16
  spatialReference: e.spatialReference,
17
17
  source: [],
@@ -49,7 +49,7 @@ class x {
49
49
  width: 3
50
50
  }
51
51
  }
52
- }), this.districtControllerSolidLayer = new o({
52
+ }), this.districtControllerSolidLayer = new l({
53
53
  id: "districtController",
54
54
  spatialReference: e.spatialReference,
55
55
  source: [],
@@ -109,7 +109,7 @@ class x {
109
109
  width: 3
110
110
  }
111
111
  }
112
- }), this.subDistrictControllerLayer = new o({
112
+ }), this.subDistrictControllerLayer = new l({
113
113
  id: "subDistrictController",
114
114
  spatialReference: e.spatialReference,
115
115
  source: [],
@@ -140,6 +140,10 @@ class x {
140
140
  {
141
141
  name: "signalCount",
142
142
  type: "integer"
143
+ },
144
+ {
145
+ name: "style",
146
+ type: "string"
143
147
  }
144
148
  ],
145
149
  popupTemplate: {
@@ -165,15 +169,27 @@ class x {
165
169
  ]
166
170
  },
167
171
  renderer: {
168
- type: "simple",
169
- symbol: {
172
+ type: "unique-value",
173
+ field: "style",
174
+ defaultSymbol: {
170
175
  type: "simple-line",
171
176
  style: "solid",
172
177
  color: [5, 196, 104],
173
178
  width: 3
174
- }
179
+ },
180
+ uniqueValueInfos: [
181
+ {
182
+ value: "alert",
183
+ symbol: {
184
+ type: "simple-line",
185
+ style: "solid",
186
+ color: [255, 0, 0],
187
+ width: 3
188
+ }
189
+ }
190
+ ]
175
191
  }
176
- }), this.signalMarkerLayer = new o({
192
+ }), this.signalMarkerLayer = new l({
177
193
  id: "signalLayer",
178
194
  spatialReference: e.spatialReference,
179
195
  source: [],
@@ -291,7 +307,7 @@ class x {
291
307
  }
292
308
  ]
293
309
  }
294
- }), this.signalPictureLayer = new o({
310
+ }), this.signalPictureLayer = new l({
295
311
  id: "signalLayer",
296
312
  spatialReference: e.spatialReference,
297
313
  source: [],
@@ -576,12 +592,12 @@ class x {
576
592
  */
577
593
  async showSignalControlArea(e) {
578
594
  await this.clearSignalControlArea(), this.districtControllerDashLayer.visible = !0, this.districtControllerSolidLayer.visible = !0, this.subDistrictControllerLayer.visible = !1, this.signalMarkerLayer.visible = !1, this.signalPictureLayer.visible = !1;
579
- for (const s of e.areaList) {
580
- const t = new m(
581
- s,
595
+ for (const i of e.areaList) {
596
+ const s = new g(
597
+ i,
582
598
  e.style || ""
583
599
  );
584
- this.generateGraphic(t, !0);
600
+ this.generateGraphic(s, !0, e.style);
585
601
  }
586
602
  return await this.districtControllerDashLayer.applyEdits({
587
603
  addFeatures: this.districtGraphics
@@ -641,30 +657,30 @@ class x {
641
657
  async locateSignalControlArea(e) {
642
658
  switch (e.type) {
643
659
  case "district": {
644
- const i = this.districtControllerDashLayer.createQuery();
645
- i.where = `id = '${e.id}'`, i.returnGeometry = !0, i.outFields = ["*"];
646
- const a = await this.districtControllerDashLayer.queryFeatures(
647
- i
660
+ const t = this.districtControllerDashLayer.createQuery();
661
+ t.where = `id = '${e.id}'`, t.returnGeometry = !0, t.outFields = ["*"];
662
+ const r = await this.districtControllerDashLayer.queryFeatures(
663
+ t
648
664
  );
649
- return a.features.length > 0 ? (await this.view.goTo(a.features, {
665
+ return r.features.length > 0 ? (await this.view.goTo(r.features, {
650
666
  duration: this.hasGpu ? 1e3 : 0
651
667
  }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
652
668
  }
653
669
  case "subDistrict":
654
- const s = this.subDistrictControllerLayer.createQuery();
655
- s.where = `id = '${e.id}'`, s.returnGeometry = !0, s.outFields = ["*"];
656
- const t = await this.subDistrictControllerLayer.queryFeatures(
657
- s
670
+ const i = this.subDistrictControllerLayer.createQuery();
671
+ i.where = `id = '${e.id}'`, i.returnGeometry = !0, i.outFields = ["*"];
672
+ const s = await this.subDistrictControllerLayer.queryFeatures(
673
+ i
658
674
  );
659
- return t.features.length > 0 ? (await this.view.goTo(t.features, {
675
+ return s.features.length > 0 ? (await this.view.goTo(s.features, {
660
676
  duration: this.hasGpu ? 1e3 : 0
661
677
  }), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
662
678
  case "signal": {
663
- const i = this.signalMarkerLayer.createQuery();
664
- i.where = `id = '${e.id}'`, i.returnGeometry = !0, i.outFields = ["*"];
665
- const a = await this.signalMarkerLayer.queryFeatures(i);
666
- return a.features.length > 0 ? (await this.view.goTo(
667
- { target: a.features[0], scale: 2500 },
679
+ const t = this.signalMarkerLayer.createQuery();
680
+ t.where = `id = '${e.id}'`, t.returnGeometry = !0, t.outFields = ["*"];
681
+ const r = await this.signalMarkerLayer.queryFeatures(t);
682
+ return r.features.length > 0 ? (await this.view.goTo(
683
+ { target: r.features[0], scale: 2500 },
668
684
  {
669
685
  duration: this.hasGpu ? 1e3 : 0
670
686
  }
@@ -682,41 +698,41 @@ class x {
682
698
  async highlightSignalControlArea(e) {
683
699
  switch (e.type) {
684
700
  case "district": {
685
- const s = this.districtControllerDashLayer.definitionExpression;
701
+ const i = this.districtControllerDashLayer.definitionExpression;
686
702
  this.districtControllerDashLayer.definitionExpression = `id = '${e.id}'`;
687
- const t = await this.districtControllerDashLayer.queryFeatures();
688
- return t.features.length > 0 ? (this.districtControllerSolidLayer.definitionExpression = `id = '${e.id}'`, this.subDistrictControllerLayer.definitionExpression = `parentId = '${e.id}'`, this.signalMarkerLayer.definitionExpression = `districtId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `districtId = '${e.id}'`, await this.view.goTo(t.features, {
703
+ const s = await this.districtControllerDashLayer.queryFeatures();
704
+ return s.features.length > 0 ? (this.districtControllerSolidLayer.definitionExpression = `id = '${e.id}'`, this.subDistrictControllerLayer.definitionExpression = `parentId = '${e.id}'`, this.signalMarkerLayer.definitionExpression = `districtId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `districtId = '${e.id}'`, await this.view.goTo(s.features, {
689
705
  duration: this.hasGpu ? 1e3 : 0
690
- }), { status: 0, message: "ok" }) : (this.districtControllerDashLayer.definitionExpression = s, { status: 1, message: "未找到区控" });
706
+ }), { status: 0, message: "ok" }) : (this.districtControllerDashLayer.definitionExpression = i, { status: 1, message: "未找到区控" });
691
707
  }
692
708
  case "subDistrict": {
693
- const s = this.subDistrictControllerLayer.definitionExpression;
709
+ const i = this.subDistrictControllerLayer.definitionExpression;
694
710
  this.subDistrictControllerLayer.definitionExpression = `id = '${e.id}'`;
695
- const t = await this.subDistrictControllerLayer.queryFeatures();
696
- if (t.features.length > 0) {
711
+ const s = await this.subDistrictControllerLayer.queryFeatures();
712
+ if (s.features.length > 0) {
697
713
  this.signalMarkerLayer.definitionExpression = `subDistrictId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `subDistrictId = '${e.id}'`;
698
- const a = t.features[0].attributes.parentId;
699
- return this.districtControllerDashLayer.definitionExpression = `id = '${a}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${a}'`, await this.view.goTo(t.features, {
714
+ const r = s.features[0].attributes.parentId;
715
+ return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, await this.view.goTo(s.features, {
700
716
  duration: this.hasGpu ? 1e3 : 0
701
717
  }), { status: 0, message: "ok" };
702
718
  } else
703
- return this.subDistrictControllerLayer.definitionExpression = s, { status: 1, message: "未找到子区" };
719
+ return this.subDistrictControllerLayer.definitionExpression = i, { status: 1, message: "未找到子区" };
704
720
  }
705
721
  case "signal": {
706
- const s = this.signalMarkerLayer.definitionExpression;
722
+ const i = this.signalMarkerLayer.definitionExpression;
707
723
  this.signalMarkerLayer.definitionExpression = `id = '${e.id}'`;
708
- const t = await this.signalMarkerLayer.queryFeatures();
709
- if (t.features.length > 0) {
724
+ const s = await this.signalMarkerLayer.queryFeatures();
725
+ if (s.features.length > 0) {
710
726
  this.signalPictureLayer.definitionExpression = `id = '${e.id}'`;
711
- const i = t.features[0], { districtId: a, subDistrictId: l } = i.attributes;
712
- return this.districtControllerDashLayer.definitionExpression = `id = '${a}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${a}'`, this.subDistrictControllerLayer.definitionExpression = `id = '${l}'`, await this.view.goTo(
713
- { target: t.features, zoom: 2500 },
727
+ const t = s.features[0], { districtId: r, subDistrictId: o } = t.attributes;
728
+ return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, this.subDistrictControllerLayer.definitionExpression = `id = '${o}'`, await this.view.goTo(
729
+ { target: s.features, zoom: 2500 },
714
730
  {
715
731
  duration: this.hasGpu ? 1e3 : 0
716
732
  }
717
733
  ), { status: 0, message: "ok" };
718
734
  } else
719
- return this.signalMarkerLayer.definitionExpression = s, { status: 1, message: "未找到信号机" };
735
+ return this.signalMarkerLayer.definitionExpression = i, { status: 1, message: "未找到信号机" };
720
736
  }
721
737
  default:
722
738
  return { status: 1, message: "未知类型" };
@@ -739,77 +755,78 @@ class x {
739
755
  * @param isDistrict 是否是区控
740
756
  * @returns
741
757
  */
742
- generateGraphic(e, s) {
758
+ generateGraphic(e, i, s) {
743
759
  const t = e.getAllSignalCoordinates();
744
- let i = null;
760
+ let r = null;
745
761
  if (t.length >= 2)
746
762
  if (t.length === 2)
747
- i = n.lineString(t);
763
+ r = n.lineString(t);
748
764
  else {
749
- if (s) {
750
- const r = n.featureCollection(
751
- t.map((d) => n.point(d))
765
+ if (i) {
766
+ const a = n.featureCollection(
767
+ t.map((u) => n.point(u))
752
768
  );
753
- i = c(r);
769
+ r = p(a);
754
770
  } else {
755
- const r = p(t, 0.5);
756
- r.length >= 4 && (i = n.polygon([r]));
771
+ const a = h(t, 0.5);
772
+ a.length >= 4 && (r = n.polygon([a]));
757
773
  }
758
- i || (i = n.lineString(t));
774
+ r || (r = n.lineString(t));
759
775
  }
760
776
  else if (t.length === 1)
761
- i = n.point(t[0]);
777
+ r = n.point(t[0]);
762
778
  else
763
779
  return;
764
- const a = y(
765
- i.geometry,
780
+ const o = c(
781
+ r.geometry,
766
782
  // 区控面积更大,需要更大的缓冲半径
767
- s ? 200 : 30,
783
+ i ? 200 : 30,
768
784
  {
769
785
  units: "meters"
770
786
  }
771
- ), l = new u({
787
+ ), d = new y({
772
788
  geometry: {
773
789
  type: "polyline",
774
- paths: a.geometry.coordinates
790
+ paths: o.geometry.coordinates
775
791
  },
776
792
  attributes: {
777
- ObjectID: s ? this.districtControllerOid++ : this.subDistrictControllerOid++,
793
+ ObjectID: i ? this.districtControllerOid++ : this.subDistrictControllerOid++,
778
794
  id: e.id,
779
795
  name: e.name,
780
796
  subDistrictCount: e.subDistrictCount,
781
797
  signalCount: e.signalCount,
782
798
  parentId: e.parentId,
783
- parentName: e.parentName
799
+ parentName: e.parentName,
800
+ style: s
784
801
  }
785
802
  });
786
- s ? this.districtGraphics.push(l) : this.subDistrictGraphics.push(l);
787
- for (const r of e.subDistricts)
788
- this.generateGraphic(r, !1);
789
- e.signals.forEach((r) => {
790
- const d = new u({
803
+ i ? this.districtGraphics.push(d) : this.subDistrictGraphics.push(d);
804
+ for (const a of e.subDistricts)
805
+ this.generateGraphic(a, !1, s);
806
+ e.signals.forEach((a) => {
807
+ const u = new y({
791
808
  geometry: {
792
809
  type: "point",
793
- x: r.longitude,
794
- y: r.latitude
810
+ x: a.longitude,
811
+ y: a.latitude
795
812
  },
796
813
  attributes: {
797
814
  ObjectID: this.signalOid++,
798
- id: r.id,
799
- name: r.name,
800
- signalId: r.signalId,
801
- nodeId: r.nodeId,
802
- isKey: r.isKey,
803
- districtId: s ? e.id : e.parentId,
804
- districtName: s ? e.name : e.parentName,
805
- subDistrictId: s ? "" : e.id,
806
- subDistrictName: s ? "" : e.name
815
+ id: a.id,
816
+ name: a.name,
817
+ signalId: a.signalId,
818
+ nodeId: a.nodeId,
819
+ isKey: a.isKey,
820
+ districtId: i ? e.id : e.parentId,
821
+ districtName: i ? e.name : e.parentName,
822
+ subDistrictId: i ? "" : e.id,
823
+ subDistrictName: i ? "" : e.name
807
824
  }
808
825
  });
809
- this.signalGraphics.push(d);
826
+ this.signalGraphics.push(u);
810
827
  });
811
828
  }
812
829
  }
813
830
  export {
814
- x as default
831
+ S as default
815
832
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),o=require("@arcgis/core/layers/FeatureLayer"),y=require("@turf/buffer"),p=require("@turf/convex"),h=require("@turf/helpers"),m=require("concaveman"),g=require("../../stores/index.js"),f=require("./district-controller.js");function b(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const t=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,t.get?t:{enumerable:!0,get:()=>n[i]})}}return e.default=n,Object.freeze(e)}const l=b(h);class C{constructor(e){var s;this.districtControllerOid=0,this.subDistrictControllerOid=0,this.signalOid=0,this.districtGraphics=[],this.subDistrictGraphics=[],this.signalGraphics=[],this.view=e,this.hasGpu=localStorage.getItem("gpu")!=="Unknown";const t=g.default.useAppDataStore.mapConfig;this.openDriveServer=(s=t.openDriveServer)==null?void 0:s.url,this.districtControllerDashLayer=new o({id:"districtController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"}],renderer:{type:"simple",symbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:3}}}),this.districtControllerSolidLayer=new o({id:"districtController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"simple",symbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:3}}}),this.subDistrictControllerLayer=new o({id:"subDistrictController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"parentId",type:"string"},{name:"parentName",type:"string"},{name:"signalCount",type:"integer"}],popupTemplate:{title:"{name} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"parentName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"simple",symbol:{type:"simple-line",style:"solid",color:[5,196,104],width:3}}}),this.signalMarkerLayer=new o({id:"signalLayer",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22],size:12,outline:{color:"white",width:1}}},{value:"false",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}]}}),this.signalPictureLayer=new o({id:"signalLayer",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:30,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}}]}}),this.view.map.addMany([this.districtControllerSolidLayer,this.districtControllerDashLayer,this.subDistrictControllerLayer,this.signalMarkerLayer,this.signalPictureLayer])}async showSignalControlArea(e){await this.clearSignalControlArea(),this.districtControllerDashLayer.visible=!0,this.districtControllerSolidLayer.visible=!0,this.subDistrictControllerLayer.visible=!1,this.signalMarkerLayer.visible=!1,this.signalPictureLayer.visible=!1;for(const i of e.areaList){const t=new f.default(i,e.style||"");this.generateGraphic(t,!0)}return await this.districtControllerDashLayer.applyEdits({addFeatures:this.districtGraphics}),await this.districtControllerSolidLayer.applyEdits({addFeatures:this.districtGraphics}),this.view.goTo(this.districtGraphics),this.districtGraphics=[],await this.subDistrictControllerLayer.applyEdits({addFeatures:this.subDistrictGraphics}),this.subDistrictGraphics=[],await this.signalMarkerLayer.applyEdits({addFeatures:this.signalGraphics}),await this.signalPictureLayer.applyEdits({addFeatures:this.signalGraphics}),this.signalGraphics=[],{status:0,message:"ok"}}async clearSignalControlArea(){this.districtControllerOid=0,this.subDistrictControllerOid=0,this.signalOid=0;let e=await this.districtControllerDashLayer.queryFeatures();return await this.districtControllerDashLayer.applyEdits({deleteFeatures:e.features}),this.districtControllerDashLayer.definitionExpression="1=1",e=await this.districtControllerSolidLayer.queryFeatures(),await this.districtControllerSolidLayer.applyEdits({deleteFeatures:e.features}),this.districtControllerSolidLayer.definitionExpression="1=1",e=await this.subDistrictControllerLayer.queryFeatures(),await this.subDistrictControllerLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictControllerLayer.definitionExpression="1=1",e=await this.signalMarkerLayer.queryFeatures(),await this.signalMarkerLayer.applyEdits({deleteFeatures:e.features}),this.signalMarkerLayer.definitionExpression="1=1",e=await this.signalPictureLayer.queryFeatures(),await this.signalPictureLayer.applyEdits({deleteFeatures:e.features}),this.signalPictureLayer.definitionExpression="1=1",{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtControllerDashLayer.visible=e.visible,this.districtControllerSolidLayer.visible=e.visible;break;case"subDistrict":this.subDistrictControllerLayer.visible=e.visible;break;case"signal":this.signalMarkerLayer.visible=e.visible,this.signalPictureLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":{const s=this.districtControllerDashLayer.createQuery();s.where=`id = '${e.id}'`,s.returnGeometry=!0,s.outFields=["*"];const a=await this.districtControllerDashLayer.queryFeatures(s);return a.features.length>0?(await this.view.goTo(a.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}case"subDistrict":const i=this.subDistrictControllerLayer.createQuery();i.where=`id = '${e.id}'`,i.returnGeometry=!0,i.outFields=["*"];const t=await this.subDistrictControllerLayer.queryFeatures(i);return t.features.length>0?(await this.view.goTo(t.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到子区"};case"signal":{const s=this.signalMarkerLayer.createQuery();s.where=`id = '${e.id}'`,s.returnGeometry=!0,s.outFields=["*"];const a=await this.signalMarkerLayer.queryFeatures(s);return a.features.length>0?(await this.view.goTo({target:a.features[0],scale:2500},{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(e.type){case"district":{const i=this.districtControllerDashLayer.definitionExpression;this.districtControllerDashLayer.definitionExpression=`id = '${e.id}'`;const t=await this.districtControllerDashLayer.queryFeatures();return t.features.length>0?(this.districtControllerSolidLayer.definitionExpression=`id = '${e.id}'`,this.subDistrictControllerLayer.definitionExpression=`parentId = '${e.id}'`,this.signalMarkerLayer.definitionExpression=`districtId = '${e.id}'`,this.signalPictureLayer.definitionExpression=`districtId = '${e.id}'`,await this.view.goTo(t.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):(this.districtControllerDashLayer.definitionExpression=i,{status:1,message:"未找到区控"})}case"subDistrict":{const i=this.subDistrictControllerLayer.definitionExpression;this.subDistrictControllerLayer.definitionExpression=`id = '${e.id}'`;const t=await this.subDistrictControllerLayer.queryFeatures();if(t.features.length>0){this.signalMarkerLayer.definitionExpression=`subDistrictId = '${e.id}'`,this.signalPictureLayer.definitionExpression=`subDistrictId = '${e.id}'`;const a=t.features[0].attributes.parentId;return this.districtControllerDashLayer.definitionExpression=`id = '${a}'`,this.districtControllerSolidLayer.definitionExpression=`id = '${a}'`,await this.view.goTo(t.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}else return this.subDistrictControllerLayer.definitionExpression=i,{status:1,message:"未找到子区"}}case"signal":{const i=this.signalMarkerLayer.definitionExpression;this.signalMarkerLayer.definitionExpression=`id = '${e.id}'`;const t=await this.signalMarkerLayer.queryFeatures();if(t.features.length>0){this.signalPictureLayer.definitionExpression=`id = '${e.id}'`;const s=t.features[0],{districtId:a,subDistrictId:u}=s.attributes;return this.districtControllerDashLayer.definitionExpression=`id = '${a}'`,this.districtControllerSolidLayer.definitionExpression=`id = '${a}'`,this.subDistrictControllerLayer.definitionExpression=`id = '${u}'`,await this.view.goTo({target:t.features,zoom:2500},{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}else return this.signalMarkerLayer.definitionExpression=i,{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){this.districtControllerDashLayer.definitionExpression="1=1",this.districtControllerSolidLayer.definitionExpression="1=1",this.subDistrictControllerLayer.definitionExpression="1=1",this.signalMarkerLayer.definitionExpression="1=1";const e=await this.districtControllerDashLayer.queryFeatures();return this.view.goTo(e.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}generateGraphic(e,i){const t=e.getAllSignalCoordinates();let s=null;if(t.length>=2)if(t.length===2)s=l.lineString(t);else{if(i){const r=l.featureCollection(t.map(d=>l.point(d)));s=p(r)}else{const r=m(t,.5);r.length>=4&&(s=l.polygon([r]))}s||(s=l.lineString(t))}else if(t.length===1)s=l.point(t[0]);else return;const a=y(s.geometry,i?200:30,{units:"meters"}),u=new c({geometry:{type:"polyline",paths:a.geometry.coordinates},attributes:{ObjectID:i?this.districtControllerOid++:this.subDistrictControllerOid++,id:e.id,name:e.name,subDistrictCount:e.subDistrictCount,signalCount:e.signalCount,parentId:e.parentId,parentName:e.parentName}});i?this.districtGraphics.push(u):this.subDistrictGraphics.push(u);for(const r of e.subDistricts)this.generateGraphic(r,!1);e.signals.forEach(r=>{const d=new c({geometry:{type:"point",x:r.longitude,y:r.latitude},attributes:{ObjectID:this.signalOid++,id:r.id,name:r.name,signalId:r.signalId,nodeId:r.nodeId,isKey:r.isKey,districtId:i?e.id:e.parentId,districtName:i?e.name:e.parentName,subDistrictId:i?"":e.id,subDistrictName:i?"":e.name}});this.signalGraphics.push(d)})}}exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),o=require("@arcgis/core/layers/FeatureLayer"),p=require("@turf/buffer"),h=require("@turf/convex"),m=require("@turf/helpers"),g=require("concaveman"),f=require("../../stores/index.js"),b=require("./district-controller.js");function C(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const l=C(m);class I{constructor(e){var i;this.districtControllerOid=0,this.subDistrictControllerOid=0,this.signalOid=0,this.districtGraphics=[],this.subDistrictGraphics=[],this.signalGraphics=[],this.view=e,this.hasGpu=localStorage.getItem("gpu")!=="Unknown";const s=f.default.useAppDataStore.mapConfig;this.openDriveServer=(i=s.openDriveServer)==null?void 0:i.url,this.districtControllerDashLayer=new o({id:"districtController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"}],renderer:{type:"simple",symbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:3}}}),this.districtControllerSolidLayer=new o({id:"districtController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"simple",symbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:3}}}),this.subDistrictControllerLayer=new o({id:"subDistrictController",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"parentId",type:"string"},{name:"parentName",type:"string"},{name:"signalCount",type:"integer"},{name:"style",type:"string"}],popupTemplate:{title:"{name} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"parentName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"style",defaultSymbol:{type:"simple-line",style:"solid",color:[5,196,104],width:3},uniqueValueInfos:[{value:"alert",symbol:{type:"simple-line",style:"solid",color:[255,0,0],width:3}}]}}),this.signalMarkerLayer=new o({id:"signalLayer",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22],size:12,outline:{color:"white",width:1}}},{value:"false",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}]}}),this.signalPictureLayer=new o({id:"signalLayer",spatialReference:e.spatialReference,source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:30,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}}]}}),this.view.map.addMany([this.districtControllerSolidLayer,this.districtControllerDashLayer,this.subDistrictControllerLayer,this.signalMarkerLayer,this.signalPictureLayer])}async showSignalControlArea(e){await this.clearSignalControlArea(),this.districtControllerDashLayer.visible=!0,this.districtControllerSolidLayer.visible=!0,this.subDistrictControllerLayer.visible=!1,this.signalMarkerLayer.visible=!1,this.signalPictureLayer.visible=!1;for(const t of e.areaList){const s=new b.default(t,e.style||"");this.generateGraphic(s,!0,e.style)}return await this.districtControllerDashLayer.applyEdits({addFeatures:this.districtGraphics}),await this.districtControllerSolidLayer.applyEdits({addFeatures:this.districtGraphics}),this.view.goTo(this.districtGraphics),this.districtGraphics=[],await this.subDistrictControllerLayer.applyEdits({addFeatures:this.subDistrictGraphics}),this.subDistrictGraphics=[],await this.signalMarkerLayer.applyEdits({addFeatures:this.signalGraphics}),await this.signalPictureLayer.applyEdits({addFeatures:this.signalGraphics}),this.signalGraphics=[],{status:0,message:"ok"}}async clearSignalControlArea(){this.districtControllerOid=0,this.subDistrictControllerOid=0,this.signalOid=0;let e=await this.districtControllerDashLayer.queryFeatures();return await this.districtControllerDashLayer.applyEdits({deleteFeatures:e.features}),this.districtControllerDashLayer.definitionExpression="1=1",e=await this.districtControllerSolidLayer.queryFeatures(),await this.districtControllerSolidLayer.applyEdits({deleteFeatures:e.features}),this.districtControllerSolidLayer.definitionExpression="1=1",e=await this.subDistrictControllerLayer.queryFeatures(),await this.subDistrictControllerLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictControllerLayer.definitionExpression="1=1",e=await this.signalMarkerLayer.queryFeatures(),await this.signalMarkerLayer.applyEdits({deleteFeatures:e.features}),this.signalMarkerLayer.definitionExpression="1=1",e=await this.signalPictureLayer.queryFeatures(),await this.signalPictureLayer.applyEdits({deleteFeatures:e.features}),this.signalPictureLayer.definitionExpression="1=1",{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtControllerDashLayer.visible=e.visible,this.districtControllerSolidLayer.visible=e.visible;break;case"subDistrict":this.subDistrictControllerLayer.visible=e.visible;break;case"signal":this.signalMarkerLayer.visible=e.visible,this.signalPictureLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":{const i=this.districtControllerDashLayer.createQuery();i.where=`id = '${e.id}'`,i.returnGeometry=!0,i.outFields=["*"];const r=await this.districtControllerDashLayer.queryFeatures(i);return r.features.length>0?(await this.view.goTo(r.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}case"subDistrict":const t=this.subDistrictControllerLayer.createQuery();t.where=`id = '${e.id}'`,t.returnGeometry=!0,t.outFields=["*"];const s=await this.subDistrictControllerLayer.queryFeatures(t);return s.features.length>0?(await this.view.goTo(s.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到子区"};case"signal":{const i=this.signalMarkerLayer.createQuery();i.where=`id = '${e.id}'`,i.returnGeometry=!0,i.outFields=["*"];const r=await this.signalMarkerLayer.queryFeatures(i);return r.features.length>0?(await this.view.goTo({target:r.features[0],scale:2500},{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(e.type){case"district":{const t=this.districtControllerDashLayer.definitionExpression;this.districtControllerDashLayer.definitionExpression=`id = '${e.id}'`;const s=await this.districtControllerDashLayer.queryFeatures();return s.features.length>0?(this.districtControllerSolidLayer.definitionExpression=`id = '${e.id}'`,this.subDistrictControllerLayer.definitionExpression=`parentId = '${e.id}'`,this.signalMarkerLayer.definitionExpression=`districtId = '${e.id}'`,this.signalPictureLayer.definitionExpression=`districtId = '${e.id}'`,await this.view.goTo(s.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):(this.districtControllerDashLayer.definitionExpression=t,{status:1,message:"未找到区控"})}case"subDistrict":{const t=this.subDistrictControllerLayer.definitionExpression;this.subDistrictControllerLayer.definitionExpression=`id = '${e.id}'`;const s=await this.subDistrictControllerLayer.queryFeatures();if(s.features.length>0){this.signalMarkerLayer.definitionExpression=`subDistrictId = '${e.id}'`,this.signalPictureLayer.definitionExpression=`subDistrictId = '${e.id}'`;const r=s.features[0].attributes.parentId;return this.districtControllerDashLayer.definitionExpression=`id = '${r}'`,this.districtControllerSolidLayer.definitionExpression=`id = '${r}'`,await this.view.goTo(s.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}else return this.subDistrictControllerLayer.definitionExpression=t,{status:1,message:"未找到子区"}}case"signal":{const t=this.signalMarkerLayer.definitionExpression;this.signalMarkerLayer.definitionExpression=`id = '${e.id}'`;const s=await this.signalMarkerLayer.queryFeatures();if(s.features.length>0){this.signalPictureLayer.definitionExpression=`id = '${e.id}'`;const i=s.features[0],{districtId:r,subDistrictId:u}=i.attributes;return this.districtControllerDashLayer.definitionExpression=`id = '${r}'`,this.districtControllerSolidLayer.definitionExpression=`id = '${r}'`,this.subDistrictControllerLayer.definitionExpression=`id = '${u}'`,await this.view.goTo({target:s.features,zoom:2500},{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}else return this.signalMarkerLayer.definitionExpression=t,{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){this.districtControllerDashLayer.definitionExpression="1=1",this.districtControllerSolidLayer.definitionExpression="1=1",this.subDistrictControllerLayer.definitionExpression="1=1",this.signalMarkerLayer.definitionExpression="1=1";const e=await this.districtControllerDashLayer.queryFeatures();return this.view.goTo(e.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}}generateGraphic(e,t,s){const i=e.getAllSignalCoordinates();let r=null;if(i.length>=2)if(i.length===2)r=l.lineString(i);else{if(t){const a=l.featureCollection(i.map(d=>l.point(d)));r=h(a)}else{const a=g(i,.5);a.length>=4&&(r=l.polygon([a]))}r||(r=l.lineString(i))}else if(i.length===1)r=l.point(i[0]);else return;const u=p(r.geometry,t?200:30,{units:"meters"}),y=new c({geometry:{type:"polyline",paths:u.geometry.coordinates},attributes:{ObjectID:t?this.districtControllerOid++:this.subDistrictControllerOid++,id:e.id,name:e.name,subDistrictCount:e.subDistrictCount,signalCount:e.signalCount,parentId:e.parentId,parentName:e.parentName,style:s}});t?this.districtGraphics.push(y):this.subDistrictGraphics.push(y);for(const a of e.subDistricts)this.generateGraphic(a,!1,s);e.signals.forEach(a=>{const d=new c({geometry:{type:"point",x:a.longitude,y:a.latitude},attributes:{ObjectID:this.signalOid++,id:a.id,name:a.name,signalId:a.signalId,nodeId:a.nodeId,isKey:a.isKey,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name}});this.signalGraphics.push(d)})}}exports.default=I;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.209",
3
+ "version": "1.0.210",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [