gisviewer-vue3-arcgis 1.0.227 → 1.0.228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/es/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +2 -1
  2. package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +22 -15
  3. package/es/src/gis-map/utils/signal-control-area-controller/layer-symbol.d.ts +8 -1
  4. package/es/src/gis-map/utils/signal-control-area-controller/layer-symbol.mjs +74 -56
  5. package/es/src/gis-map/utils/signal-control-area-controller/renderer/district-renderer.d.ts +40 -0
  6. package/es/src/gis-map/utils/signal-control-area-controller/renderer/district-renderer.mjs +123 -0
  7. package/es/src/gis-map/utils/signal-control-area-controller/renderer/signal-renderer.d.ts +22 -0
  8. package/es/src/gis-map/utils/signal-control-area-controller/renderer/signal-renderer.mjs +124 -0
  9. package/es/src/gis-map/utils/signal-control-area-controller/renderer/sub-district-renderer.d.ts +27 -0
  10. package/es/src/gis-map/utils/signal-control-area-controller/renderer/sub-district-renderer.mjs +142 -0
  11. package/es/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +4 -14
  12. package/es/src/gis-map/utils/signal-control-area-controller/show-area.mjs +284 -341
  13. package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +2 -1
  14. package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.js +1 -1
  15. package/lib/src/gis-map/utils/signal-control-area-controller/layer-symbol.d.ts +8 -1
  16. package/lib/src/gis-map/utils/signal-control-area-controller/layer-symbol.js +1 -1
  17. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/district-renderer.d.ts +40 -0
  18. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/district-renderer.js +1 -0
  19. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/signal-renderer.d.ts +22 -0
  20. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/signal-renderer.js +1 -0
  21. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/sub-district-renderer.d.ts +27 -0
  22. package/lib/src/gis-map/utils/signal-control-area-controller/renderer/sub-district-renderer.js +1 -0
  23. package/lib/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +4 -14
  24. package/lib/src/gis-map/utils/signal-control-area-controller/show-area.js +1 -1
  25. package/package.json +1 -1
@@ -15,7 +15,7 @@ export default class DistrictController {
15
15
  parentName: string;
16
16
  signals: ICross[];
17
17
  subDistricts: DistrictController[];
18
- areaColor: number[];
18
+ areaColor: [number, number, number];
19
19
  signalCount: number;
20
20
  subDistrictCount: number;
21
21
  constructor(params: any, style: string);
@@ -24,5 +24,6 @@ export default class DistrictController {
24
24
  * @returns
25
25
  */
26
26
  getAllSignalCoordinates(): number[][];
27
+ private getDarkNonGrayColor;
27
28
  }
28
29
  export {};
@@ -1,13 +1,13 @@
1
- import o from "../common-utils.mjs";
2
- class e {
3
- constructor(i, n) {
4
- this.parentName = "", this.signals = [], this.subDistricts = [], this.signalCount = 0, this.subDistrictCount = 0, this.id = i.name, this.name = i.areaDesc, this.parentId = i.parentId, this.areaColor = n === "alarm" ? [255, 0, 0] : [61, 139, 249];
5
- for (const t of i.children)
1
+ import d from "../common-utils.mjs";
2
+ class r {
3
+ constructor(s, n) {
4
+ 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]);
5
+ for (const t of s.children)
6
6
  if (t.children) {
7
- const s = new e(t, n);
8
- s.id = t.id, s.name = `SS ${t.name}`, s.parentId = this.id, s.parentName = this.name, this.subDistricts.push(s), this.subDistrictCount++, this.signalCount += s.signalCount;
9
- } else if (o.isCoordinateValid(t)) {
10
- const s = {
7
+ const i = new r(t, n);
8
+ 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;
9
+ } else if (d.isCoordinateValid(t)) {
10
+ const i = {
11
11
  id: t.id,
12
12
  name: t.name,
13
13
  parentId: t.parentId,
@@ -17,7 +17,7 @@ class e {
17
17
  nodeId: t.nodeId,
18
18
  isKey: t.isKey === 1
19
19
  };
20
- this.signals.push(s), this.signalCount++;
20
+ this.signals.push(i), this.signalCount++;
21
21
  }
22
22
  }
23
23
  /**
@@ -25,14 +25,21 @@ class e {
25
25
  * @returns
26
26
  */
27
27
  getAllSignalCoordinates() {
28
- const i = [];
28
+ const s = [];
29
29
  for (const n of this.signals)
30
- i.push([n.longitude, n.latitude]);
30
+ s.push([n.longitude, n.latitude]);
31
31
  for (const n of this.subDistricts)
32
- i.push(...n.getAllSignalCoordinates());
33
- return i;
32
+ s.push(...n.getAllSignalCoordinates());
33
+ return s;
34
+ }
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) => {
37
+ const a = (e + s / 30) % 12, l = t / 100 - i * Math.max(Math.min(a - 3, 9 - a, 1), -1);
38
+ return Math.round(255 * l);
39
+ };
40
+ return [o(0), o(8), o(4)];
34
41
  }
35
42
  }
36
43
  export {
37
- e as default
44
+ r as default
38
45
  };
@@ -1,7 +1,14 @@
1
+ /** 区控的虚线边框图层 */
1
2
  declare const districtDashLineLayerOptions: any;
3
+ /** 区控的实线边框图层 */
2
4
  declare const districtSolidLineLayerOptions: any;
5
+ /** 子区图层 */
3
6
  declare const subDistrictLayerOptions: any;
7
+ declare const subDistrictPointLayerOptions: any;
8
+ /** 信号机圆点图层 */
4
9
  declare const signalMarkerLayerOptions: any;
10
+ /** 信号机图标图层 */
5
11
  declare const signalPictureLayerOptions: any;
12
+ /** 信号机聚合图层 */
6
13
  declare const signalClusterLayerOptions: any;
7
- export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions };
14
+ export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions, subDistrictPointLayerOptions };
@@ -135,7 +135,7 @@ const e = {
135
135
  source: [],
136
136
  objectIdField: "ObjectID",
137
137
  outFields: ["*"],
138
- geometryType: "polyline",
138
+ geometryType: "point",
139
139
  fields: [
140
140
  {
141
141
  name: "ObjectID",
@@ -150,11 +150,19 @@ const e = {
150
150
  type: "string"
151
151
  },
152
152
  {
153
- name: "parentId",
153
+ name: "districtId",
154
+ type: "string"
155
+ },
156
+ {
157
+ name: "districtName",
158
+ type: "string"
159
+ },
160
+ {
161
+ name: "subDistrictId",
154
162
  type: "string"
155
163
  },
156
164
  {
157
- name: "parentName",
165
+ name: "subDistrictName",
158
166
  type: "string"
159
167
  },
160
168
  {
@@ -171,17 +179,17 @@ const e = {
171
179
  }
172
180
  ],
173
181
  popupTemplate: {
174
- title: "{name} 子区",
182
+ title: "{subDistrictName} 子区",
175
183
  content: [
176
184
  {
177
185
  type: "fields",
178
186
  fieldInfos: [
179
187
  {
180
- fieldName: "id",
181
- label: "区控编号"
188
+ fieldName: "subDistrictId",
189
+ label: "子区编号"
182
190
  },
183
191
  {
184
- fieldName: "parentName",
192
+ fieldName: "districtName",
185
193
  label: "所属区控"
186
194
  },
187
195
  {
@@ -191,38 +199,8 @@ const e = {
191
199
  ]
192
200
  }
193
201
  ]
194
- },
195
- renderer: {
196
- type: "unique-value",
197
- field: "selected",
198
- defaultSymbol: {
199
- type: "simple-line",
200
- style: "solid",
201
- color: [5, 196, 104],
202
- width: 2
203
- },
204
- uniqueValueInfos: [
205
- {
206
- value: "alert",
207
- symbol: {
208
- type: "simple-line",
209
- style: "solid",
210
- color: [255, 0, 0],
211
- width: 2
212
- }
213
- },
214
- {
215
- value: "false",
216
- symbol: {
217
- type: "simple-line",
218
- style: "solid",
219
- color: [180, 180, 180],
220
- width: 1
221
- }
222
- }
223
- ]
224
202
  }
225
- }, l = {
203
+ }, r = {
226
204
  id: "signalLayer",
227
205
  source: [],
228
206
  objectIdField: "ObjectID",
@@ -316,7 +294,7 @@ const e = {
316
294
  size: 4,
317
295
  outline: {
318
296
  color: "white",
319
- width: 1
297
+ width: 0
320
298
  }
321
299
  },
322
300
  uniqueValueInfos: [
@@ -325,11 +303,11 @@ const e = {
325
303
  symbol: {
326
304
  type: "simple-marker",
327
305
  style: "circle",
328
- color: [254, 172, 22],
329
- size: 12,
306
+ color: [254, 172, 22, 0.8],
307
+ size: 8,
330
308
  outline: {
331
309
  color: "white",
332
- width: 1
310
+ width: 0
333
311
  }
334
312
  }
335
313
  },
@@ -338,11 +316,11 @@ const e = {
338
316
  symbol: {
339
317
  type: "simple-marker",
340
318
  style: "circle",
341
- color: [5, 116, 255],
319
+ color: [5, 116, 255, 0.8],
342
320
  size: 8,
343
321
  outline: {
344
322
  color: "white",
345
- width: 1
323
+ width: 0
346
324
  }
347
325
  }
348
326
  },
@@ -351,11 +329,11 @@ const e = {
351
329
  symbol: {
352
330
  type: "simple-marker",
353
331
  style: "circle",
354
- color: [180, 180, 180],
355
- size: 12,
332
+ color: [180, 180, 180, 0.8],
333
+ size: 8,
356
334
  outline: {
357
335
  color: "white",
358
- width: 1
336
+ width: 0
359
337
  }
360
338
  }
361
339
  },
@@ -364,17 +342,41 @@ const e = {
364
342
  symbol: {
365
343
  type: "simple-marker",
366
344
  style: "circle",
367
- color: [180, 180, 180],
345
+ color: [180, 180, 180, 0.8],
368
346
  size: 8,
369
347
  outline: {
370
348
  color: "white",
371
- width: 1
349
+ width: 0
372
350
  }
373
351
  }
374
352
  }
353
+ ],
354
+ visualVariables: [
355
+ {
356
+ type: "size",
357
+ valueExpression: "$view.scale",
358
+ stops: [
359
+ {
360
+ size: 8,
361
+ value: 9000.954822000003
362
+ },
363
+ {
364
+ size: 6,
365
+ value: 18055.954822000003
366
+ },
367
+ {
368
+ size: 3,
369
+ value: 144447.638572
370
+ },
371
+ {
372
+ size: 2,
373
+ value: 1155581108577e-6
374
+ }
375
+ ]
376
+ }
375
377
  ]
376
378
  }
377
- }, r = {
379
+ }, l = {
378
380
  id: "signalLayer",
379
381
  source: [],
380
382
  objectIdField: "ObjectID",
@@ -551,7 +553,7 @@ const e = {
551
553
  y: 0
552
554
  },
553
555
  anchorPointUnits: "Relative",
554
- size: 40,
556
+ size: 20,
555
557
  rotateClockwise: !0,
556
558
  textureFilter: "Picture",
557
559
  url: "/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"
@@ -655,8 +657,8 @@ const e = {
655
657
  symbol: {
656
658
  type: "picture-marker",
657
659
  url: "/GisViewerAssets/Images/cross/gis_gjxk_gray.png",
658
- width: 40,
659
- height: 40
660
+ width: 20,
661
+ height: 20
660
662
  }
661
663
  },
662
664
  {
@@ -668,6 +670,22 @@ const e = {
668
670
  height: 20
669
671
  }
670
672
  }
673
+ ],
674
+ visualVariables: [
675
+ {
676
+ type: "size",
677
+ valueExpression: "$view.scale",
678
+ stops: [
679
+ {
680
+ size: 28,
681
+ value: 2250
682
+ },
683
+ {
684
+ size: 24,
685
+ value: 4500
686
+ }
687
+ ]
688
+ }
671
689
  ]
672
690
  }
673
691
  }, s = {
@@ -889,7 +907,7 @@ export {
889
907
  e as districtDashLineLayerOptions,
890
908
  t as districtSolidLineLayerOptions,
891
909
  s as signalClusterLayerOptions,
892
- l as signalMarkerLayerOptions,
893
- r as signalPictureLayerOptions,
894
- i as subDistrictLayerOptions
910
+ r as signalMarkerLayerOptions,
911
+ l as signalPictureLayerOptions,
912
+ i as subDistrictPointLayerOptions
895
913
  };
@@ -0,0 +1,40 @@
1
+ import { IResult } from '../../../../types';
2
+ import DistrictController from '../district-controller';
3
+ export default class DistrictRenderer {
4
+ private view;
5
+ /** 区控虚线图层 */
6
+ private districtControllerDashLayer;
7
+ /** 区控实线图层,区控符号由半透明实线+不透明虚线组成 */
8
+ private districtControllerSolidLayer;
9
+ style: string;
10
+ private hasGpu;
11
+ constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
12
+ /**
13
+ * 显示区控
14
+ * @param controllers 区控控制器数组
15
+ */
16
+ showDistricts(controllers: DistrictController[]): Promise<void>;
17
+ /**
18
+ * 清除区控图层
19
+ */
20
+ clearDistricts(): Promise<void>;
21
+ /**
22
+ * 设置区控图层可见性
23
+ * @param visible
24
+ */
25
+ setVisible(visible: boolean): void;
26
+ /**
27
+ * 定位区控
28
+ * @param id
29
+ * @returns
30
+ */
31
+ locateDistrict(id: string): Promise<IResult>;
32
+ /**
33
+ * 高亮区控, 其他区控隐藏
34
+ * @param id 区控ID
35
+ * @return 返回高亮区控的数量
36
+ */
37
+ highlightDistrict(id: string): Promise<number>;
38
+ filter(id: string): void;
39
+ resetFilter(): void;
40
+ }
@@ -0,0 +1,123 @@
1
+ import u from "@arcgis/core/Graphic";
2
+ import n from "@arcgis/core/layers/FeatureLayer";
3
+ import * as a from "@turf/helpers";
4
+ import { convex as y, buffer as p } from "@turf/turf";
5
+ import { districtDashLineLayerOptions as f, districtSolidLineLayerOptions as C } from "../layer-symbol.mjs";
6
+ class S {
7
+ constructor(t, i) {
8
+ this.style = "", this.hasGpu = !0, this.view = t, this.hasGpu = i, this.districtControllerDashLayer = new n(
9
+ f
10
+ ), this.districtControllerDashLayer.spatialReference = t.spatialReference, this.districtControllerSolidLayer = new n(
11
+ C
12
+ ), this.districtControllerSolidLayer.spatialReference = t.spatialReference, this.districtControllerSolidLayer.popupEnabled = !0, this.view.map.addMany([
13
+ this.districtControllerDashLayer,
14
+ this.districtControllerSolidLayer
15
+ ]);
16
+ }
17
+ /**
18
+ * 显示区控
19
+ * @param controllers 区控控制器数组
20
+ */
21
+ async showDistricts(t) {
22
+ await this.clearDistricts();
23
+ const i = [];
24
+ for (let e = 0; e < t.length; e++) {
25
+ const r = t[e], s = r.getAllSignalCoordinates();
26
+ let o = null;
27
+ if (s.length >= 2)
28
+ if (s.length === 2)
29
+ o = a.lineString(s);
30
+ else {
31
+ const h = a.featureCollection(
32
+ s.map((c) => a.point(c))
33
+ );
34
+ o = y(h), o || (o = a.lineString(s));
35
+ }
36
+ else if (s.length === 1)
37
+ o = a.point(s[0]);
38
+ else
39
+ continue;
40
+ const l = p(o.geometry, 200, {
41
+ units: "meters"
42
+ }), d = new u({
43
+ geometry: {
44
+ type: "polyline",
45
+ paths: l.geometry.coordinates
46
+ },
47
+ attributes: {
48
+ ObjectID: e,
49
+ id: r.id,
50
+ name: r.name,
51
+ subDistrictCount: r.subDistrictCount,
52
+ signalCount: r.signalCount,
53
+ parentId: r.parentId,
54
+ parentName: r.parentName,
55
+ selected: this.style,
56
+ type: "district"
57
+ }
58
+ });
59
+ i.push(d);
60
+ }
61
+ await this.districtControllerDashLayer.applyEdits({
62
+ addFeatures: i
63
+ }), await this.districtControllerSolidLayer.applyEdits({
64
+ addFeatures: i
65
+ }), await this.view.goTo(i, {
66
+ duration: this.hasGpu ? 1e3 : 0
67
+ });
68
+ }
69
+ /**
70
+ * 清除区控图层
71
+ */
72
+ async clearDistricts() {
73
+ let t = await this.districtControllerDashLayer.queryFeatures();
74
+ await this.districtControllerDashLayer.applyEdits({
75
+ deleteFeatures: t.features
76
+ }), this.districtControllerDashLayer.definitionExpression = "1=1", t = await this.districtControllerSolidLayer.queryFeatures(), await this.districtControllerSolidLayer.applyEdits({
77
+ deleteFeatures: t.features
78
+ }), this.districtControllerSolidLayer.definitionExpression = "1=1";
79
+ }
80
+ /**
81
+ * 设置区控图层可见性
82
+ * @param visible
83
+ */
84
+ setVisible(t) {
85
+ this.districtControllerDashLayer.visible = t, this.districtControllerSolidLayer.visible = t;
86
+ }
87
+ /**
88
+ * 定位区控
89
+ * @param id
90
+ * @returns
91
+ */
92
+ async locateDistrict(t) {
93
+ const i = this.districtControllerDashLayer.createQuery();
94
+ i.where = `id = '${t}'`, i.returnGeometry = !0, i.outFields = ["*"];
95
+ const e = await this.districtControllerDashLayer.queryFeatures(i);
96
+ return e.features.length > 0 ? (await this.view.goTo(e.features, {
97
+ duration: this.hasGpu ? 1e3 : 0
98
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
99
+ }
100
+ /**
101
+ * 高亮区控, 其他区控隐藏
102
+ * @param id 区控ID
103
+ * @return 返回高亮区控的数量
104
+ */
105
+ async highlightDistrict(t) {
106
+ const i = this.districtControllerDashLayer.definitionExpression;
107
+ this.districtControllerDashLayer.definitionExpression = `id = '${t}'`;
108
+ const e = await this.districtControllerDashLayer.queryFeatures(), r = e.features.length;
109
+ return r > 0 ? (this.districtControllerSolidLayer.definitionExpression = `id = '${t}'`, await this.view.goTo(e.features, {
110
+ duration: this.hasGpu ? 1e3 : 0
111
+ })) : this.districtControllerDashLayer.definitionExpression = i, r;
112
+ }
113
+ filter(t) {
114
+ const i = `id = '${t}'`;
115
+ this.districtControllerDashLayer.definitionExpression = i, this.districtControllerSolidLayer.definitionExpression = i;
116
+ }
117
+ resetFilter() {
118
+ this.districtControllerDashLayer.definitionExpression = "1=1", this.districtControllerSolidLayer.definitionExpression = "1=1";
119
+ }
120
+ }
121
+ export {
122
+ S as default
123
+ };
@@ -0,0 +1,22 @@
1
+ import { IResult } from '../../../../types';
2
+ import DistrictController from '../district-controller';
3
+ export default class CrossRenderer {
4
+ private view;
5
+ private hasGpu;
6
+ private signalMarkerLayer;
7
+ private signalPictureLayer;
8
+ private signalClusterLayer;
9
+ constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
10
+ showSignals(controllers: DistrictController[]): Promise<void>;
11
+ clearSignals(): Promise<void>;
12
+ setPointVisible(visible: boolean): Promise<void>;
13
+ setClusterVisible(visible: boolean): void;
14
+ locateSignal(id: string): Promise<IResult>;
15
+ highlightSignal(id: string): Promise<{
16
+ districtId: string;
17
+ subDistrictId: string;
18
+ count: number;
19
+ }>;
20
+ filter(type: string, id: string): void;
21
+ resetFilter(): void;
22
+ }
@@ -0,0 +1,124 @@
1
+ import d from "@arcgis/core/Graphic";
2
+ import u from "@arcgis/core/layers/FeatureLayer";
3
+ import { signalMarkerLayerOptions as y, signalPictureLayerOptions as c, signalClusterLayerOptions as o } from "../layer-symbol.mjs";
4
+ class f {
5
+ constructor(e, a) {
6
+ this.view = e, this.hasGpu = a, this.signalMarkerLayer = new u(
7
+ y
8
+ ), this.signalMarkerLayer.spatialReference = e.spatialReference, this.signalMarkerLayer.popupEnabled = !0, this.signalPictureLayer = new u(
9
+ c
10
+ ), this.signalPictureLayer.spatialReference = e.spatialReference, this.signalPictureLayer.popupEnabled = !0, this.signalClusterLayer = new u(
11
+ o
12
+ ), this.signalClusterLayer.spatialReference = e.spatialReference, this.signalClusterLayer.popupEnabled = !0, this.view.map.addMany([
13
+ this.signalMarkerLayer,
14
+ this.signalPictureLayer,
15
+ this.signalClusterLayer
16
+ ]);
17
+ }
18
+ async showSignals(e) {
19
+ await this.clearSignals();
20
+ let a = 0;
21
+ const s = [];
22
+ e.forEach((r) => {
23
+ r.signals.forEach((i) => {
24
+ const t = new d({
25
+ geometry: {
26
+ type: "point",
27
+ longitude: i.longitude,
28
+ latitude: i.latitude
29
+ },
30
+ attributes: {
31
+ ObjectID: a++,
32
+ id: i.id,
33
+ name: i.name,
34
+ signalId: i.signalId,
35
+ nodeId: i.nodeId || i.id,
36
+ districtId: r.id,
37
+ districtName: r.name,
38
+ subDistrictId: "",
39
+ subDistrictName: "",
40
+ isKey: i.isKey,
41
+ type: "signal",
42
+ selected: !0
43
+ }
44
+ });
45
+ s.push(t);
46
+ }), r.subDistricts.forEach((i) => {
47
+ i.signals.forEach((t) => {
48
+ const n = new d({
49
+ geometry: {
50
+ type: "point",
51
+ longitude: t.longitude,
52
+ latitude: t.latitude
53
+ },
54
+ attributes: {
55
+ ObjectID: a++,
56
+ id: t.id,
57
+ name: t.name,
58
+ signalId: t.signalId,
59
+ nodeId: t.nodeId || t.id,
60
+ districtId: r.id,
61
+ districtName: r.name,
62
+ subDistrictId: i.id,
63
+ subDistrictName: i.name,
64
+ isKey: t.isKey,
65
+ type: "signal",
66
+ selected: !0
67
+ }
68
+ });
69
+ s.push(n);
70
+ });
71
+ });
72
+ }), await this.signalMarkerLayer.applyEdits({
73
+ addFeatures: s
74
+ }), await this.signalPictureLayer.applyEdits({
75
+ addFeatures: s
76
+ }), await this.signalClusterLayer.applyEdits({
77
+ addFeatures: s
78
+ });
79
+ }
80
+ async clearSignals() {
81
+ let e = await this.signalMarkerLayer.queryFeatures();
82
+ await this.signalMarkerLayer.applyEdits({
83
+ deleteFeatures: e.features
84
+ }), this.signalMarkerLayer.definitionExpression = "1=1", e = await this.signalPictureLayer.queryFeatures(), await this.signalPictureLayer.applyEdits({
85
+ deleteFeatures: e.features
86
+ }), this.signalPictureLayer.definitionExpression = "1=1", e = await this.signalClusterLayer.queryFeatures(), await this.signalClusterLayer.applyEdits({
87
+ deleteFeatures: e.features
88
+ }), this.signalClusterLayer.definitionExpression = "1=1";
89
+ }
90
+ async setPointVisible(e) {
91
+ this.signalMarkerLayer.visible = e, this.signalPictureLayer.visible = e;
92
+ }
93
+ setClusterVisible(e) {
94
+ this.signalClusterLayer.visible = e;
95
+ }
96
+ async locateSignal(e) {
97
+ return { status: 0, message: "ok" };
98
+ }
99
+ async highlightSignal(e) {
100
+ let a = "", s = "";
101
+ const r = this.signalMarkerLayer.definitionExpression;
102
+ this.signalMarkerLayer.definitionExpression = `signalId = '${e}'`;
103
+ const i = await this.signalMarkerLayer.queryFeatures(), t = i.features.length;
104
+ if (t > 0) {
105
+ const n = i.features[0].attributes.districtId || "", l = i.features[0].attributes.subDistrictId || "";
106
+ return await this.view.goTo(i.features, {
107
+ duration: this.hasGpu ? 1e3 : 0
108
+ }), { districtId: n, subDistrictId: l, count: t };
109
+ } else
110
+ this.signalMarkerLayer.definitionExpression = r;
111
+ return { districtId: a, subDistrictId: s, count: t };
112
+ }
113
+ filter(e, a) {
114
+ const s = `${e === "district" ? "districtId" : "subDistrictId"} = '${a}'`;
115
+ this.signalClusterLayer.definitionExpression = s, this.signalMarkerLayer.definitionExpression = s, this.signalPictureLayer.definitionExpression = s;
116
+ }
117
+ resetFilter() {
118
+ const e = "1=1";
119
+ this.signalClusterLayer.definitionExpression = e, this.signalMarkerLayer.definitionExpression = e, this.signalPictureLayer.definitionExpression = e;
120
+ }
121
+ }
122
+ export {
123
+ f as default
124
+ };
@@ -0,0 +1,27 @@
1
+ import { IResult } from '../../../../types';
2
+ import DistrictController from '../district-controller';
3
+ export default class SubDistrictRenderer {
4
+ private view;
5
+ private hasGpu;
6
+ private subDistrictPointLayer;
7
+ constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
8
+ showSubDistricts(controllers: DistrictController[]): Promise<void>;
9
+ clearSubDistricts(): Promise<void>;
10
+ setVisible(visible: boolean): void;
11
+ /**
12
+ * 定位子区
13
+ * @param id 子区ID
14
+ */
15
+ locateSubDistrict(id: string): Promise<IResult>;
16
+ /**
17
+ * 高亮子区, 其他子区隐藏
18
+ * @param id 子区ID
19
+ * @return 返回高亮子区的数量以及区控id
20
+ */
21
+ highlightSubDistrict(id: string): Promise<{
22
+ count: number;
23
+ parentId: string;
24
+ }>;
25
+ filter(type: string, id: string): void;
26
+ resetFilter(): void;
27
+ }