gisviewer-vue3-arcgis 1.0.202 → 1.0.204

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 (28) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.mjs +11 -10
  3. package/es/src/gis-map/gis-map.vue.d.ts +22 -14
  4. package/es/src/gis-map/gis-map.vue.mjs +101 -100
  5. package/es/src/gis-map/index.d.ts +19 -12
  6. package/es/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +7 -3
  7. package/es/src/gis-map/utils/signal-control-area-controller/district-controller.mjs +29 -25
  8. package/es/src/gis-map/utils/signal-control-area-controller/{index.d.ts → edit-area.d.ts} +2 -14
  9. package/es/src/gis-map/utils/signal-control-area-controller/{index.mjs → edit-area.mjs} +40 -162
  10. package/es/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +68 -0
  11. package/es/src/gis-map/utils/signal-control-area-controller/show-area.mjs +806 -0
  12. package/es/src/types/index.d.ts +4 -0
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.js +1 -1
  15. package/lib/src/gis-map/gis-map.vue.d.ts +22 -14
  16. package/lib/src/gis-map/gis-map.vue.js +1 -1
  17. package/lib/src/gis-map/index.d.ts +19 -12
  18. package/lib/src/gis-map/utils/queue-length.js +1 -1
  19. package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.d.ts +7 -3
  20. package/lib/src/gis-map/utils/signal-control-area-controller/district-controller.js +1 -1
  21. package/lib/src/gis-map/utils/signal-control-area-controller/{index.d.ts → edit-area.d.ts} +2 -14
  22. package/lib/src/gis-map/utils/signal-control-area-controller/edit-area.js +1 -0
  23. package/lib/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +68 -0
  24. package/lib/src/gis-map/utils/signal-control-area-controller/show-area.js +1 -0
  25. package/lib/src/gis-map/utils/sketchView.js +1 -1
  26. package/lib/src/types/index.d.ts +4 -0
  27. package/package.json +2 -1
  28. package/lib/src/gis-map/utils/signal-control-area-controller/index.js +0 -1
@@ -0,0 +1,806 @@
1
+ import y from "@arcgis/core/Graphic";
2
+ import a from "@arcgis/core/layers/FeatureLayer";
3
+ import c from "@turf/buffer";
4
+ import p from "@turf/convex";
5
+ import * as l 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 r;
12
+ this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0, this.subDistrictGraphics = [], this.view = e, this.hasGpu = localStorage.getItem("gpu") !== "Unknown";
13
+ const s = h.useAppDataStore.mapConfig;
14
+ this.openDriveServer = (r = s.openDriveServer) == null ? void 0 : r.url, this.districtControllerDashLayer = new a({
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 a({
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 a({
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
+ popupTemplate: {
146
+ title: "{name} 子区",
147
+ content: [
148
+ {
149
+ type: "fields",
150
+ fieldInfos: [
151
+ {
152
+ fieldName: "id",
153
+ label: "区控编号"
154
+ },
155
+ {
156
+ fieldName: "parentName",
157
+ label: "所属区控"
158
+ },
159
+ {
160
+ fieldName: "signalCount",
161
+ label: "信号机数量"
162
+ }
163
+ ]
164
+ }
165
+ ]
166
+ },
167
+ renderer: {
168
+ type: "simple",
169
+ symbol: {
170
+ type: "simple-line",
171
+ style: "solid",
172
+ color: [5, 196, 104],
173
+ width: 3
174
+ }
175
+ }
176
+ }), this.signalMarkerLayer = new a({
177
+ id: "signalLayer",
178
+ spatialReference: e.spatialReference,
179
+ source: [],
180
+ objectIdField: "ObjectID",
181
+ outFields: ["*"],
182
+ geometryType: "point",
183
+ maxScale: 5e3,
184
+ fields: [
185
+ {
186
+ name: "ObjectID",
187
+ type: "oid"
188
+ },
189
+ {
190
+ name: "id",
191
+ type: "string"
192
+ },
193
+ {
194
+ name: "name",
195
+ type: "string"
196
+ },
197
+ {
198
+ name: "signalId",
199
+ type: "string"
200
+ },
201
+ {
202
+ name: "nodeId",
203
+ type: "string"
204
+ },
205
+ {
206
+ name: "isKey",
207
+ type: "string"
208
+ },
209
+ {
210
+ name: "districtId",
211
+ type: "string"
212
+ },
213
+ {
214
+ name: "districtName",
215
+ type: "string"
216
+ },
217
+ {
218
+ name: "subDistrictId",
219
+ type: "string"
220
+ },
221
+ {
222
+ name: "subDistrictName",
223
+ type: "string"
224
+ }
225
+ ],
226
+ popupTemplate: {
227
+ title: "{name}信号机",
228
+ content: [
229
+ {
230
+ type: "fields",
231
+ fieldInfos: [
232
+ {
233
+ fieldName: "districtName",
234
+ label: "区控名称"
235
+ },
236
+ {
237
+ fieldName: "subDistrictName",
238
+ label: "子区名称"
239
+ },
240
+ {
241
+ fieldName: "signalId",
242
+ label: "信号机编号"
243
+ },
244
+ {
245
+ fieldName: "nodeId",
246
+ label: "路口编号"
247
+ }
248
+ ]
249
+ }
250
+ ]
251
+ },
252
+ renderer: {
253
+ type: "unique-value",
254
+ field: "isKey",
255
+ defaultSymbol: {
256
+ type: "simple-marker",
257
+ style: "circle",
258
+ color: "gray",
259
+ size: 4,
260
+ outline: {
261
+ color: "white",
262
+ width: 1
263
+ }
264
+ },
265
+ uniqueValueInfos: [
266
+ {
267
+ value: "true",
268
+ symbol: {
269
+ type: "simple-marker",
270
+ style: "circle",
271
+ color: [254, 172, 22],
272
+ size: 12,
273
+ outline: {
274
+ color: "white",
275
+ width: 1
276
+ }
277
+ }
278
+ },
279
+ {
280
+ value: "false",
281
+ symbol: {
282
+ type: "simple-marker",
283
+ style: "circle",
284
+ color: [5, 116, 255],
285
+ size: 8,
286
+ outline: {
287
+ color: "white",
288
+ width: 1
289
+ }
290
+ }
291
+ }
292
+ ]
293
+ }
294
+ }), this.signalPictureLayer = new a({
295
+ id: "signalLayer",
296
+ spatialReference: e.spatialReference,
297
+ source: [],
298
+ objectIdField: "ObjectID",
299
+ outFields: ["*"],
300
+ geometryType: "point",
301
+ minScale: 5e3,
302
+ fields: [
303
+ {
304
+ name: "ObjectID",
305
+ type: "oid"
306
+ },
307
+ {
308
+ name: "id",
309
+ type: "string"
310
+ },
311
+ {
312
+ name: "name",
313
+ type: "string"
314
+ },
315
+ {
316
+ name: "signalId",
317
+ type: "string"
318
+ },
319
+ {
320
+ name: "nodeId",
321
+ type: "string"
322
+ },
323
+ {
324
+ name: "isKey",
325
+ type: "string"
326
+ },
327
+ {
328
+ name: "districtId",
329
+ type: "string"
330
+ },
331
+ {
332
+ name: "districtName",
333
+ type: "string"
334
+ },
335
+ {
336
+ name: "subDistrictId",
337
+ type: "string"
338
+ },
339
+ {
340
+ name: "subDistrictName",
341
+ type: "string"
342
+ }
343
+ ],
344
+ popupTemplate: {
345
+ title: "{name}信号机",
346
+ content: [
347
+ {
348
+ type: "fields",
349
+ fieldInfos: [
350
+ {
351
+ fieldName: "districtName",
352
+ label: "区控名称"
353
+ },
354
+ {
355
+ fieldName: "subDistrictName",
356
+ label: "子区名称"
357
+ },
358
+ {
359
+ fieldName: "signalId",
360
+ label: "信号机编号"
361
+ },
362
+ {
363
+ fieldName: "nodeId",
364
+ label: "路口编号"
365
+ }
366
+ ]
367
+ }
368
+ ]
369
+ },
370
+ renderer: {
371
+ type: "unique-value",
372
+ field: "isKey",
373
+ defaultSymbol: {
374
+ type: "simple-marker",
375
+ style: "circle",
376
+ color: "gray",
377
+ size: 4,
378
+ outline: {
379
+ color: "white",
380
+ width: 1
381
+ }
382
+ },
383
+ uniqueValueInfos: [
384
+ {
385
+ value: "true",
386
+ symbol: {
387
+ type: "cim",
388
+ data: {
389
+ type: "CIMSymbolReference",
390
+ primitiveOverrides: [
391
+ {
392
+ // 将textGraphic的TextString替换为graphic.attributes.name
393
+ type: "CIMPrimitiveOverride",
394
+ primitiveName: "textGraphic",
395
+ propertyName: "TextString",
396
+ valueExpressionInfo: {
397
+ type: "CIMExpressionInfo",
398
+ title: "Custom",
399
+ expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
400
+ returnType: "Default"
401
+ }
402
+ }
403
+ ],
404
+ symbol: {
405
+ type: "CIMPointSymbol",
406
+ symbolLayers: [
407
+ // 路口名称
408
+ {
409
+ type: "CIMVectorMarker",
410
+ size: 32,
411
+ colorLocked: !0,
412
+ anchorPointUnits: "Relative",
413
+ frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
414
+ markerGraphics: [
415
+ {
416
+ type: "CIMMarkerGraphic",
417
+ primitiveName: "textGraphic",
418
+ geometry: { x: 0, y: 0 },
419
+ symbol: {
420
+ type: "CIMTextSymbol",
421
+ height: 12,
422
+ horizontalAlignment: "Center",
423
+ offsetX: 0,
424
+ offsetY: 30,
425
+ haloSize: 1,
426
+ haloSymbol: {
427
+ type: "CIMPolygonSymbol",
428
+ symbolLayers: [
429
+ {
430
+ type: "CIMSolidFill",
431
+ enable: !0,
432
+ color: [255, 255, 255, 255]
433
+ }
434
+ ]
435
+ },
436
+ symbol: {
437
+ type: "CIMPolygonSymbol",
438
+ symbolLayers: [
439
+ {
440
+ type: "CIMSolidFill",
441
+ enable: !0,
442
+ color: [0, 0, 0, 255]
443
+ }
444
+ ]
445
+ },
446
+ verticalAlignment: "Center"
447
+ },
448
+ textString: ""
449
+ }
450
+ ],
451
+ scaleSymbolsProportionally: !0,
452
+ respectFrame: !0
453
+ },
454
+ // 路口图标
455
+ {
456
+ type: "CIMPictureMarker",
457
+ enable: !0,
458
+ anchorPoint: {
459
+ x: 0,
460
+ y: 0
461
+ },
462
+ anchorPointUnits: "Relative",
463
+ size: 40,
464
+ rotateClockwise: !0,
465
+ textureFilter: "Picture",
466
+ url: "/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"
467
+ }
468
+ ]
469
+ }
470
+ }
471
+ }
472
+ },
473
+ {
474
+ value: "false",
475
+ symbol: {
476
+ type: "cim",
477
+ data: {
478
+ type: "CIMSymbolReference",
479
+ primitiveOverrides: [
480
+ {
481
+ // 将textGraphic的TextString替换为graphic.attributes.name
482
+ type: "CIMPrimitiveOverride",
483
+ primitiveName: "textGraphic",
484
+ propertyName: "TextString",
485
+ valueExpressionInfo: {
486
+ type: "CIMExpressionInfo",
487
+ title: "Custom",
488
+ expression: 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
489
+ returnType: "Default"
490
+ }
491
+ }
492
+ ],
493
+ symbol: {
494
+ type: "CIMPointSymbol",
495
+ symbolLayers: [
496
+ // 路口名称
497
+ {
498
+ type: "CIMVectorMarker",
499
+ size: 32,
500
+ colorLocked: !0,
501
+ anchorPointUnits: "Relative",
502
+ frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
503
+ markerGraphics: [
504
+ {
505
+ type: "CIMMarkerGraphic",
506
+ primitiveName: "textGraphic",
507
+ geometry: { x: 0, y: 0 },
508
+ symbol: {
509
+ type: "CIMTextSymbol",
510
+ height: 12,
511
+ horizontalAlignment: "Center",
512
+ offsetX: 0,
513
+ offsetY: 15,
514
+ haloSize: 1,
515
+ haloSymbol: {
516
+ type: "CIMPolygonSymbol",
517
+ symbolLayers: [
518
+ {
519
+ type: "CIMSolidFill",
520
+ enable: !0,
521
+ color: [255, 255, 255, 255]
522
+ }
523
+ ]
524
+ },
525
+ symbol: {
526
+ type: "CIMPolygonSymbol",
527
+ symbolLayers: [
528
+ {
529
+ type: "CIMSolidFill",
530
+ enable: !0,
531
+ color: [0, 0, 0, 255]
532
+ }
533
+ ]
534
+ },
535
+ verticalAlignment: "Center"
536
+ },
537
+ textString: ""
538
+ }
539
+ ],
540
+ scaleSymbolsProportionally: !0,
541
+ respectFrame: !0
542
+ },
543
+ // 路口图标
544
+ {
545
+ type: "CIMPictureMarker",
546
+ enable: !0,
547
+ anchorPoint: {
548
+ x: 0,
549
+ y: 0
550
+ },
551
+ anchorPointUnits: "Relative",
552
+ size: 20,
553
+ rotateClockwise: !0,
554
+ textureFilter: "Picture",
555
+ url: "/GisViewerAssets/Images/cross/gis_xhj_blue.png"
556
+ }
557
+ ]
558
+ }
559
+ }
560
+ }
561
+ }
562
+ ]
563
+ }
564
+ }), this.view.map.addMany([
565
+ this.districtControllerSolidLayer,
566
+ this.districtControllerDashLayer,
567
+ this.subDistrictControllerLayer,
568
+ this.signalMarkerLayer,
569
+ this.signalPictureLayer
570
+ ]);
571
+ }
572
+ /**
573
+ * 显示所有区控、子区、信号机
574
+ * @param params
575
+ * @returns
576
+ */
577
+ async showSignalControlArea(e) {
578
+ await this.clearSignalControlArea(), this.districtControllerDashLayer.visible = !0, this.districtControllerSolidLayer.visible = !0, this.subDistrictControllerLayer.visible = !1, this.signalMarkerLayer.visible = !1, this.signalPictureLayer.visible = !1;
579
+ for (const s of e.areaList) {
580
+ const r = new g(
581
+ s,
582
+ e.style || ""
583
+ );
584
+ await this.drawArea(r, !0), await this.subDistrictControllerLayer.applyEdits({
585
+ addFeatures: this.subDistrictGraphics
586
+ }), this.subDistrictGraphics = [];
587
+ }
588
+ const t = await this.districtControllerDashLayer.queryFeatures();
589
+ return this.view.goTo(t.features), { status: 0, message: "ok" };
590
+ }
591
+ /**
592
+ * 清空区控、子区、信号机
593
+ * @returns
594
+ */
595
+ async clearSignalControlArea() {
596
+ this.districtControllerOid = 0, this.subDistrictControllerOid = 0, this.signalOid = 0;
597
+ let e = await this.districtControllerDashLayer.queryFeatures();
598
+ return await this.districtControllerDashLayer.applyEdits({
599
+ deleteFeatures: e.features
600
+ }), e = await this.districtControllerSolidLayer.queryFeatures(), await this.districtControllerSolidLayer.applyEdits({
601
+ deleteFeatures: e.features
602
+ }), e = await this.subDistrictControllerLayer.queryFeatures(), await this.subDistrictControllerLayer.applyEdits({
603
+ deleteFeatures: e.features
604
+ }), e = await this.signalMarkerLayer.queryFeatures(), await this.signalMarkerLayer.applyEdits({
605
+ deleteFeatures: e.features
606
+ }), e = await this.signalPictureLayer.queryFeatures(), await this.signalPictureLayer.applyEdits({
607
+ deleteFeatures: e.features
608
+ }), { status: 0, message: "ok" };
609
+ }
610
+ /**
611
+ * 设置区控、子区、信号机图层可见性
612
+ * @param layerName
613
+ * @param visible
614
+ */
615
+ setLayerVisibility(e) {
616
+ switch (e.visible === !1 && this.view.closePopup(), e.id) {
617
+ case "district":
618
+ this.districtControllerDashLayer.visible = e.visible, this.districtControllerSolidLayer.visible = e.visible;
619
+ break;
620
+ case "subDistrict":
621
+ this.subDistrictControllerLayer.visible = e.visible;
622
+ break;
623
+ case "signal":
624
+ this.signalMarkerLayer.visible = e.visible, this.signalPictureLayer.visible = e.visible;
625
+ break;
626
+ }
627
+ return { status: 0, message: "ok" };
628
+ }
629
+ /**
630
+ * 定位区控、子区、信号机
631
+ * @param params
632
+ * @returns
633
+ */
634
+ async locateSignalControlArea(e) {
635
+ switch (e.type) {
636
+ case "district": {
637
+ const r = this.districtControllerDashLayer.createQuery();
638
+ r.where = `id = '${e.id}'`, r.returnGeometry = !0, r.outFields = ["*"];
639
+ const i = await this.districtControllerDashLayer.queryFeatures(
640
+ r
641
+ );
642
+ return i.features.length > 0 ? (await this.view.goTo(i.features, {
643
+ duration: this.hasGpu ? 1e3 : 0
644
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
645
+ }
646
+ case "subDistrict":
647
+ const t = this.subDistrictControllerLayer.createQuery();
648
+ t.where = `id = '${e.id}'`, t.returnGeometry = !0, t.outFields = ["*"];
649
+ const s = await this.subDistrictControllerLayer.queryFeatures(
650
+ t
651
+ );
652
+ return s.features.length > 0 ? (await this.view.goTo(s.features, {
653
+ duration: this.hasGpu ? 1e3 : 0
654
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
655
+ case "signal": {
656
+ const r = this.signalMarkerLayer.createQuery();
657
+ r.where = `id = '${e.id}'`, r.returnGeometry = !0, r.outFields = ["*"];
658
+ const i = await this.signalMarkerLayer.queryFeatures(r);
659
+ return i.features.length > 0 ? (await this.view.goTo(
660
+ { target: i.features[0], scale: 2500 },
661
+ {
662
+ duration: this.hasGpu ? 1e3 : 0
663
+ }
664
+ ), { status: 0, message: "ok" }) : { status: 1, message: "未找到信号机" };
665
+ }
666
+ default:
667
+ return { status: 1, message: "未知类型" };
668
+ }
669
+ }
670
+ /**
671
+ * 高亮指定的区控、子区、信号机,其他隐藏
672
+ * @param params
673
+ * @returns
674
+ */
675
+ async highlightSignalControlArea(e) {
676
+ switch (e.type) {
677
+ case "district": {
678
+ this.districtControllerDashLayer.definitionExpression = `id = '${e.id}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${e.id}'`, this.subDistrictControllerLayer.definitionExpression = `parentId = '${e.id}'`, this.signalMarkerLayer.definitionExpression = `districtId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `districtId = '${e.id}'`;
679
+ const t = await this.districtControllerDashLayer.queryFeatures();
680
+ return t.features.length > 0 ? (await this.view.goTo(t.features, {
681
+ duration: this.hasGpu ? 1e3 : 0
682
+ }), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
683
+ }
684
+ case "subDistrict": {
685
+ this.subDistrictControllerLayer.definitionExpression = `id = '${e.id}'`, this.signalMarkerLayer.definitionExpression = `subDistrictId = '${e.id}'`, this.signalPictureLayer.definitionExpression = `subDistrictId = '${e.id}'`;
686
+ const t = await this.subDistrictControllerLayer.queryFeatures();
687
+ if (t.features.length > 0) {
688
+ const r = t.features[0].attributes.parentId;
689
+ return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, await this.view.goTo(t.features, {
690
+ duration: this.hasGpu ? 1e3 : 0
691
+ }), { status: 0, message: "ok" };
692
+ } else
693
+ return { status: 1, message: "未找到子区" };
694
+ }
695
+ case "signal": {
696
+ this.signalMarkerLayer.definitionExpression = `id = '${e.id}'`, this.signalPictureLayer.definitionExpression = `id = '${e.id}'`;
697
+ const t = await this.signalMarkerLayer.queryFeatures();
698
+ if (t.features.length > 0) {
699
+ const s = t.features[0], { districtId: r, subDistrictId: i } = s.attributes;
700
+ return this.districtControllerDashLayer.definitionExpression = `id = '${r}'`, this.districtControllerSolidLayer.definitionExpression = `id = '${r}'`, this.subDistrictControllerLayer.definitionExpression = `id = '${i}'`, await this.view.goTo(
701
+ { target: t.features, zoom: 2500 },
702
+ {
703
+ duration: this.hasGpu ? 1e3 : 0
704
+ }
705
+ ), { status: 0, message: "ok" };
706
+ } else
707
+ return { status: 1, message: "未找到信号机" };
708
+ }
709
+ default:
710
+ return { status: 1, message: "未知类型" };
711
+ }
712
+ }
713
+ /**
714
+ * 重置高亮,恢复全图视角
715
+ * @returns
716
+ */
717
+ async resetHighlight() {
718
+ this.districtControllerDashLayer.definitionExpression = "1=1", this.districtControllerSolidLayer.definitionExpression = "1=1", this.subDistrictControllerLayer.definitionExpression = "1=1", this.signalMarkerLayer.definitionExpression = "1=1";
719
+ const e = await this.districtControllerDashLayer.queryFeatures();
720
+ return this.view.goTo(e.features, {
721
+ duration: this.hasGpu ? 1e3 : 0
722
+ }), { status: 0, message: "ok" };
723
+ }
724
+ /**
725
+ * 绘制区控、子区和信号机
726
+ * @param districtController
727
+ * @param isDistrict 是否是区控
728
+ * @returns
729
+ */
730
+ async drawArea(e, t) {
731
+ const s = e.getAllSignalCoordinates();
732
+ if (s.length >= 2) {
733
+ let i = null;
734
+ if (s.length === 2)
735
+ i = l.lineString(s);
736
+ else {
737
+ if (t) {
738
+ const n = l.featureCollection(
739
+ s.map((d) => l.point(d))
740
+ );
741
+ i = p(n);
742
+ } else {
743
+ const n = m(s, 0.5);
744
+ n.length >= 4 && (i = l.polygon([n]));
745
+ }
746
+ i || (i = l.lineString(s));
747
+ }
748
+ const u = c(
749
+ i.geometry,
750
+ // 区控面积更大,需要更大的缓冲半径
751
+ t ? 200 : 30,
752
+ {
753
+ units: "meters"
754
+ }
755
+ ), o = new y({
756
+ geometry: {
757
+ type: "polyline",
758
+ paths: u.geometry.coordinates
759
+ },
760
+ attributes: {
761
+ ObjectID: t ? this.districtControllerOid++ : this.subDistrictControllerOid++,
762
+ id: e.id,
763
+ name: e.name,
764
+ subDistrictCount: e.subDistrictCount,
765
+ signalCount: e.signalCount,
766
+ parentId: e.parentId,
767
+ parentName: e.parentName
768
+ }
769
+ });
770
+ t ? (await this.districtControllerDashLayer.applyEdits({
771
+ addFeatures: [o]
772
+ }), await this.districtControllerSolidLayer.applyEdits({
773
+ addFeatures: [o]
774
+ })) : this.subDistrictGraphics.push(o);
775
+ }
776
+ for (const i of e.subDistricts)
777
+ await this.drawArea(i, !1);
778
+ const r = e.signals.map((i) => new y({
779
+ geometry: {
780
+ type: "point",
781
+ x: i.longitude,
782
+ y: i.latitude
783
+ },
784
+ attributes: {
785
+ ObjectID: this.signalOid++,
786
+ id: i.id,
787
+ name: i.name,
788
+ signalId: i.signalId,
789
+ nodeId: i.id,
790
+ isKey: i.isKey,
791
+ districtId: t ? e.id : e.parentId,
792
+ districtName: t ? e.name : e.parentName,
793
+ subDistrictId: t ? "" : e.id,
794
+ subDistrictName: t ? "" : e.name
795
+ }
796
+ }));
797
+ await this.signalMarkerLayer.applyEdits({
798
+ addFeatures: r
799
+ }), await this.signalPictureLayer.applyEdits({
800
+ addFeatures: r
801
+ });
802
+ }
803
+ }
804
+ export {
805
+ S as default
806
+ };