gisviewer-vue3-arcgis 1.0.229 → 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 };
@@ -176,6 +176,10 @@ const e = {
176
176
  {
177
177
  name: "type",
178
178
  type: "string"
179
+ },
180
+ {
181
+ name: "color",
182
+ type: "string"
179
183
  }
180
184
  ],
181
185
  popupTemplate: {
@@ -201,6 +205,58 @@ const e = {
201
205
  ]
202
206
  }
203
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 = {
204
260
  id: "signalLayer",
205
261
  source: [],
206
262
  objectIdField: "ObjectID",
@@ -376,7 +432,7 @@ const e = {
376
432
  }
377
433
  ]
378
434
  }
379
- }, l = {
435
+ }, s = {
380
436
  id: "signalLayer",
381
437
  source: [],
382
438
  objectIdField: "ObjectID",
@@ -688,7 +744,7 @@ const e = {
688
744
  }
689
745
  ]
690
746
  }
691
- }, s = {
747
+ }, a = {
692
748
  id: "signalLayer",
693
749
  source: [],
694
750
  objectIdField: "ObjectID",
@@ -906,8 +962,9 @@ const e = {
906
962
  export {
907
963
  e as districtDashLineLayerOptions,
908
964
  t as districtSolidLineLayerOptions,
909
- s as signalClusterLayerOptions,
910
- r as signalMarkerLayerOptions,
911
- l as signalPictureLayerOptions,
965
+ a as signalClusterLayerOptions,
966
+ l as signalMarkerLayerOptions,
967
+ s as signalPictureLayerOptions,
968
+ r as subDistrictLineLayerOptions,
912
969
  i as subDistrictPointLayerOptions
913
970
  };
@@ -8,7 +8,6 @@ export default class SignalControlAreaController1 {
8
8
  private districtRenderer;
9
9
  private subDistrictRenderer;
10
10
  private signalRenderer;
11
- /** 子区图层 */
12
11
  private clickHandler;
13
12
  private districtControllerOid;
14
13
  private subDistrictControllerOid;
@@ -3,7 +3,9 @@ import DistrictController from './district-controller';
3
3
  export default class SubDistrictRenderer {
4
4
  private view;
5
5
  private hasGpu;
6
+ private clickHandler;
6
7
  private subDistrictPointLayer;
8
+ private subDistrictLineLayer;
7
9
  constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
8
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
9
11
  clearSubDistricts(): Promise<void>;
@@ -22,6 +24,16 @@ export default class SubDistrictRenderer {
22
24
  count: number;
23
25
  parentId: string;
24
26
  }>;
27
+ /**
28
+ * 按照区控、子区id显示子区
29
+ * @param type 类型,district 或 subDistrict
30
+ * @param id
31
+ */
25
32
  filter(type: string, id: string): void;
33
+ /**
34
+ * 重置过滤器,显示所有子区
35
+ */
26
36
  resetFilter(): void;
37
+ private currentRenderer;
38
+ private viewHitTest;
27
39
  }
@@ -1,50 +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, i) {
6
- this.view = t, this.hasGpu = i, 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);
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 i = 0;
13
- const s = [], r = [];
14
- t.forEach((e) => {
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: e.id,
17
- label: e.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
- // color: [...controller.areaColor, 0.5],
23
24
  size: "8px",
24
25
  outline: {
25
- color: [...e.areaColor],
26
+ color: [...t.areaColor],
26
27
  width: 4
27
28
  }
28
29
  }
29
- }), e.signals.forEach((a) => {
30
- const u = new n({
30
+ }), t.signals.forEach((a) => {
31
+ const n = new o({
31
32
  geometry: {
32
33
  type: "point",
33
34
  longitude: a.longitude,
34
35
  latitude: a.latitude
35
36
  },
36
37
  attributes: {
37
- ObjectID: i++,
38
+ ObjectID: s++,
38
39
  id: a.id,
39
40
  name: a.name,
40
- subDistrictId: e.id,
41
- subDistrictName: e.name,
42
- districtId: e.parentId,
43
- districtName: e.parentName,
44
- signalCount: e.signalCount
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(","),
47
+ type: "subDistrict"
45
48
  }
46
49
  });
47
- s.push(u);
50
+ e.push(n);
48
51
  });
49
52
  }), this.subDistrictPointLayer.renderer = {
50
53
  type: "unique-value",
@@ -88,55 +91,139 @@ class b {
88
91
  ]
89
92
  }
90
93
  ]
91
- }, await this.subDistrictPointLayer.applyEdits({
92
- addFeatures: s
93
- }), await this.view.goTo(s, {
94
+ }, this.currentRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
95
+ addFeatures: e
96
+ }), await this.view.goTo(e, {
94
97
  duration: this.hasGpu ? 1e3 : 0
95
98
  });
96
99
  }
97
100
  async clearSubDistricts() {
98
- const t = await this.subDistrictPointLayer.queryFeatures();
99
- t.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
100
- 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
101
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();
102
110
  }
103
- setVisible(t) {
104
- this.subDistrictPointLayer.visible = t;
111
+ setVisible(i) {
112
+ this.subDistrictPointLayer.visible = i, this.subDistrictLineLayer.visible = i;
105
113
  }
106
114
  /**
107
115
  * 定位子区
108
116
  * @param id 子区ID
109
117
  */
110
- async locateSubDistrict(t) {
111
- const i = this.subDistrictPointLayer.createQuery();
112
- i.where = `subDistrictId = '${t}'`, i.returnGeometry = !0;
113
- const s = await this.subDistrictPointLayer.queryFeatures(i);
114
- 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, {
115
123
  duration: this.hasGpu ? 1e3 : 0
116
- }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
124
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
117
125
  }
118
126
  /**
119
127
  * 高亮子区, 其他子区隐藏
120
128
  * @param id 子区ID
121
129
  * @return 返回高亮子区的数量以及区控id
122
130
  */
123
- async highlightSubDistrict(t) {
124
- let i = "";
125
- const s = this.subDistrictPointLayer.definitionExpression;
126
- this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${t}'`;
127
- const r = await this.subDistrictPointLayer.queryFeatures(), e = r.features.length;
128
- return e > 0 ? (i = 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, {
129
137
  duration: this.hasGpu ? 1e3 : 0
130
- })) : this.subDistrictPointLayer.definitionExpression = s, { count: e, parentId: i };
138
+ })) : this.subDistrictPointLayer.definitionExpression = e, { count: t, parentId: s };
131
139
  }
132
- filter(t, i) {
133
- const s = `${t === "district" ? "districtId" : "subDistrictId"} = '${i}'`;
134
- 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;
135
148
  }
149
+ /**
150
+ * 重置过滤器,显示所有子区
151
+ */
136
152
  resetFilter() {
137
- this.subDistrictPointLayer.definitionExpression = "1=1";
153
+ this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
154
+ }
155
+ async viewHitTest(i) {
156
+ var r;
157
+ const e = (r = (await this.view.hitTest(i, {
158
+ include: [this.subDistrictPointLayer]
159
+ })).results) == null ? void 0 : r.filter(
160
+ (t) => t.type === "graphic"
161
+ );
162
+ if (e.length === 0)
163
+ this.currentRenderer && (this.subDistrictPointLayer.renderer = this.currentRenderer);
164
+ else {
165
+ const t = e[0].graphic;
166
+ this.subDistrictPointLayer.renderer = {
167
+ type: "unique-value",
168
+ field: "subDistrictId",
169
+ defaultSymbol: {
170
+ type: "simple-marker",
171
+ style: "circle",
172
+ color: [0, 0, 0, 0],
173
+ size: "8px",
174
+ outline: {
175
+ color: [180, 180, 180, 0.5],
176
+ width: 4
177
+ }
178
+ },
179
+ defaultLabel: "其他子区",
180
+ uniqueValueInfos: [
181
+ {
182
+ value: t.attributes.subDistrictId,
183
+ symbol: {
184
+ type: "simple-marker",
185
+ style: "circle",
186
+ color: [0, 0, 0, 0],
187
+ size: "8px",
188
+ outline: {
189
+ color: t.attributes.color.split(",").map(Number),
190
+ width: 4
191
+ }
192
+ }
193
+ }
194
+ ],
195
+ visualVariables: [
196
+ {
197
+ type: "size",
198
+ valueExpression: "$view.scale",
199
+ stops: [
200
+ {
201
+ size: 24,
202
+ value: 2500
203
+ },
204
+ {
205
+ size: 20,
206
+ value: 5e3
207
+ },
208
+ {
209
+ size: 8,
210
+ value: 18055.954822000003
211
+ },
212
+ {
213
+ size: 4,
214
+ value: 144447.638572
215
+ },
216
+ {
217
+ size: 2,
218
+ value: 1155581108577e-6
219
+ }
220
+ ]
221
+ }
222
+ ]
223
+ };
224
+ }
138
225
  }
139
226
  }
140
227
  export {
141
- b as default
228
+ y as default
142
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"}],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;
@@ -8,7 +8,6 @@ export default class SignalControlAreaController1 {
8
8
  private districtRenderer;
9
9
  private subDistrictRenderer;
10
10
  private signalRenderer;
11
- /** 子区图层 */
12
11
  private clickHandler;
13
12
  private districtControllerOid;
14
13
  private subDistrictControllerOid;
@@ -3,7 +3,9 @@ import DistrictController from './district-controller';
3
3
  export default class SubDistrictRenderer {
4
4
  private view;
5
5
  private hasGpu;
6
+ private clickHandler;
6
7
  private subDistrictPointLayer;
8
+ private subDistrictLineLayer;
7
9
  constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
8
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
9
11
  clearSubDistricts(): Promise<void>;
@@ -22,6 +24,16 @@ export default class SubDistrictRenderer {
22
24
  count: number;
23
25
  parentId: string;
24
26
  }>;
27
+ /**
28
+ * 按照区控、子区id显示子区
29
+ * @param type 类型,district 或 subDistrict
30
+ * @param id
31
+ */
25
32
  filter(type: string, id: string): void;
33
+ /**
34
+ * 重置过滤器,显示所有子区
35
+ */
26
36
  resetFilter(): void;
37
+ private currentRenderer;
38
+ private viewHitTest;
27
39
  }
@@ -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 d{constructor(t,i){this.view=t,this.hasGpu=i,this.subDistrictPointLayer=new o(c.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=t.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.view.map.add(this.subDistrictPointLayer)}async showSubDistricts(t){await this.clearSubDistricts();let i=0;const s=[],r=[];t.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 u=new n({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:i++,id:a.id,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount}});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}]}]},await this.subDistrictPointLayer.applyEdits({addFeatures:s}),await this.view.goTo(s,{duration:this.hasGpu?1e3:0})}async clearSubDistricts(){const t=await this.subDistrictPointLayer.queryFeatures();t.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:t.features}),this.subDistrictPointLayer.definitionExpression="1=1"}setVisible(t){this.subDistrictPointLayer.visible=t}async locateSubDistrict(t){const i=this.subDistrictPointLayer.createQuery();i.where=`subDistrictId = '${t}'`,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(t){let i="";const s=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${t}'`;const r=await this.subDistrictPointLayer.queryFeatures(),e=r.features.length;return e>0?(i=r.features[0].attributes.districtId,await this.view.goTo(r.features,{duration:this.hasGpu?1e3:0})):this.subDistrictPointLayer.definitionExpression=s,{count:e,parentId:i}}filter(t,i){const s=`${t==="district"?"districtId":"subDistrictId"} = '${i}'`;this.subDistrictPointLayer.definitionExpression=s}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1"}}exports.default=d;
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.229",
3
+ "version": "1.0.231",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [