gisviewer-vue3-arcgis 1.0.230 → 1.0.231

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.
@@ -33,7 +33,7 @@ class r {
33
33
  return s;
34
34
  }
35
35
  getDarkNonGrayColor() {
36
- const s = Math.floor(Math.random() * 360), n = 80 + Math.random() * 20, t = 15 + Math.random() * 15, i = n / 100 * Math.min(t / 100, 1 - t / 100), o = (e) => {
36
+ const s = Math.floor(Math.random() * 360), n = 80 + Math.random() * 20, t = 15 + Math.random() * 35, i = n / 100 * Math.min(t / 100, 1 - t / 100), o = (e) => {
37
37
  const a = (e + s / 30) % 12, l = t / 100 - i * Math.max(Math.min(a - 3, 9 - a, 1), -1);
38
38
  return Math.round(255 * l);
39
39
  };
@@ -5,10 +5,11 @@ declare const districtSolidLineLayerOptions: any;
5
5
  /** 子区图层 */
6
6
  declare const subDistrictLayerOptions: any;
7
7
  declare const subDistrictPointLayerOptions: any;
8
+ declare const subDistrictLineLayerOptions: any;
8
9
  /** 信号机圆点图层 */
9
10
  declare const signalMarkerLayerOptions: any;
10
11
  /** 信号机图标图层 */
11
12
  declare const signalPictureLayerOptions: any;
12
13
  /** 信号机聚合图层 */
13
14
  declare const signalClusterLayerOptions: any;
14
- export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions, subDistrictPointLayerOptions };
15
+ export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions, subDistrictLineLayerOptions, subDistrictPointLayerOptions };
@@ -205,6 +205,58 @@ const e = {
205
205
  ]
206
206
  }
207
207
  }, r = {
208
+ id: "subDistrictController",
209
+ source: [],
210
+ objectIdField: "ObjectID",
211
+ outFields: ["*"],
212
+ geometryType: "point",
213
+ fields: [
214
+ {
215
+ name: "ObjectID",
216
+ type: "oid"
217
+ },
218
+ {
219
+ name: "id",
220
+ type: "string"
221
+ },
222
+ {
223
+ name: "name",
224
+ type: "string"
225
+ },
226
+ {
227
+ name: "districtId",
228
+ type: "string"
229
+ },
230
+ {
231
+ name: "districtName",
232
+ type: "string"
233
+ },
234
+ {
235
+ name: "subDistrictId",
236
+ type: "string"
237
+ },
238
+ {
239
+ name: "subDistrictName",
240
+ type: "string"
241
+ },
242
+ {
243
+ name: "signalCount",
244
+ type: "integer"
245
+ },
246
+ {
247
+ name: "selected",
248
+ type: "string"
249
+ },
250
+ {
251
+ name: "type",
252
+ type: "string"
253
+ },
254
+ {
255
+ name: "color",
256
+ type: "string"
257
+ }
258
+ ]
259
+ }, l = {
208
260
  id: "signalLayer",
209
261
  source: [],
210
262
  objectIdField: "ObjectID",
@@ -380,7 +432,7 @@ const e = {
380
432
  }
381
433
  ]
382
434
  }
383
- }, l = {
435
+ }, s = {
384
436
  id: "signalLayer",
385
437
  source: [],
386
438
  objectIdField: "ObjectID",
@@ -692,7 +744,7 @@ const e = {
692
744
  }
693
745
  ]
694
746
  }
695
- }, s = {
747
+ }, a = {
696
748
  id: "signalLayer",
697
749
  source: [],
698
750
  objectIdField: "ObjectID",
@@ -910,8 +962,9 @@ const e = {
910
962
  export {
911
963
  e as districtDashLineLayerOptions,
912
964
  t as districtSolidLineLayerOptions,
913
- s as signalClusterLayerOptions,
914
- r as signalMarkerLayerOptions,
915
- l as signalPictureLayerOptions,
965
+ a as signalClusterLayerOptions,
966
+ l as signalMarkerLayerOptions,
967
+ s as signalPictureLayerOptions,
968
+ r as subDistrictLineLayerOptions,
916
969
  i as subDistrictPointLayerOptions
917
970
  };
@@ -5,6 +5,7 @@ export default class SubDistrictRenderer {
5
5
  private hasGpu;
6
6
  private clickHandler;
7
7
  private subDistrictPointLayer;
8
+ private subDistrictLineLayer;
8
9
  constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
9
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
10
11
  clearSubDistricts(): Promise<void>;
@@ -23,7 +24,15 @@ export default class SubDistrictRenderer {
23
24
  count: number;
24
25
  parentId: string;
25
26
  }>;
27
+ /**
28
+ * 按照区控、子区id显示子区
29
+ * @param type 类型,district 或 subDistrict
30
+ * @param id
31
+ */
26
32
  filter(type: string, id: string): void;
33
+ /**
34
+ * 重置过滤器,显示所有子区
35
+ */
27
36
  resetFilter(): void;
28
37
  private currentRenderer;
29
38
  private viewHitTest;
@@ -1,51 +1,53 @@
1
- import n from "@arcgis/core/Graphic";
2
- import o from "@arcgis/core/layers/FeatureLayer";
3
- import { subDistrictPointLayerOptions as c } from "./layer-symbol.mjs";
4
- class b {
5
- constructor(t, e) {
6
- this.view = t, this.hasGpu = e, this.subDistrictPointLayer = new o(
1
+ import o from "@arcgis/core/Graphic";
2
+ import u from "@arcgis/core/layers/FeatureLayer";
3
+ import { subDistrictPointLayerOptions as c, subDistrictLineLayerOptions as l } from "./layer-symbol.mjs";
4
+ class y {
5
+ constructor(i, s) {
6
+ this.view = i, this.hasGpu = s, this.subDistrictPointLayer = new u(
7
7
  c
8
- ), this.subDistrictPointLayer.spatialReference = t.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.view.map.add(this.subDistrictPointLayer), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
8
+ ), this.subDistrictPointLayer.spatialReference = i.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new u(
9
+ l
10
+ ), this.subDistrictLineLayer.spatialReference = i.spatialReference, this.subDistrictLineLayer.popupEnabled = !1, this.view.map.add(this.subDistrictPointLayer);
9
11
  }
10
- async showSubDistricts(t) {
11
- await this.clearSubDistricts();
12
- let e = 0;
13
- const s = [], r = [];
14
- t.forEach((i) => {
12
+ async showSubDistricts(i) {
13
+ await this.clearSubDistricts(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
14
+ let s = 0;
15
+ const e = [], r = [];
16
+ i.forEach((t) => {
15
17
  r.push({
16
- value: i.id,
17
- label: i.name,
18
+ value: t.id,
19
+ label: t.name,
18
20
  symbol: {
19
21
  type: "simple-marker",
20
22
  style: "circle",
21
23
  color: [0, 0, 0, 0],
22
24
  size: "8px",
23
25
  outline: {
24
- color: [...i.areaColor],
26
+ color: [...t.areaColor],
25
27
  width: 4
26
28
  }
27
29
  }
28
- }), i.signals.forEach((a) => {
29
- const u = new n({
30
+ }), t.signals.forEach((a) => {
31
+ const n = new o({
30
32
  geometry: {
31
33
  type: "point",
32
34
  longitude: a.longitude,
33
35
  latitude: a.latitude
34
36
  },
35
37
  attributes: {
36
- ObjectID: e++,
38
+ ObjectID: s++,
37
39
  id: a.id,
38
40
  name: a.name,
39
- subDistrictId: i.id,
40
- subDistrictName: i.name,
41
- districtId: i.parentId,
42
- districtName: i.parentName,
43
- signalCount: i.signalCount,
44
- color: i.areaColor.join(","),
41
+ subDistrictId: t.id,
42
+ subDistrictName: t.name,
43
+ districtId: t.parentId,
44
+ districtName: t.parentName,
45
+ signalCount: t.signalCount,
46
+ color: t.areaColor.join(","),
45
47
  type: "subDistrict"
46
48
  }
47
49
  });
48
- s.push(u);
50
+ e.push(n);
49
51
  });
50
52
  }), this.subDistrictPointLayer.renderer = {
51
53
  type: "unique-value",
@@ -90,64 +92,77 @@ class b {
90
92
  }
91
93
  ]
92
94
  }, this.currentRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
93
- addFeatures: s
94
- }), await this.view.goTo(s, {
95
+ addFeatures: e
96
+ }), await this.view.goTo(e, {
95
97
  duration: this.hasGpu ? 1e3 : 0
96
98
  });
97
99
  }
98
100
  async clearSubDistricts() {
99
- const t = await this.subDistrictPointLayer.queryFeatures();
100
- t.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
101
- deleteFeatures: t.features
101
+ var e;
102
+ const i = await this.subDistrictPointLayer.queryFeatures();
103
+ i.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
104
+ deleteFeatures: i.features
102
105
  }), this.subDistrictPointLayer.definitionExpression = "1=1";
106
+ const s = await this.subDistrictLineLayer.queryFeatures();
107
+ s.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
108
+ deleteFeatures: s.features
109
+ }), this.subDistrictLineLayer.definitionExpression = "1=1", (e = this.clickHandler) == null || e.remove();
103
110
  }
104
- setVisible(t) {
105
- this.subDistrictPointLayer.visible = t;
111
+ setVisible(i) {
112
+ this.subDistrictPointLayer.visible = i, this.subDistrictLineLayer.visible = i;
106
113
  }
107
114
  /**
108
115
  * 定位子区
109
116
  * @param id 子区ID
110
117
  */
111
- async locateSubDistrict(t) {
112
- const e = this.subDistrictPointLayer.createQuery();
113
- e.where = `subDistrictId = '${t}'`, e.returnGeometry = !0;
114
- const s = await this.subDistrictPointLayer.queryFeatures(e);
115
- return s.features.length > 0 ? (await this.view.goTo(s.features, {
118
+ async locateSubDistrict(i) {
119
+ const s = this.subDistrictPointLayer.createQuery();
120
+ s.where = `subDistrictId = '${i}'`, s.returnGeometry = !0;
121
+ const e = await this.subDistrictPointLayer.queryFeatures(s);
122
+ return e.features.length > 0 ? (await this.view.goTo(e.features, {
116
123
  duration: this.hasGpu ? 1e3 : 0
117
- }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
124
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
118
125
  }
119
126
  /**
120
127
  * 高亮子区, 其他子区隐藏
121
128
  * @param id 子区ID
122
129
  * @return 返回高亮子区的数量以及区控id
123
130
  */
124
- async highlightSubDistrict(t) {
125
- let e = "";
126
- const s = this.subDistrictPointLayer.definitionExpression;
127
- this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${t}'`;
128
- const r = await this.subDistrictPointLayer.queryFeatures(), i = r.features.length;
129
- return i > 0 ? (e = r.features[0].attributes.districtId, await this.view.goTo(r.features, {
131
+ async highlightSubDistrict(i) {
132
+ let s = "";
133
+ const e = this.subDistrictPointLayer.definitionExpression;
134
+ this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${i}'`;
135
+ const r = await this.subDistrictPointLayer.queryFeatures(), t = r.features.length;
136
+ return t > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${i}'`, s = r.features[0].attributes.districtId, await this.view.goTo(r.features, {
130
137
  duration: this.hasGpu ? 1e3 : 0
131
- })) : this.subDistrictPointLayer.definitionExpression = s, { count: i, parentId: e };
138
+ })) : this.subDistrictPointLayer.definitionExpression = e, { count: t, parentId: s };
132
139
  }
133
- filter(t, e) {
134
- const s = `${t === "district" ? "districtId" : "subDistrictId"} = '${e}'`;
135
- this.subDistrictPointLayer.definitionExpression = s;
140
+ /**
141
+ * 按照区控、子区id显示子区
142
+ * @param type 类型,district 或 subDistrict
143
+ * @param id
144
+ */
145
+ filter(i, s) {
146
+ const e = `${i === "district" ? "districtId" : "subDistrictId"} = '${s}'`;
147
+ this.subDistrictPointLayer.definitionExpression = e, this.subDistrictLineLayer.definitionExpression = e;
136
148
  }
149
+ /**
150
+ * 重置过滤器,显示所有子区
151
+ */
137
152
  resetFilter() {
138
- this.subDistrictPointLayer.definitionExpression = "1=1";
153
+ this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
139
154
  }
140
- async viewHitTest(t) {
155
+ async viewHitTest(i) {
141
156
  var r;
142
- const s = (r = (await this.view.hitTest(t, {
157
+ const e = (r = (await this.view.hitTest(i, {
143
158
  include: [this.subDistrictPointLayer]
144
159
  })).results) == null ? void 0 : r.filter(
145
- (i) => i.type === "graphic"
160
+ (t) => t.type === "graphic"
146
161
  );
147
- if (s.length === 0)
162
+ if (e.length === 0)
148
163
  this.currentRenderer && (this.subDistrictPointLayer.renderer = this.currentRenderer);
149
164
  else {
150
- const i = s[0].graphic;
165
+ const t = e[0].graphic;
151
166
  this.subDistrictPointLayer.renderer = {
152
167
  type: "unique-value",
153
168
  field: "subDistrictId",
@@ -164,14 +179,14 @@ class b {
164
179
  defaultLabel: "其他子区",
165
180
  uniqueValueInfos: [
166
181
  {
167
- value: i.attributes.subDistrictId,
182
+ value: t.attributes.subDistrictId,
168
183
  symbol: {
169
184
  type: "simple-marker",
170
185
  style: "circle",
171
186
  color: [0, 0, 0, 0],
172
187
  size: "8px",
173
188
  outline: {
174
- color: i.attributes.color.split(",").map(Number),
189
+ color: t.attributes.color.split(",").map(Number),
175
190
  width: 4
176
191
  }
177
192
  }
@@ -210,5 +225,5 @@ class b {
210
225
  }
211
226
  }
212
227
  export {
213
- b as default
228
+ y as default
214
229
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../common-utils.js");class e{constructor(s,n){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.id=s.name,this.name=s.areaDesc,this.parentId=s.parentId,n==="alarm"&&(this.areaColor=[255,0,0]);for(const t of s.children)if(t.children){const i=new e(t,n);i.id=t.id,i.name=`SS ${t.name}`,i.parentId=this.id,i.parentName=this.name,this.subDistricts.push(i),this.subDistrictCount++,this.signalCount+=i.signalCount}else if(d.default.isCoordinateValid(t)){const i={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,nodeId:t.nodeId,isKey:t.isKey===1};this.signals.push(i),this.signalCount++}}getAllSignalCoordinates(){const s=[];for(const n of this.signals)s.push([n.longitude,n.latitude]);for(const n of this.subDistricts)s.push(...n.getAllSignalCoordinates());return s}getDarkNonGrayColor(){const s=Math.floor(Math.random()*360),n=80+Math.random()*20,t=15+Math.random()*15,i=n/100*Math.min(t/100,1-t/100),o=r=>{const a=(r+s/30)%12,l=t/100-i*Math.max(Math.min(a-3,9-a,1),-1);return Math.round(255*l)};return[o(0),o(8),o(4)]}}exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../common-utils.js");class e{constructor(s,n){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.id=s.name,this.name=s.areaDesc,this.parentId=s.parentId,n==="alarm"&&(this.areaColor=[255,0,0]);for(const t of s.children)if(t.children){const i=new e(t,n);i.id=t.id,i.name=`SS ${t.name}`,i.parentId=this.id,i.parentName=this.name,this.subDistricts.push(i),this.subDistrictCount++,this.signalCount+=i.signalCount}else if(d.default.isCoordinateValid(t)){const i={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,nodeId:t.nodeId,isKey:t.isKey===1};this.signals.push(i),this.signalCount++}}getAllSignalCoordinates(){const s=[];for(const n of this.signals)s.push([n.longitude,n.latitude]);for(const n of this.subDistricts)s.push(...n.getAllSignalCoordinates());return s}getDarkNonGrayColor(){const s=Math.floor(Math.random()*360),n=80+Math.random()*20,t=15+Math.random()*35,i=n/100*Math.min(t/100,1-t/100),o=r=>{const a=(r+s/30)%12,l=t/100-i*Math.max(Math.min(a-3,9-a,1),-1);return Math.round(255*l)};return[o(0),o(8),o(4)]}}exports.default=e;
@@ -5,10 +5,11 @@ declare const districtSolidLineLayerOptions: any;
5
5
  /** 子区图层 */
6
6
  declare const subDistrictLayerOptions: any;
7
7
  declare const subDistrictPointLayerOptions: any;
8
+ declare const subDistrictLineLayerOptions: any;
8
9
  /** 信号机圆点图层 */
9
10
  declare const signalMarkerLayerOptions: any;
10
11
  /** 信号机图标图层 */
11
12
  declare const signalPictureLayerOptions: any;
12
13
  /** 信号机聚合图层 */
13
14
  declare const signalClusterLayerOptions: any;
14
- export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions, subDistrictPointLayerOptions };
15
+ export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions, subDistrictLineLayerOptions, subDistrictPointLayerOptions };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",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"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",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"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"signalLayer",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"},{name:"type",type:"string"},{name:"selected",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",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22,.8],size:8,outline:{color:"white",width:0}}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:8,value:9000.954822000003},{size:6,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}},l={id:"signalLayer",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"},{name:"type",type:"string"},{name:"selected",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",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,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: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"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},s={id:"signalLayer",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"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",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:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{type:"CIMMarkerGraphic",geometry:{rings:[[[-15,40],[15,40],[15,20],[-15,20],[-15,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}}],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_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=s;exports.signalMarkerLayerOptions=r;exports.signalPictureLayerOptions=l;exports.subDistrictPointLayerOptions=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",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"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",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"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"subDistrictController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}]},s={id:"signalLayer",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"},{name:"type",type:"string"},{name:"selected",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",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22,.8],size:8,outline:{color:"white",width:0}}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:8,value:9000.954822000003},{size:6,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}},l={id:"signalLayer",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"},{name:"type",type:"string"},{name:"selected",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",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,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: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"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},n={id:"signalLayer",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"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",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:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{type:"CIMMarkerGraphic",geometry:{rings:[[[-15,40],[15,40],[15,20],[-15,20],[-15,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}}],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_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=n;exports.signalMarkerLayerOptions=s;exports.signalPictureLayerOptions=l;exports.subDistrictLineLayerOptions=r;exports.subDistrictPointLayerOptions=i;
@@ -5,6 +5,7 @@ export default class SubDistrictRenderer {
5
5
  private hasGpu;
6
6
  private clickHandler;
7
7
  private subDistrictPointLayer;
8
+ private subDistrictLineLayer;
8
9
  constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
9
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
10
11
  clearSubDistricts(): Promise<void>;
@@ -23,7 +24,15 @@ export default class SubDistrictRenderer {
23
24
  count: number;
24
25
  parentId: string;
25
26
  }>;
27
+ /**
28
+ * 按照区控、子区id显示子区
29
+ * @param type 类型,district 或 subDistrict
30
+ * @param id
31
+ */
26
32
  filter(type: string, id: string): void;
33
+ /**
34
+ * 重置过滤器,显示所有子区
35
+ */
27
36
  resetFilter(): void;
28
37
  private currentRenderer;
29
38
  private viewHitTest;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@arcgis/core/Graphic"),o=require("@arcgis/core/layers/FeatureLayer"),c=require("./layer-symbol.js");class l{constructor(e,i){this.view=e,this.hasGpu=i,this.subDistrictPointLayer=new o(c.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=e.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.view.map.add(this.subDistrictPointLayer),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this))}async showSubDistricts(e){await this.clearSubDistricts();let i=0;const s=[],r=[];e.forEach(t=>{r.push({value:t.id,label:t.name,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[...t.areaColor],width:4}}}),t.signals.forEach(a=>{const u=new n({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:i++,id:a.id,name:a.name,subDistrictId:t.id,subDistrictName:t.name,districtId:t.parentId,districtName:t.parentName,signalCount:t.signalCount,color:t.areaColor.join(","),type:"subDistrict"}});s.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:"gray",size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:s}),await this.view.goTo(s,{duration:this.hasGpu?1e3:0})}async clearSubDistricts(){const e=await this.subDistrictPointLayer.queryFeatures();e.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictPointLayer.definitionExpression="1=1"}setVisible(e){this.subDistrictPointLayer.visible=e}async locateSubDistrict(e){const i=this.subDistrictPointLayer.createQuery();i.where=`subDistrictId = '${e}'`,i.returnGeometry=!0;const s=await this.subDistrictPointLayer.queryFeatures(i);return s.features.length>0?(await this.view.goTo(s.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}async highlightSubDistrict(e){let i="";const s=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${e}'`;const r=await this.subDistrictPointLayer.queryFeatures(),t=r.features.length;return t>0?(i=r.features[0].attributes.districtId,await this.view.goTo(r.features,{duration:this.hasGpu?1e3:0})):this.subDistrictPointLayer.definitionExpression=s,{count:t,parentId:i}}filter(e,i){const s=`${e==="district"?"districtId":"subDistrictId"} = '${i}'`;this.subDistrictPointLayer.definitionExpression=s}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1"}async viewHitTest(e){var r;const s=(r=(await this.view.hitTest(e,{include:[this.subDistrictPointLayer]})).results)==null?void 0:r.filter(t=>t.type==="graphic");if(s.length===0)this.currentRenderer&&(this.subDistrictPointLayer.renderer=this.currentRenderer);else{const t=s[0].graphic;this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:t.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:t.attributes.color.split(",").map(Number),width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/FeatureLayer"),n=require("./layer-symbol.js");class l{constructor(i,s){this.view=i,this.hasGpu=s,this.subDistrictPointLayer=new u(n.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=i.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new u(n.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=i.spatialReference,this.subDistrictLineLayer.popupEnabled=!1,this.view.map.add(this.subDistrictPointLayer)}async showSubDistricts(i){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const t=[],r=[];i.forEach(e=>{r.push({value:e.id,label:e.name,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[...e.areaColor],width:4}}}),e.signals.forEach(a=>{const o=new c({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.id,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount,color:e.areaColor.join(","),type:"subDistrict"}});t.push(o)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:"gray",size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:t}),await this.view.goTo(t,{duration:this.hasGpu?1e3:0})}async clearSubDistricts(){var t;const i=await this.subDistrictPointLayer.queryFeatures();i.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:i.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",(t=this.clickHandler)==null||t.remove()}setVisible(i){this.subDistrictPointLayer.visible=i,this.subDistrictLineLayer.visible=i}async locateSubDistrict(i){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${i}'`,s.returnGeometry=!0;const t=await this.subDistrictPointLayer.queryFeatures(s);return t.features.length>0?(await this.view.goTo(t.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(i){let s="";const t=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${i}'`;const r=await this.subDistrictPointLayer.queryFeatures(),e=r.features.length;return e>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${i}'`,s=r.features[0].attributes.districtId,await this.view.goTo(r.features,{duration:this.hasGpu?1e3:0})):this.subDistrictPointLayer.definitionExpression=t,{count:e,parentId:s}}filter(i,s){const t=`${i==="district"?"districtId":"subDistrictId"} = '${s}'`;this.subDistrictPointLayer.definitionExpression=t,this.subDistrictLineLayer.definitionExpression=t}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(i){var r;const t=(r=(await this.view.hitTest(i,{include:[this.subDistrictPointLayer]})).results)==null?void 0:r.filter(e=>e.type==="graphic");if(t.length===0)this.currentRenderer&&(this.subDistrictPointLayer.renderer=this.currentRenderer);else{const e=t[0].graphic;this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:e.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:e.attributes.color.split(",").map(Number),width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.230",
3
+ "version": "1.0.231",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [