gisviewer-vue3-arcgis 1.0.213 → 1.0.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,803 +1,33 @@
1
- import d from "@arcgis/core/Graphic";
2
- import l from "@arcgis/core/layers/FeatureLayer";
3
- import c from "@turf/buffer";
4
- import p from "@turf/convex";
5
- import * as n from "@turf/helpers";
6
- import m from "concaveman";
7
- import h from "../../stores/index.mjs";
8
- import g from "./district-controller.mjs";
9
- class S {
10
- constructor(e) {
11
- var t;
12
- this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0, this.districtGraphics = [], this.subDistrictGraphics = [], this.signalGraphics = [], this.view = e, this.hasGpu = localStorage.getItem("gpu") !== "Unknown";
13
- const s = h.useAppDataStore.mapConfig;
14
- this.openDriveServer = (t = s.openDriveServer) == null ? void 0 : t.url, this.districtControllerDashLayer = new l({
15
- id: "districtController",
16
- spatialReference: e.spatialReference,
17
- source: [],
18
- objectIdField: "ObjectID",
19
- geometryType: "polyline",
20
- outFields: ["*"],
21
- fields: [
22
- {
23
- name: "ObjectID",
24
- type: "oid"
25
- },
26
- {
27
- name: "id",
28
- type: "string"
29
- },
30
- {
31
- name: "name",
32
- type: "string"
33
- },
34
- {
35
- name: "subDistrictCount",
36
- type: "integer"
37
- },
38
- {
39
- name: "signalCount",
40
- type: "integer"
41
- }
42
- ],
43
- renderer: {
44
- type: "simple",
45
- symbol: {
46
- type: "simple-line",
47
- style: "long-dash",
48
- color: [111, 100, 255],
49
- width: 3
50
- }
51
- }
52
- }), this.districtControllerSolidLayer = new l({
53
- id: "districtController",
54
- spatialReference: e.spatialReference,
55
- source: [],
56
- objectIdField: "ObjectID",
57
- outFields: ["*"],
58
- geometryType: "polyline",
59
- fields: [
60
- {
61
- name: "ObjectID",
62
- type: "oid"
63
- },
64
- {
65
- name: "id",
66
- type: "string"
67
- },
68
- {
69
- name: "name",
70
- type: "string"
71
- },
72
- {
73
- name: "subDistrictCount",
74
- type: "integer"
75
- },
76
- {
77
- name: "signalCount",
78
- type: "integer"
79
- }
80
- ],
81
- popupTemplate: {
82
- title: "{name}",
83
- content: [
84
- {
85
- type: "fields",
86
- fieldInfos: [
87
- {
88
- fieldName: "id",
89
- label: "区控编号"
90
- },
91
- {
92
- fieldName: "subDistrictCount",
93
- label: "子区数量"
94
- },
95
- {
96
- fieldName: "signalCount",
97
- label: "信号机数量"
98
- }
99
- ]
100
- }
101
- ]
102
- },
103
- renderer: {
104
- type: "simple",
105
- symbol: {
106
- type: "simple-line",
107
- style: "solid",
108
- color: [111, 100, 255, 0.4],
109
- width: 3
110
- }
111
- }
112
- }), this.subDistrictControllerLayer = new l({
113
- id: "subDistrictController",
114
- spatialReference: e.spatialReference,
115
- source: [],
116
- objectIdField: "ObjectID",
117
- outFields: ["*"],
118
- geometryType: "polyline",
119
- fields: [
120
- {
121
- name: "ObjectID",
122
- type: "oid"
123
- },
124
- {
125
- name: "id",
126
- type: "string"
127
- },
128
- {
129
- name: "name",
130
- type: "string"
131
- },
132
- {
133
- name: "parentId",
134
- type: "string"
135
- },
136
- {
137
- name: "parentName",
138
- type: "string"
139
- },
140
- {
141
- name: "signalCount",
142
- type: "integer"
143
- },
144
- {
145
- name: "style",
146
- type: "string"
147
- }
148
- ],
149
- popupTemplate: {
150
- title: "{name} 子区",
151
- content: [
152
- {
153
- type: "fields",
154
- fieldInfos: [
155
- {
156
- fieldName: "id",
157
- label: "区控编号"
158
- },
159
- {
160
- fieldName: "parentName",
161
- label: "所属区控"
162
- },
163
- {
164
- fieldName: "signalCount",
165
- label: "信号机数量"
166
- }
167
- ]
168
- }
169
- ]
170
- },
171
- renderer: {
172
- type: "unique-value",
173
- field: "style",
174
- defaultSymbol: {
175
- type: "simple-line",
176
- style: "solid",
177
- color: [5, 196, 104],
178
- width: 3
179
- },
180
- uniqueValueInfos: [
181
- {
182
- value: "alert",
183
- symbol: {
184
- type: "simple-line",
185
- style: "solid",
186
- color: [255, 0, 0],
187
- width: 3
188
- }
189
- }
190
- ]
191
- }
192
- }), this.signalMarkerLayer = new l({
193
- id: "signalLayer",
194
- spatialReference: e.spatialReference,
195
- source: [],
196
- objectIdField: "ObjectID",
197
- outFields: ["*"],
198
- geometryType: "point",
199
- maxScale: 5e3,
200
- fields: [
201
- {
202
- name: "ObjectID",
203
- type: "oid"
204
- },
205
- {
206
- name: "id",
207
- type: "string"
208
- },
209
- {
210
- name: "name",
211
- type: "string"
212
- },
213
- {
214
- name: "signalId",
215
- type: "string"
216
- },
217
- {
218
- name: "nodeId",
219
- type: "string"
220
- },
221
- {
222
- name: "isKey",
223
- type: "string"
224
- },
225
- {
226
- name: "districtId",
227
- type: "string"
228
- },
229
- {
230
- name: "districtName",
231
- type: "string"
232
- },
233
- {
234
- name: "subDistrictId",
235
- type: "string"
236
- },
237
- {
238
- name: "subDistrictName",
239
- type: "string"
240
- }
241
- ],
242
- popupTemplate: {
243
- title: "{name}信号机",
244
- content: [
245
- {
246
- type: "fields",
247
- fieldInfos: [
248
- {
249
- fieldName: "districtName",
250
- label: "区控名称"
251
- },
252
- {
253
- fieldName: "subDistrictName",
254
- label: "子区名称"
255
- },
256
- {
257
- fieldName: "signalId",
258
- label: "信号机编号"
259
- },
260
- {
261
- fieldName: "nodeId",
262
- label: "路口编号"
263
- }
264
- ]
265
- }
266
- ]
267
- },
268
- renderer: {
269
- type: "unique-value",
270
- field: "isKey",
271
- defaultSymbol: {
272
- type: "simple-marker",
273
- style: "circle",
274
- color: "gray",
275
- size: 4,
276
- outline: {
277
- color: "white",
278
- width: 1
279
- }
280
- },
281
- uniqueValueInfos: [
282
- {
283
- value: "true",
284
- symbol: {
285
- type: "simple-marker",
286
- style: "circle",
287
- color: [254, 172, 22],
288
- size: 12,
289
- outline: {
290
- color: "white",
291
- width: 1
292
- }
293
- }
294
- },
295
- {
296
- value: "false",
297
- symbol: {
298
- type: "simple-marker",
299
- style: "circle",
300
- color: [5, 116, 255],
301
- size: 8,
302
- outline: {
303
- color: "white",
304
- width: 1
305
- }
306
- }
307
- }
308
- ]
309
- }
310
- }), this.signalClusterLayer = new l({
311
- id: "signalLayer",
312
- spatialReference: e.spatialReference,
313
- source: [],
314
- objectIdField: "ObjectID",
315
- outFields: ["*"],
316
- geometryType: "point",
317
- maxScale: 5e3,
318
- fields: [
319
- {
320
- name: "ObjectID",
321
- type: "oid"
322
- },
323
- {
324
- name: "id",
325
- type: "string"
326
- },
327
- {
328
- name: "name",
329
- type: "string"
330
- },
331
- {
332
- name: "signalId",
333
- type: "string"
334
- },
335
- {
336
- name: "nodeId",
337
- type: "string"
338
- },
339
- {
340
- name: "isKey",
341
- type: "string"
342
- },
343
- {
344
- name: "districtId",
345
- type: "string"
346
- },
347
- {
348
- name: "districtName",
349
- type: "string"
350
- },
351
- {
352
- name: "subDistrictId",
353
- type: "string"
354
- },
355
- {
356
- name: "subDistrictName",
357
- type: "string"
358
- }
359
- ],
360
- featureReduction: {
361
- type: "cluster",
362
- clusterRadius: "120px",
363
- clusterMaxSize: "50px",
364
- clusterMinSize: "30px",
365
- symbol: {
366
- type: "cim",
367
- data: {
368
- type: "CIMSymbolReference",
369
- primitiveOverrides: [
370
- {
371
- // 将textGraphic的TextString替换为graphic.attributes.name
372
- type: "CIMPrimitiveOverride",
373
- primitiveName: "textGraphic",
374
- propertyName: "TextString",
375
- valueExpressionInfo: {
376
- type: "CIMExpressionInfo",
377
- title: "Custom",
378
- expression: "$feature.cluster_count",
379
- returnType: "Default"
380
- }
381
- }
382
- ],
383
- symbol: {
384
- type: "CIMPointSymbol",
385
- symbolLayers: [
386
- // 路口名称
387
- {
388
- type: "CIMVectorMarker",
389
- size: 32,
390
- colorLocked: !0,
391
- anchorPointUnits: "Relative",
392
- frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
393
- markerGraphics: [
394
- {
395
- type: "CIMMarkerGraphic",
396
- primitiveName: "textGraphic",
397
- geometry: { x: 0, y: 0 },
398
- symbol: {
399
- type: "CIMTextSymbol",
400
- height: 16,
401
- horizontalAlignment: "Center",
402
- offsetX: 0,
403
- offsetY: 30,
404
- symbol: {
405
- type: "CIMPolygonSymbol",
406
- symbolLayers: [
407
- {
408
- type: "CIMSolidFill",
409
- enable: !0,
410
- color: [255, 255, 255, 255]
411
- }
412
- ]
413
- },
414
- verticalAlignment: "Center"
415
- },
416
- textString: ""
417
- },
418
- {
419
- type: "CIMMarkerGraphic",
420
- geometry: {
421
- rings: [
422
- [
423
- [-15, 40],
424
- [15, 40],
425
- [15, 20],
426
- [-15, 20],
427
- [-15, 40]
428
- ]
429
- ]
430
- },
431
- symbol: {
432
- type: "CIMPolygonSymbol",
433
- symbolLayers: [
434
- {
435
- type: "CIMSolidFill",
436
- enable: !0,
437
- color: [2, 72, 200, 255]
438
- },
439
- // 边框
440
- {
441
- type: "CIMSolidStroke",
442
- enable: !0,
443
- width: 5,
444
- color: [2, 72, 200, 128]
445
- }
446
- ]
447
- }
448
- }
449
- ],
450
- scaleSymbolsProportionally: !0,
451
- respectFrame: !0
452
- },
453
- // 路口图标
454
- {
455
- type: "CIMPictureMarker",
456
- enable: !0,
457
- anchorPoint: {
458
- x: 0,
459
- y: 0
460
- },
461
- anchorPointUnits: "Relative",
462
- size: 40,
463
- rotateClockwise: !0,
464
- textureFilter: "Picture",
465
- url: "/GisViewerAssets/Images/cross/gis_xhj_blue.png"
466
- }
467
- ]
468
- }
469
- }
470
- },
471
- popupTemplate: {
472
- title: "聚合详情",
473
- content: "聚合信号机 <b>{cluster_count}</b> 个",
474
- fieldInfos: [
475
- {
476
- fieldName: "cluster_count",
477
- format: {
478
- digitSeparator: !0,
479
- places: 0
480
- }
481
- }
482
- ]
483
- }
484
- },
485
- popupTemplate: {
486
- title: "{name}信号机",
487
- content: [
488
- {
489
- type: "fields",
490
- fieldInfos: [
491
- {
492
- fieldName: "districtName",
493
- label: "区控名称"
494
- },
495
- {
496
- fieldName: "subDistrictName",
497
- label: "子区名称"
498
- },
499
- {
500
- fieldName: "signalId",
501
- label: "信号机编号"
502
- },
503
- {
504
- fieldName: "nodeId",
505
- label: "路口编号"
506
- }
507
- ]
508
- }
509
- ]
510
- },
511
- renderer: {
512
- type: "simple",
513
- symbol: {
514
- type: "simple-marker",
515
- style: "circle",
516
- color: [5, 116, 255],
517
- size: 8,
518
- outline: {
519
- color: "white",
520
- width: 1
521
- }
522
- }
523
- }
524
- }), this.signalPictureLayer = new l({
525
- id: "signalLayer",
526
- spatialReference: e.spatialReference,
527
- source: [],
528
- objectIdField: "ObjectID",
529
- outFields: ["*"],
530
- geometryType: "point",
531
- minScale: 5e3,
532
- fields: [
533
- {
534
- name: "ObjectID",
535
- type: "oid"
536
- },
537
- {
538
- name: "id",
539
- type: "string"
540
- },
541
- {
542
- name: "name",
543
- type: "string"
544
- },
545
- {
546
- name: "signalId",
547
- type: "string"
548
- },
549
- {
550
- name: "nodeId",
551
- type: "string"
552
- },
553
- {
554
- name: "isKey",
555
- type: "string"
556
- },
557
- {
558
- name: "districtId",
559
- type: "string"
560
- },
561
- {
562
- name: "districtName",
563
- type: "string"
564
- },
565
- {
566
- name: "subDistrictId",
567
- type: "string"
568
- },
569
- {
570
- name: "subDistrictName",
571
- type: "string"
572
- }
573
- ],
574
- popupTemplate: {
575
- title: "{name}信号机",
576
- content: [
577
- {
578
- type: "fields",
579
- fieldInfos: [
580
- {
581
- fieldName: "districtName",
582
- label: "区控名称"
583
- },
584
- {
585
- fieldName: "subDistrictName",
586
- label: "子区名称"
587
- },
588
- {
589
- fieldName: "signalId",
590
- label: "信号机编号"
591
- },
592
- {
593
- fieldName: "nodeId",
594
- label: "路口编号"
595
- }
596
- ]
597
- }
598
- ]
599
- },
600
- renderer: {
601
- type: "unique-value",
602
- field: "isKey",
603
- defaultSymbol: {
604
- type: "simple-marker",
605
- style: "circle",
606
- color: "gray",
607
- size: 4,
608
- outline: {
609
- color: "white",
610
- width: 1
611
- }
612
- },
613
- uniqueValueInfos: [
614
- {
615
- value: "true",
616
- symbol: {
617
- type: "cim",
618
- data: {
619
- type: "CIMSymbolReference",
620
- primitiveOverrides: [
621
- {
622
- // 将textGraphic的TextString替换为graphic.attributes.name
623
- type: "CIMPrimitiveOverride",
624
- primitiveName: "textGraphic",
625
- propertyName: "TextString",
626
- valueExpressionInfo: {
627
- type: "CIMExpressionInfo",
628
- title: "Custom",
629
- expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
630
- returnType: "Default"
631
- }
632
- }
633
- ],
634
- symbol: {
635
- type: "CIMPointSymbol",
636
- symbolLayers: [
637
- // 路口名称
638
- {
639
- type: "CIMVectorMarker",
640
- size: 32,
641
- colorLocked: !0,
642
- anchorPointUnits: "Relative",
643
- frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
644
- markerGraphics: [
645
- {
646
- type: "CIMMarkerGraphic",
647
- primitiveName: "textGraphic",
648
- geometry: { x: 0, y: 0 },
649
- symbol: {
650
- type: "CIMTextSymbol",
651
- height: 12,
652
- horizontalAlignment: "Center",
653
- offsetX: 0,
654
- offsetY: 30,
655
- haloSize: 1,
656
- haloSymbol: {
657
- type: "CIMPolygonSymbol",
658
- symbolLayers: [
659
- {
660
- type: "CIMSolidFill",
661
- enable: !0,
662
- color: [255, 255, 255, 255]
663
- }
664
- ]
665
- },
666
- symbol: {
667
- type: "CIMPolygonSymbol",
668
- symbolLayers: [
669
- {
670
- type: "CIMSolidFill",
671
- enable: !0,
672
- color: [0, 0, 0, 255]
673
- }
674
- ]
675
- },
676
- verticalAlignment: "Center"
677
- },
678
- textString: ""
679
- }
680
- ],
681
- scaleSymbolsProportionally: !0,
682
- respectFrame: !0
683
- },
684
- // 路口图标
685
- {
686
- type: "CIMPictureMarker",
687
- enable: !0,
688
- anchorPoint: {
689
- x: 0,
690
- y: 0
691
- },
692
- anchorPointUnits: "Relative",
693
- size: 40,
694
- rotateClockwise: !0,
695
- textureFilter: "Picture",
696
- url: "/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"
697
- }
698
- ]
699
- }
700
- }
701
- }
702
- },
703
- {
704
- value: "false",
705
- symbol: {
706
- type: "cim",
707
- data: {
708
- type: "CIMSymbolReference",
709
- primitiveOverrides: [
710
- {
711
- // 将textGraphic的TextString替换为graphic.attributes.name
712
- type: "CIMPrimitiveOverride",
713
- primitiveName: "textGraphic",
714
- propertyName: "TextString",
715
- valueExpressionInfo: {
716
- type: "CIMExpressionInfo",
717
- title: "Custom",
718
- expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
719
- returnType: "Default"
720
- }
721
- }
722
- ],
723
- symbol: {
724
- type: "CIMPointSymbol",
725
- symbolLayers: [
726
- // 路口名称
727
- {
728
- type: "CIMVectorMarker",
729
- size: 32,
730
- colorLocked: !0,
731
- anchorPointUnits: "Relative",
732
- frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
733
- markerGraphics: [
734
- {
735
- type: "CIMMarkerGraphic",
736
- primitiveName: "textGraphic",
737
- geometry: { x: 0, y: 0 },
738
- symbol: {
739
- type: "CIMTextSymbol",
740
- height: 12,
741
- horizontalAlignment: "Center",
742
- offsetX: 0,
743
- offsetY: 15,
744
- haloSize: 1,
745
- haloSymbol: {
746
- type: "CIMPolygonSymbol",
747
- symbolLayers: [
748
- {
749
- type: "CIMSolidFill",
750
- enable: !0,
751
- color: [255, 255, 255, 255]
752
- }
753
- ]
754
- },
755
- symbol: {
756
- type: "CIMPolygonSymbol",
757
- symbolLayers: [
758
- {
759
- type: "CIMSolidFill",
760
- enable: !0,
761
- color: [0, 0, 0, 255]
762
- }
763
- ]
764
- },
765
- verticalAlignment: "Center"
766
- },
767
- textString: ""
768
- }
769
- ],
770
- scaleSymbolsProportionally: !0,
771
- respectFrame: !0
772
- },
773
- // 路口图标
774
- {
775
- type: "CIMPictureMarker",
776
- enable: !0,
777
- anchorPoint: {
778
- x: 0,
779
- y: 0
780
- },
781
- anchorPointUnits: "Relative",
782
- size: 20,
783
- rotateClockwise: !0,
784
- textureFilter: "Picture",
785
- url: "/GisViewerAssets/Images/cross/gis_xhj_blue.png"
786
- }
787
- ]
788
- }
789
- }
790
- }
791
- }
792
- ]
793
- }
794
- }), this.view.map.addMany([
1
+ import * as p from "@arcgis/core/core/reactiveUtils";
2
+ import y from "@arcgis/core/Graphic";
3
+ import c from "@arcgis/core/layers/FeatureLayer";
4
+ import g from "@turf/buffer";
5
+ import f from "@turf/convex";
6
+ import * as d from "@turf/helpers";
7
+ import L from "concaveman";
8
+ import b from "./district-controller.mjs";
9
+ import { districtDashLineLayerOptions as C, districtSolidLineLayerOptions as w, subDistrictLayerOptions as E, signalMarkerLayerOptions as D, signalPictureLayerOptions as k, signalClusterLayerOptions as F } from "./layer-symbol.mjs";
10
+ class P {
11
+ constructor(t) {
12
+ this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0, this.popupEnabled = !0, this.districtGraphics = [], this.subDistrictGraphics = [], this.signalGraphics = [], this.view = t, this.hasGpu = localStorage.getItem("gpu") !== "Unknown", this.districtControllerDashLayer = new c(
13
+ C
14
+ ), this.districtControllerDashLayer.spatialReference = t.spatialReference, this.districtControllerSolidLayer = new c(
15
+ w
16
+ ), this.districtControllerSolidLayer.spatialReference = t.spatialReference, this.districtControllerSolidLayer.popupEnabled = this.popupEnabled, this.subDistrictControllerLayer = new c(
17
+ E
18
+ ), this.subDistrictControllerLayer.spatialReference = t.spatialReference, this.subDistrictControllerLayer.popupEnabled = this.popupEnabled, this.signalMarkerLayer = new c(
19
+ D
20
+ ), this.signalMarkerLayer.spatialReference = t.spatialReference, this.signalMarkerLayer.popupEnabled = this.popupEnabled, this.signalPictureLayer = new c(
21
+ k
22
+ ), this.signalPictureLayer.spatialReference = t.spatialReference, this.signalPictureLayer.popupEnabled = this.popupEnabled, this.signalClusterLayer = new c(
23
+ F
24
+ ), this.signalClusterLayer.spatialReference = t.spatialReference, this.signalClusterLayer.popupEnabled = this.popupEnabled, this.view.map.addMany([
795
25
  this.districtControllerSolidLayer,
796
26
  this.districtControllerDashLayer,
797
- this.subDistrictControllerLayer,
798
27
  this.signalMarkerLayer,
799
28
  this.signalPictureLayer,
800
- this.signalClusterLayer
29
+ this.signalClusterLayer,
30
+ this.subDistrictControllerLayer
801
31
  ]);
802
32
  }
803
33
  /**
@@ -805,14 +35,14 @@ class S {
805
35
  * @param params
806
36
  * @returns
807
37
  */
808
- async showSignalControlArea(e) {
809
- await this.clearSignalControlArea(), this.districtControllerDashLayer.visible = !1, this.districtControllerSolidLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.signalMarkerLayer.visible = !1, this.signalPictureLayer.visible = !1, this.signalClusterLayer.visible = !0;
810
- for (const i of e.areaList) {
811
- const s = new g(
38
+ async showSignalControlArea(t) {
39
+ await this.clearSignalControlArea(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this)), this.districtControllerDashLayer.visible = !1, this.districtControllerSolidLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.signalMarkerLayer.visible = !1, this.signalPictureLayer.visible = !1, this.signalClusterLayer.visible = !0;
40
+ for (const i of t.areaList) {
41
+ const s = new b(
812
42
  i,
813
- e.style || ""
43
+ t.style || ""
814
44
  );
815
- this.generateGraphic(s, !0, e.style);
45
+ this.generateGraphic(s, !0, t.style);
816
46
  }
817
47
  return await this.districtControllerDashLayer.applyEdits({
818
48
  addFeatures: this.districtGraphics
@@ -833,20 +63,20 @@ class S {
833
63
  * @returns
834
64
  */
835
65
  async clearSignalControlArea() {
836
- this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0;
837
- let e = await this.districtControllerDashLayer.queryFeatures();
66
+ this.districtGraphics = [], this.subDistrictGraphics = [], this.signalGraphics = [], this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0, this.view.removeHandles([this.clickHandler]), this.clickHandler = void 0;
67
+ let t = await this.districtControllerDashLayer.queryFeatures();
838
68
  return await this.districtControllerDashLayer.applyEdits({
839
- deleteFeatures: e.features
840
- }), this.districtControllerDashLayer.definitionExpression = "1=1", e = await this.districtControllerSolidLayer.queryFeatures(), await this.districtControllerSolidLayer.applyEdits({
841
- deleteFeatures: e.features
842
- }), this.districtControllerSolidLayer.definitionExpression = "1=1", e = await this.subDistrictControllerLayer.queryFeatures(), await this.subDistrictControllerLayer.applyEdits({
843
- deleteFeatures: e.features
844
- }), this.subDistrictControllerLayer.definitionExpression = "1=1", e = await this.signalMarkerLayer.queryFeatures(), await this.signalMarkerLayer.applyEdits({
845
- deleteFeatures: e.features
846
- }), this.signalMarkerLayer.definitionExpression = "1=1", e = await this.signalPictureLayer.queryFeatures(), await this.signalPictureLayer.applyEdits({
847
- deleteFeatures: e.features
848
- }), this.signalPictureLayer.definitionExpression = "1=1", e = await this.signalClusterLayer.queryFeatures(), await this.signalClusterLayer.applyEdits({
849
- deleteFeatures: e.features
69
+ deleteFeatures: t.features
70
+ }), this.districtControllerDashLayer.definitionExpression = "1=1", t = await this.districtControllerSolidLayer.queryFeatures(), await this.districtControllerSolidLayer.applyEdits({
71
+ deleteFeatures: t.features
72
+ }), this.districtControllerSolidLayer.definitionExpression = "1=1", t = await this.subDistrictControllerLayer.queryFeatures(), await this.subDistrictControllerLayer.applyEdits({
73
+ deleteFeatures: t.features
74
+ }), this.subDistrictControllerLayer.definitionExpression = "1=1", t = await this.signalMarkerLayer.queryFeatures(), await this.signalMarkerLayer.applyEdits({
75
+ deleteFeatures: t.features
76
+ }), this.signalMarkerLayer.definitionExpression = "1=1", t = await this.signalPictureLayer.queryFeatures(), await this.signalPictureLayer.applyEdits({
77
+ deleteFeatures: t.features
78
+ }), this.signalPictureLayer.definitionExpression = "1=1", t = await this.signalClusterLayer.queryFeatures(), await this.signalClusterLayer.applyEdits({
79
+ deleteFeatures: t.features
850
80
  }), this.signalClusterLayer.definitionExpression = "1=1", { status: 0, message: "ok" };
851
81
  }
852
82
  /**
@@ -854,19 +84,19 @@ class S {
854
84
  * @param layerName
855
85
  * @param visible
856
86
  */
857
- setLayerVisibility(e) {
858
- switch (e.visible === !1 && this.view.closePopup(), e.id) {
87
+ setLayerVisibility(t) {
88
+ switch (t.visible === !1 && this.view.closePopup(), t.id) {
859
89
  case "district":
860
- this.districtControllerDashLayer.visible = e.visible, this.districtControllerSolidLayer.visible = e.visible;
90
+ this.districtControllerDashLayer.visible = t.visible, this.districtControllerSolidLayer.visible = t.visible;
861
91
  break;
862
92
  case "subDistrict":
863
- this.subDistrictControllerLayer.visible = e.visible;
93
+ this.subDistrictControllerLayer.visible = t.visible;
864
94
  break;
865
95
  case "signal":
866
- this.signalMarkerLayer.visible = e.visible, this.signalPictureLayer.visible = e.visible;
96
+ this.signalMarkerLayer.visible = t.visible, this.signalPictureLayer.visible = t.visible;
867
97
  break;
868
98
  case "signalCluster":
869
- this.signalClusterLayer.visible = e.visible;
99
+ this.signalClusterLayer.visible = t.visible;
870
100
  break;
871
101
  }
872
102
  return { status: 0, message: "ok" };
@@ -876,13 +106,13 @@ class S {
876
106
  * @param params
877
107
  * @returns
878
108
  */
879
- async locateSignalControlArea(e) {
880
- switch (e.type) {
109
+ async locateSignalControlArea(t) {
110
+ switch (t.type) {
881
111
  case "district": {
882
- const t = this.districtControllerDashLayer.createQuery();
883
- t.where = `id = '${e.id}'`, t.returnGeometry = !0, t.outFields = ["*"];
112
+ const e = this.districtControllerDashLayer.createQuery();
113
+ e.where = `id = '${t.id}'`, e.returnGeometry = !0, e.outFields = ["*"];
884
114
  const r = await this.districtControllerDashLayer.queryFeatures(
885
- t
115
+ e
886
116
  );
887
117
  return r.features.length > 0 ? (await this.view.goTo(r.features, {
888
118
  duration: this.hasGpu ? 1e3 : 0
@@ -890,7 +120,7 @@ class S {
890
120
  }
891
121
  case "subDistrict":
892
122
  const i = this.subDistrictControllerLayer.createQuery();
893
- i.where = `id = '${e.id}'`, i.returnGeometry = !0, i.outFields = ["*"];
123
+ i.where = `id = '${t.id}'`, i.returnGeometry = !0, i.outFields = ["*"];
894
124
  const s = await this.subDistrictControllerLayer.queryFeatures(
895
125
  i
896
126
  );
@@ -898,11 +128,11 @@ class S {
898
128
  duration: this.hasGpu ? 1e3 : 0
899
129
  }), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
900
130
  case "signal": {
901
- const t = this.signalMarkerLayer.createQuery();
902
- t.where = `id = '${e.id}'`, t.returnGeometry = !0, t.outFields = ["*"];
903
- const r = await this.signalMarkerLayer.queryFeatures(t);
131
+ const e = this.signalMarkerLayer.createQuery();
132
+ e.where = `id = '${t.id}'`, e.returnGeometry = !0, e.outFields = ["*"];
133
+ const r = await this.signalMarkerLayer.queryFeatures(e);
904
134
  return r.features.length > 0 ? (await this.view.goTo(
905
- { target: r.features[0], scale: e.scale || 1e3 },
135
+ { target: r.features[0], scale: t.scale || 1e3 },
906
136
  {
907
137
  duration: this.hasGpu ? 1e3 : 0
908
138
  }
@@ -917,44 +147,45 @@ class S {
917
147
  * @param params
918
148
  * @returns
919
149
  */
920
- async highlightSignalControlArea(e) {
921
- switch (e.type) {
150
+ async highlightSignalControlArea(t) {
151
+ var i;
152
+ switch ((i = this.view.popup) != null && i.visible && this.view.popup.close(), t.type) {
922
153
  case "district": {
923
- const i = this.districtControllerDashLayer.definitionExpression;
924
- this.districtControllerDashLayer.definitionExpression = `id = '${e.id}'`;
925
- const s = await this.districtControllerDashLayer.queryFeatures();
926
- return s.features.length > 0 ? (this.districtControllerSolidLayer.definitionExpression = `id = '${e.id}'`, this.subDistrictControllerLayer.definitionExpression = `parentId = '${e.id}'`, this.signalMarkerLayer.definitionExpression = `districtId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `districtId = '${e.id}'`, await this.view.goTo(s.features, {
154
+ const s = this.districtControllerDashLayer.definitionExpression;
155
+ this.districtControllerDashLayer.definitionExpression = `id = '${t.id}'`;
156
+ const e = await this.districtControllerDashLayer.queryFeatures();
157
+ return e.features.length > 0 ? (this.districtControllerSolidLayer.definitionExpression = `id = '${t.id}'`, this.subDistrictControllerLayer.definitionExpression = `parentId = '${t.id}'`, this.signalMarkerLayer.definitionExpression = `districtId = '${t.id}'`, this.signalPictureLayer.definitionExpression = `districtId = '${t.id}'`, this.signalClusterLayer.definitionExpression = `districtId = '${t.id}'`, await this.view.goTo(e.features, {
927
158
  duration: this.hasGpu ? 1e3 : 0
928
- }), { status: 0, message: "ok" }) : (this.districtControllerDashLayer.definitionExpression = i, { status: 1, message: "未找到区控" });
159
+ }), { status: 0, message: "ok" }) : (this.districtControllerDashLayer.definitionExpression = s, { status: 1, message: "未找到区控" });
929
160
  }
930
161
  case "subDistrict": {
931
- const i = this.subDistrictControllerLayer.definitionExpression;
932
- this.subDistrictControllerLayer.definitionExpression = `id = '${e.id}'`;
933
- const s = await this.subDistrictControllerLayer.queryFeatures();
934
- if (s.features.length > 0) {
935
- this.signalMarkerLayer.definitionExpression = `subDistrictId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `subDistrictId = '${e.id}'`;
936
- const r = s.features[0].attributes.parentId;
937
- return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, await this.view.goTo(s.features, {
162
+ const s = this.subDistrictControllerLayer.definitionExpression;
163
+ this.subDistrictControllerLayer.definitionExpression = `id = '${t.id}'`;
164
+ const e = await this.subDistrictControllerLayer.queryFeatures();
165
+ if (e.features.length > 0) {
166
+ this.signalMarkerLayer.definitionExpression = `subDistrictId = '${t.id}'`, this.signalPictureLayer.definitionExpression = `subDistrictId = '${t.id}'`, this.signalClusterLayer.definitionExpression = `subDistrictId = '${t.id}'`;
167
+ const l = e.features[0].attributes.parentId;
168
+ return this.districtControllerDashLayer.definitionExpression = `id = '${l}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${l}'`, await this.view.goTo(e.features, {
938
169
  duration: this.hasGpu ? 1e3 : 0
939
170
  }), { status: 0, message: "ok" };
940
171
  } else
941
- return this.subDistrictControllerLayer.definitionExpression = i, { status: 1, message: "未找到子区" };
172
+ return this.subDistrictControllerLayer.definitionExpression = s, { status: 1, message: "未找到子区" };
942
173
  }
943
174
  case "signal": {
944
- const i = this.signalMarkerLayer.definitionExpression;
945
- this.signalMarkerLayer.definitionExpression = `id = '${e.id}'`;
946
- const s = await this.signalMarkerLayer.queryFeatures();
947
- if (s.features.length > 0) {
948
- this.signalPictureLayer.definitionExpression = `id = '${e.id}'`;
949
- const t = s.features[0], { districtId: r, subDistrictId: o } = t.attributes;
950
- return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, this.subDistrictControllerLayer.definitionExpression = `id = '${o}'`, await this.view.goTo(
951
- { target: s.features, scale: e.scale || 1e3 },
175
+ const s = this.signalMarkerLayer.definitionExpression;
176
+ this.signalMarkerLayer.definitionExpression = `id = '${t.id}'`;
177
+ const e = await this.signalMarkerLayer.queryFeatures();
178
+ if (e.features.length > 0) {
179
+ this.signalPictureLayer.definitionExpression = `id = '${t.id}'`, this.signalClusterLayer.definitionExpression = `id = '${t.id}'`;
180
+ const r = e.features[0], { districtId: l, subDistrictId: o } = r.attributes;
181
+ return this.districtControllerDashLayer.definitionExpression = `id = '${l}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${l}'`, this.subDistrictControllerLayer.definitionExpression = `id = '${o}'`, await this.view.goTo(
182
+ { target: e.features, scale: t.scale || 1e3 },
952
183
  {
953
184
  duration: this.hasGpu ? 1e3 : 0
954
185
  }
955
186
  ), { status: 0, message: "ok" };
956
187
  } else
957
- return this.signalMarkerLayer.definitionExpression = i, { status: 1, message: "未找到信号机" };
188
+ return this.signalMarkerLayer.definitionExpression = s, { status: 1, message: "未找到信号机" };
958
189
  }
959
190
  default:
960
191
  return { status: 1, message: "未知类型" };
@@ -965,9 +196,9 @@ class S {
965
196
  * @returns
966
197
  */
967
198
  async resetHighlight() {
968
- this.districtControllerDashLayer.definitionExpression = "1=1", this.districtControllerSolidLayer.definitionExpression = "1=1", this.subDistrictControllerLayer.definitionExpression = "1=1", this.signalMarkerLayer.definitionExpression = "1=1";
969
- const e = await this.districtControllerDashLayer.queryFeatures();
970
- return this.view.goTo(e.features, {
199
+ this.districtControllerDashLayer.definitionExpression = "1=1", this.districtControllerSolidLayer.definitionExpression = "1=1", this.subDistrictControllerLayer.definitionExpression = "1=1", this.signalMarkerLayer.definitionExpression = "1=1", this.signalClusterLayer.definitionExpression = "1=1", this.signalPictureLayer.definitionExpression = "1=1";
200
+ const t = await this.districtControllerDashLayer.queryFeatures();
201
+ return this.view.goTo(t.features, {
971
202
  duration: this.hasGpu ? 1e3 : 0
972
203
  }), { status: 0, message: "ok" };
973
204
  }
@@ -977,78 +208,181 @@ class S {
977
208
  * @param isDistrict 是否是区控
978
209
  * @returns
979
210
  */
980
- generateGraphic(e, i, s) {
981
- const t = e.getAllSignalCoordinates();
211
+ generateGraphic(t, i, s) {
212
+ const e = t.getAllSignalCoordinates();
982
213
  let r = null;
983
- if (t.length >= 2)
984
- if (t.length === 2)
985
- r = n.lineString(t);
214
+ if (e.length >= 2)
215
+ if (e.length === 2)
216
+ r = d.lineString(e);
986
217
  else {
987
218
  if (i) {
988
- const a = n.featureCollection(
989
- t.map((y) => n.point(y))
219
+ const n = d.featureCollection(
220
+ e.map((a) => d.point(a))
990
221
  );
991
- r = p(a);
222
+ r = f(n);
992
223
  } else {
993
- const a = m(t, 0.5);
994
- a.length >= 4 && (r = n.polygon([a]));
224
+ const n = L(e, 0.5);
225
+ n.length >= 4 && (r = d.polygon([n]));
995
226
  }
996
- r || (r = n.lineString(t));
227
+ r || (r = d.lineString(e));
997
228
  }
998
- else if (t.length === 1)
999
- r = n.point(t[0]);
229
+ else if (e.length === 1)
230
+ r = d.point(e[0]);
1000
231
  else
1001
232
  return;
1002
- const o = c(
233
+ const l = g(
1003
234
  r.geometry,
1004
235
  // 区控面积更大,需要更大的缓冲半径
1005
236
  i ? 200 : 30,
1006
237
  {
1007
238
  units: "meters"
1008
239
  }
1009
- ), u = new d({
240
+ ), o = new y({
1010
241
  geometry: {
1011
242
  type: "polyline",
1012
- paths: o.geometry.coordinates
243
+ paths: l.geometry.coordinates
1013
244
  },
1014
245
  attributes: {
1015
246
  ObjectID: i ? this.districtControllerOid++ : this.subDistrictControllerOid++,
1016
- id: e.id,
1017
- name: e.name,
1018
- subDistrictCount: e.subDistrictCount,
1019
- signalCount: e.signalCount,
1020
- parentId: e.parentId,
1021
- parentName: e.parentName,
1022
- style: s
247
+ id: t.id,
248
+ name: t.name,
249
+ subDistrictCount: t.subDistrictCount,
250
+ signalCount: t.signalCount,
251
+ parentId: t.parentId,
252
+ parentName: t.parentName,
253
+ selected: s,
254
+ type: i ? "district" : "subDistrict"
1023
255
  }
1024
256
  });
1025
- i ? this.districtGraphics.push(u) : this.subDistrictGraphics.push(u);
1026
- for (const a of e.subDistricts)
1027
- this.generateGraphic(a, !1, s);
1028
- e.signals.forEach((a) => {
1029
- const y = new d({
257
+ i ? this.districtGraphics.push(o) : this.subDistrictGraphics.push(o);
258
+ for (const n of t.subDistricts)
259
+ this.generateGraphic(n, !1, s);
260
+ t.signals.forEach((n) => {
261
+ const a = new y({
1030
262
  geometry: {
1031
263
  type: "point",
1032
- x: a.longitude,
1033
- y: a.latitude
264
+ x: n.longitude,
265
+ y: n.latitude
1034
266
  },
1035
267
  attributes: {
1036
268
  ObjectID: this.signalOid++,
1037
- id: a.id,
1038
- name: a.name,
1039
- signalId: a.signalId,
1040
- nodeId: a.nodeId,
1041
- isKey: a.isKey,
1042
- districtId: i ? e.id : e.parentId,
1043
- districtName: i ? e.name : e.parentName,
1044
- subDistrictId: i ? "" : e.id,
1045
- subDistrictName: i ? "" : e.name
269
+ id: n.id,
270
+ name: n.name,
271
+ signalId: n.signalId,
272
+ nodeId: n.nodeId,
273
+ isKey: n.isKey,
274
+ districtId: i ? t.id : t.parentId,
275
+ districtName: i ? t.name : t.parentName,
276
+ subDistrictId: i ? "" : t.id,
277
+ subDistrictName: i ? "" : t.name,
278
+ type: "signal",
279
+ selected: !0
1046
280
  }
1047
281
  });
1048
- this.signalGraphics.push(y);
282
+ this.signalGraphics.push(a);
1049
283
  });
1050
284
  }
285
+ async viewHitTest(t) {
286
+ var n;
287
+ const s = (n = (await this.view.hitTest(t, {
288
+ include: [
289
+ this.districtControllerSolidLayer,
290
+ this.subDistrictControllerLayer,
291
+ this.signalMarkerLayer,
292
+ this.signalPictureLayer,
293
+ this.signalClusterLayer
294
+ ]
295
+ })).results) == null ? void 0 : n.filter(
296
+ (a) => a.type === "graphic"
297
+ );
298
+ if (s.length === 0)
299
+ return;
300
+ const e = s[0].graphic;
301
+ let r = null;
302
+ e.geometry.type === "point" ? r = e.geometry : e.geometry.type === "polyline" ? r = e.geometry.extent.center : e.geometry.type === "polygon" && (r = e.geometry.centroid), r !== null && await this.view.goTo(r, { duration: 1e3 });
303
+ const l = e.getAttribute("type"), o = e.getAttribute("id");
304
+ switch (l) {
305
+ case "district": {
306
+ let a = await this.districtControllerSolidLayer.queryFeatures();
307
+ a.features.forEach((u) => {
308
+ u.attributes.selected = u.attributes.id === o;
309
+ }), await this.districtControllerSolidLayer.applyEdits({
310
+ updateFeatures: a.features
311
+ }), a = await this.districtControllerDashLayer.queryFeatures(), a.features.forEach((u) => {
312
+ u.attributes.selected = u.attributes.id === o;
313
+ }), await this.districtControllerDashLayer.applyEdits({
314
+ updateFeatures: a.features
315
+ });
316
+ break;
317
+ }
318
+ case "subDistrict": {
319
+ let a = await this.subDistrictControllerLayer.queryFeatures();
320
+ a.features.forEach((h) => {
321
+ h.attributes.selected = h.attributes.id === o;
322
+ }), await this.subDistrictControllerLayer.applyEdits({
323
+ updateFeatures: a.features
324
+ }), a = await this.signalMarkerLayer.queryFeatures(), a.features.forEach((h) => {
325
+ h.attributes.selected = h.attributes.subDistrictId === o;
326
+ });
327
+ let u = await this.signalMarkerLayer.applyEdits({
328
+ updateFeatures: a.features
329
+ });
330
+ console.log(u), a = await this.signalPictureLayer.queryFeatures(), a.features.forEach((h) => {
331
+ h.attributes.selected = h.attributes.subDistrictId === o;
332
+ }), u = await this.signalPictureLayer.applyEdits({
333
+ updateFeatures: a.features
334
+ }), console.log(u);
335
+ break;
336
+ }
337
+ }
338
+ p.when(
339
+ () => this.view.popup.visible === !1,
340
+ async () => {
341
+ await this.resetSelectedSymbol(l);
342
+ },
343
+ {
344
+ once: !0
345
+ }
346
+ );
347
+ }
348
+ /**
349
+ * 重置所有graphic的置灰状态
350
+ */
351
+ async resetSelectedSymbol(t) {
352
+ switch (t) {
353
+ case "district": {
354
+ let i = await this.districtControllerSolidLayer.queryFeatures();
355
+ i.features.forEach((s) => {
356
+ s.attributes.selected = !0;
357
+ }), await this.districtControllerSolidLayer.applyEdits({
358
+ updateFeatures: i.features
359
+ }), i = await this.districtControllerDashLayer.queryFeatures(), i.features.forEach((s) => {
360
+ s.attributes.selected = !0;
361
+ }), await this.districtControllerDashLayer.applyEdits({
362
+ updateFeatures: i.features
363
+ });
364
+ break;
365
+ }
366
+ case "subDistrict": {
367
+ let i = await this.subDistrictControllerLayer.queryFeatures();
368
+ i.features.forEach((s) => {
369
+ s.attributes.selected = !0;
370
+ }), await this.subDistrictControllerLayer.applyEdits({
371
+ updateFeatures: i.features
372
+ }), i = await this.signalMarkerLayer.queryFeatures(), console.log("marker count", i.features.length), i.features.forEach((s) => {
373
+ s.attributes.selected = !0;
374
+ }), await this.signalMarkerLayer.applyEdits({
375
+ updateFeatures: i.features
376
+ }), i = await this.signalPictureLayer.queryFeatures(), console.log("picture count", i.features.length), i.features.forEach((s) => {
377
+ s.attributes.selected = !0;
378
+ }), await this.signalPictureLayer.applyEdits({
379
+ updateFeatures: i.features
380
+ });
381
+ break;
382
+ }
383
+ }
384
+ }
1051
385
  }
1052
386
  export {
1053
- S as default
387
+ P as default
1054
388
  };