gisviewer-vue3-arcgis 1.0.126 → 1.0.127

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.
@@ -6,7 +6,7 @@ import u from "./district-controller.mjs";
6
6
  class C {
7
7
  constructor(e) {
8
8
  this.view = e, this.view.popup.visibleElements = {
9
- closeButton: !1,
9
+ closeButton: !0,
10
10
  collapseButton: !1,
11
11
  actionBar: !1
12
12
  }, this.districtControllerLayer = new s({
@@ -29,43 +29,43 @@ class C {
29
29
  }
30
30
  showSignalControlArea(e) {
31
31
  for (const t of e) {
32
- const a = new u(t);
33
- this.drawArea(a, !0);
32
+ const r = new u(t);
33
+ this.drawArea(r, !0);
34
34
  }
35
35
  return { status: 0, message: "ok" };
36
36
  }
37
37
  clearSignalControlArea() {
38
38
  var e;
39
- return this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), (e = this.eventHandle) == null || e.remove(), this.view.closePopup(), { status: 0, message: "ok" };
39
+ return this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), (e = this.eventHandle) == null || e.remove(), this.view.closePopup(), { status: 0, message: "ok" };
40
40
  }
41
41
  locateSignalControlArea(e) {
42
42
  let t = this.districtControllerLayer.graphics.find(
43
- (a) => a.attributes.id === e.id
43
+ (r) => r.attributes.id === e.id
44
44
  );
45
45
  if (t || (t = this.subDistrictControllerLayer.graphics.find(
46
- (a) => a.attributes.id === e.id
46
+ (r) => r.attributes.id === e.id
47
47
  )), t || (t = this.crossLayer.graphics.find(
48
- (a) => a.attributes.id === e.id
48
+ (r) => r.attributes.id === e.id
49
49
  )), t) {
50
50
  this.view.goTo(t.geometry);
51
- const a = t.geometry.type === "point" ? t.geometry : t.geometry.centroid;
51
+ const r = t.geometry.type === "point" ? t.geometry : t.geometry.centroid;
52
52
  return this.view.popup.open({
53
53
  features: [t],
54
- location: a
54
+ location: r
55
55
  }), { status: 0, message: "ok" };
56
56
  }
57
57
  return { status: 1, message: "未找到" };
58
58
  }
59
59
  drawArea(e, t) {
60
- const a = e.getAllCrossCoordinates();
61
- if (a.length > 2) {
62
- const i = c.featureCollection(
63
- a.map((m) => c.point(m))
64
- ), o = p(i);
60
+ const r = e.getAllCrossCoordinates();
61
+ if (r.length > 2) {
62
+ const a = c.featureCollection(
63
+ r.map((m) => c.point(m))
64
+ ), o = p(a);
65
65
  if (!o)
66
66
  return;
67
- let r;
68
- t ? r = [
67
+ let i;
68
+ t ? i = [
69
69
  {
70
70
  fieldName: "id",
71
71
  label: "区控编号"
@@ -78,7 +78,7 @@ class C {
78
78
  fieldName: "subDistrictCount",
79
79
  label: "子区数量"
80
80
  }
81
- ] : r = [
81
+ ] : i = [
82
82
  {
83
83
  fieldName: "parentId",
84
84
  label: "区控编号"
@@ -118,20 +118,20 @@ class C {
118
118
  content: [
119
119
  {
120
120
  type: "fields",
121
- fieldInfos: r
121
+ fieldInfos: i
122
122
  }
123
123
  ]
124
124
  }
125
125
  });
126
126
  t ? this.districtControllerLayer.add(l) : this.subDistrictControllerLayer.add(l);
127
127
  }
128
- for (const i of e.subDistricts)
129
- this.drawArea(i, !1);
130
- const d = e.crosses.map((i) => new n({
128
+ for (const a of e.subDistricts)
129
+ this.drawArea(a, !1);
130
+ const d = e.crosses.map((a) => new n({
131
131
  geometry: {
132
132
  type: "point",
133
- x: i.longitude,
134
- y: i.latitude
133
+ x: a.longitude,
134
+ y: a.latitude
135
135
  },
136
136
  symbol: {
137
137
  type: "simple-marker",
@@ -140,13 +140,13 @@ class C {
140
140
  },
141
141
  attributes: {
142
142
  type: "cross",
143
- id: i.id,
144
- name: i.name,
143
+ id: a.id,
144
+ name: a.name,
145
145
  districtId: t ? e.id : e.parentId,
146
146
  subDistrictId: t ? "" : e.id
147
147
  },
148
148
  popupTemplate: {
149
- title: i.name,
149
+ title: a.name,
150
150
  content: [
151
151
  {
152
152
  type: "fields",
@@ -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/GraphicsLayer"),f=require("@turf/convex"),m=require("@turf/helpers"),y=require("./district-controller.js");function b(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const u=b(m);class g{constructor(e){this.view=e,this.view.popup.visibleElements={closeButton:!1,collapseButton:!1,actionBar:!1},this.districtControllerLayer=new o({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new o({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new o({id:"crossLayer",maxScale:0,minScale:18056}),this.view.map.addMany([this.crossLayer,this.districtControllerLayer,this.subDistrictControllerLayer])}showSignalControlArea(e){for(const t of e){const r=new y.default(t);this.drawArea(r,!0)}return{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),(e=this.eventHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}locateSignalControlArea(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e.id);if(t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e.id)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e.id)),t){this.view.goTo(t.geometry);const r=t.geometry.type==="point"?t.geometry:t.geometry.centroid;return this.view.popup.open({features:[t],location:r}),{status:0,message:"ok"}}return{status:1,message:"未找到"}}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>2){const a=u.featureCollection(r.map(p=>u.point(p))),l=f(a);if(!l)return;let s;t?s=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:s=[{fieldName:"parentId",label:"区控编号"},{fieldName:"id",label:"子区编号"},{fieldName:"crossCount",label:"路口数量"}];const n=new c({geometry:{type:"polygon",rings:l.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,.5],outline:{color:e.areaColor,width:1}},attributes:{type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},popupTemplate:{title:e.name,content:[{type:"fields",fieldInfos:s}]}});t?this.districtControllerLayer.add(n):this.subDistrictControllerLayer.add(n)}for(const a of e.subDistricts)this.drawArea(a,!1);const d=e.crosses.map(a=>new c({geometry:{type:"point",x:a.longitude,y:a.latitude},symbol:{type:"simple-marker",color:e.areaColor,size:8},attributes:{type:"cross",id:a.id,name:a.name,districtId:t?e.id:e.parentId,subDistrictId:t?"":e.id},popupTemplate:{title:a.name,content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"路口编号"},{fieldName:"districtId",label:"区控编号"},{fieldName:"subDistrictId",label:"子区编号"}]}]}}));this.crossLayer.addMany(d)}}exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),o=require("@arcgis/core/layers/GraphicsLayer"),m=require("@turf/convex"),f=require("@turf/helpers"),y=require("./district-controller.js");function b(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const u=b(f);class h{constructor(e){this.view=e,this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1},this.districtControllerLayer=new o({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new o({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new o({id:"crossLayer",maxScale:0,minScale:18056}),this.view.map.addMany([this.crossLayer,this.districtControllerLayer,this.subDistrictControllerLayer])}showSignalControlArea(e){for(const t of e){const r=new y.default(t);this.drawArea(r,!0)}return{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),(e=this.eventHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}locateSignalControlArea(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e.id);if(t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e.id)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e.id)),t){this.view.goTo(t.geometry);const r=t.geometry.type==="point"?t.geometry:t.geometry.centroid;return this.view.popup.open({features:[t],location:r}),{status:0,message:"ok"}}return{status:1,message:"未找到"}}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>2){const a=u.featureCollection(r.map(p=>u.point(p))),l=m(a);if(!l)return;let i;t?i=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:i=[{fieldName:"parentId",label:"区控编号"},{fieldName:"id",label:"子区编号"},{fieldName:"crossCount",label:"路口数量"}];const n=new c({geometry:{type:"polygon",rings:l.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,.5],outline:{color:e.areaColor,width:1}},attributes:{type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},popupTemplate:{title:e.name,content:[{type:"fields",fieldInfos:i}]}});t?this.districtControllerLayer.add(n):this.subDistrictControllerLayer.add(n)}for(const a of e.subDistricts)this.drawArea(a,!1);const d=e.crosses.map(a=>new c({geometry:{type:"point",x:a.longitude,y:a.latitude},symbol:{type:"simple-marker",color:e.areaColor,size:8},attributes:{type:"cross",id:a.id,name:a.name,districtId:t?e.id:e.parentId,subDistrictId:t?"":e.id},popupTemplate:{title:a.name,content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"路口编号"},{fieldName:"districtId",label:"区控编号"},{fieldName:"subDistrictId",label:"子区编号"}]}]}}));this.crossLayer.addMany(d)}}exports.default=h;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.126",
3
+ "version": "1.0.127",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [