gisviewer-vue3-arcgis 1.0.284 → 1.0.285

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 (95) hide show
  1. package/es/index.mjs +6 -5
  2. package/es/src/gis-map/gis-map.vue.d.ts +124 -1
  3. package/es/src/gis-map/gis-map.vue.mjs +63 -63
  4. package/es/src/gis-map/index.d.ts +124 -1
  5. package/es/src/gis-map/utils/edpass-device-controller.mjs +278 -0
  6. package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +362 -0
  7. package/es/src/gis-map/utils/holo-flow/index.mjs +101 -0
  8. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +125 -0
  9. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +153 -0
  10. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +4 -0
  11. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +336 -0
  12. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +236 -0
  13. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +106 -0
  14. package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +576 -0
  15. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +386 -0
  16. package/es/src/gis-map/utils/index.mjs +2 -2
  17. package/es/src/gis-map/utils/police-jurisdiction.mjs +202 -0
  18. package/es/src/gis-map/utils/road-config-tool/cross.mjs +127 -0
  19. package/es/src/gis-map/utils/road-config-tool/entrance.mjs +79 -0
  20. package/es/src/gis-map/utils/road-config-tool/exit.mjs +86 -0
  21. package/es/src/gis-map/utils/road-config-tool/index.mjs +112 -0
  22. package/es/src/gis-map/utils/road-config-tool/indicator-area.mjs +44 -0
  23. package/es/src/gis-map/utils/road-config-tool/lane.mjs +35 -0
  24. package/es/src/gis-map/utils/road-config-tool/search-nearby-lanes.mjs +265 -0
  25. package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +593 -0
  26. package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +84 -0
  27. package/es/src/gis-map/utils/signal-control-area/district-renderer.mjs +122 -0
  28. package/es/src/gis-map/utils/signal-control-area/edit-area.mjs +550 -0
  29. package/es/src/gis-map/utils/signal-control-area/layer-symbol.mjs +984 -0
  30. package/es/src/gis-map/utils/signal-control-area/signal-area-controller.mjs +140 -0
  31. package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.mjs +423 -0
  32. package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +123 -0
  33. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +367 -0
  34. package/es/src/gis-map/utils/signal-system/signal-system-controller.mjs +137 -0
  35. package/es/src/gis-map/utils/sketchViewTool.mjs +503 -0
  36. package/es/src/gis-map-ol/gis-map-ol.vue.d.ts +50 -0
  37. package/es/src/gis-map-ol/gis-map-ol.vue.mjs +67 -0
  38. package/es/src/gis-map-ol/gis-map-ol.vue2.mjs +4 -0
  39. package/es/src/gis-map-ol/gis-map-ol.vue3.mjs +5 -0
  40. package/es/src/gis-map-ol/index.d.ts +44 -1
  41. package/es/src/gis-map-ol/index.mjs +8 -0
  42. package/es/src/gis-map-ol/utils/ol-map-initializer.d.ts +28 -0
  43. package/es/src/gis-map-ol/utils/ol-map-initializer.mjs +129 -0
  44. package/es/src/gis-map-ol/utils/signal-control/signal-cross-controller.d.ts +42 -0
  45. package/es/src/gis-map-ol/utils/signal-control/signal-cross-controller.mjs +263 -0
  46. package/es/src/index.mjs +4 -4
  47. package/es/src/types/index.mjs +5 -0
  48. package/lib/index.js +1 -1
  49. package/lib/src/gis-map/gis-map.vue.d.ts +124 -1
  50. package/lib/src/gis-map/gis-map.vue.js +1 -1
  51. package/lib/src/gis-map/index.d.ts +124 -1
  52. package/lib/src/gis-map/utils/edpass-device-controller.js +1 -0
  53. package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -0
  54. package/lib/src/gis-map/utils/holo-flow/index.js +1 -0
  55. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +125 -0
  56. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -0
  57. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -0
  58. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -0
  59. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -0
  60. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +2 -0
  61. package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -0
  62. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -0
  63. package/lib/src/gis-map/utils/index.js +1 -1
  64. package/lib/src/gis-map/utils/police-jurisdiction.js +1 -0
  65. package/lib/src/gis-map/utils/road-config-tool/cross.js +1 -0
  66. package/lib/src/gis-map/utils/road-config-tool/entrance.js +1 -0
  67. package/lib/src/gis-map/utils/road-config-tool/exit.js +1 -0
  68. package/lib/src/gis-map/utils/road-config-tool/index.js +1 -0
  69. package/lib/src/gis-map/utils/road-config-tool/indicator-area.js +1 -0
  70. package/lib/src/gis-map/utils/road-config-tool/lane.js +1 -0
  71. package/lib/src/gis-map/utils/road-config-tool/search-nearby-lanes.js +1 -0
  72. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -0
  73. package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -0
  74. package/lib/src/gis-map/utils/signal-control-area/district-renderer.js +1 -0
  75. package/lib/src/gis-map/utils/signal-control-area/edit-area.js +1 -0
  76. package/lib/src/gis-map/utils/signal-control-area/layer-symbol.js +1 -0
  77. package/lib/src/gis-map/utils/signal-control-area/signal-area-controller.js +1 -0
  78. package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.js +1 -0
  79. package/lib/src/gis-map/utils/signal-control-area/signal-renderer.js +1 -0
  80. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -0
  81. package/lib/src/gis-map/utils/signal-system/signal-system-controller.js +1 -0
  82. package/lib/src/gis-map/utils/sketchViewTool.js +1 -0
  83. package/lib/src/gis-map-ol/gis-map-ol.vue.d.ts +50 -0
  84. package/lib/src/gis-map-ol/gis-map-ol.vue.js +1 -0
  85. package/lib/src/gis-map-ol/gis-map-ol.vue2.js +1 -0
  86. package/lib/src/gis-map-ol/gis-map-ol.vue3.js +1 -0
  87. package/lib/src/gis-map-ol/index.d.ts +44 -1
  88. package/lib/src/gis-map-ol/index.js +1 -0
  89. package/lib/src/gis-map-ol/utils/ol-map-initializer.d.ts +28 -0
  90. package/lib/src/gis-map-ol/utils/ol-map-initializer.js +1 -0
  91. package/lib/src/gis-map-ol/utils/signal-control/signal-cross-controller.d.ts +42 -0
  92. package/lib/src/gis-map-ol/utils/signal-control/signal-cross-controller.js +1 -0
  93. package/lib/src/index.js +1 -1
  94. package/lib/src/types/index.js +1 -0
  95. package/package.json +1 -1
@@ -0,0 +1,386 @@
1
+ import p from "@arcgis/core/Graphic";
2
+ import m from "@arcgis/core/layers/GraphicsLayer";
3
+ import { toRaw as g } from "vue";
4
+ import y from "../../../stores/index.mjs";
5
+ class v {
6
+ constructor(i) {
7
+ this.hasGpu = !1, this.appDataStore = y.useAppDataStore, this.logTable = [
8
+ [
9
+ "uuid",
10
+ "ptcId",
11
+ "plateno",
12
+ "timestamp",
13
+ "localTimestamp",
14
+ "timestamp_str",
15
+ "speed",
16
+ "laneNo",
17
+ "objHeight",
18
+ "objLength",
19
+ "latitude",
20
+ "longitude",
21
+ "ptcType",
22
+ "vehicleType",
23
+ "vehicleColor",
24
+ "plateColor",
25
+ "sbdm",
26
+ "heading",
27
+ "fixAngle",
28
+ "roadLayer",
29
+ "status",
30
+ "step",
31
+ "receiveTimestamp"
32
+ ]
33
+ ], this.needInterpolate = !0, this.isPaused = !1, this.showVehiclePlate = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.view = i, this.mapConfig = g(this.appDataStore.mapConfig), this.vehicleLayer = new m({
34
+ id: "vehicleLayer"
35
+ }), this.view.map.add(this.vehicleLayer);
36
+ const t = localStorage.getItem("gpu");
37
+ this.hasGpu = t !== "Unknown", this.hasGpu && (this.rafSignal = requestAnimationFrame(() => this.render()));
38
+ }
39
+ getLog() {
40
+ return this.logTable;
41
+ }
42
+ async init() {
43
+ }
44
+ addVehicles(i) {
45
+ return new Promise((t) => {
46
+ if (this.isPaused) {
47
+ t();
48
+ return;
49
+ }
50
+ const e = i.map((s) => {
51
+ const { vehicleId: r, heading: o, localTimestamp: l } = s, n = Number(s.x), h = Number(s.y), a = new p({
52
+ geometry: {
53
+ type: "point",
54
+ x: n,
55
+ y: h
56
+ },
57
+ attributes: {
58
+ ...s,
59
+ type: "trackVehicle"
60
+ },
61
+ symbol: this.hasGpu ? this.createCIMSymbol(s) : this.createMarkerSymbol()
62
+ });
63
+ return this.hasGpu && (a.visible = !1, this.historyPositionMap.set(r, [
64
+ { pos: [n, h, 0], heading: o, time: l }
65
+ ]), this.vehicleObjectMap.set(r, {
66
+ graphic: a,
67
+ data: s,
68
+ waitForDelete: !1,
69
+ isMoving: !1
70
+ })), a;
71
+ });
72
+ this.vehicleLayer.addMany(e), t();
73
+ });
74
+ }
75
+ updateVehicles(i) {
76
+ return new Promise((t) => {
77
+ if (this.isPaused) {
78
+ t();
79
+ return;
80
+ }
81
+ const e = [];
82
+ i.forEach((s) => {
83
+ const { vehicleId: r, heading: o, localTimestamp: l } = s, n = Number(s.x), h = Number(s.y);
84
+ if (this.hasGpu) {
85
+ const a = this.vehicleObjectMap.get(r);
86
+ a ? (a.data = s, a.graphic.attributes = {
87
+ ...s,
88
+ type: "trackVehicle"
89
+ }, this.historyPositionMap.get(
90
+ r
91
+ ).push({
92
+ pos: [n, h, 0],
93
+ heading: o,
94
+ time: l
95
+ })) : e.push(s);
96
+ } else {
97
+ const a = this.vehicleLayer.graphics.find(
98
+ (c) => c.getAttribute("vehicleId") == s.vehicleId
99
+ );
100
+ a ? a.geometry = {
101
+ type: "point",
102
+ x: n,
103
+ y: h
104
+ } : e.push(s);
105
+ }
106
+ }), this.addVehicles(e), t();
107
+ });
108
+ }
109
+ deleteVehicles(i) {
110
+ this.isPaused || (this.hasGpu ? i.forEach((t) => {
111
+ const e = this.vehicleObjectMap.get(t);
112
+ e && (e.waitForDelete = !0);
113
+ }) : i.forEach((t) => {
114
+ const e = this.vehicleLayer.graphics.find(
115
+ (s) => s.getAttribute("vehicleId") == t
116
+ );
117
+ e && this.vehicleLayer.remove(e);
118
+ }));
119
+ }
120
+ clearVehicles() {
121
+ this.vehicleLayer.removeAll(), this.vehicleObjectMap.clear(), this.historyPositionMap.clear();
122
+ }
123
+ /**
124
+ * 设置地面车辆显示隐藏
125
+ * @param visible
126
+ */
127
+ toggleGroundVehicle(i) {
128
+ this.showGroundVehicle = i;
129
+ }
130
+ /**
131
+ * 设置高架车辆显示隐藏
132
+ * @param visible
133
+ */
134
+ toggleElevatedVehicle(i) {
135
+ this.showElevatedVehicle = i;
136
+ }
137
+ toggleTrafficInfo(i) {
138
+ i.name === "vehiclePlate" && (this.showVehiclePlate = i.visible);
139
+ }
140
+ togglePause(i) {
141
+ this.isPaused = i, this.isPaused && this.rafSignal ? cancelAnimationFrame(this.rafSignal) : this.rafSignal = requestAnimationFrame(() => this.render());
142
+ }
143
+ updatePanelContent(i) {
144
+ console.log(i);
145
+ }
146
+ setInterpolate(i) {
147
+ this.needInterpolate = i;
148
+ }
149
+ render() {
150
+ this.isPaused || this.vehicleObjectMap.forEach((i, t) => {
151
+ this.updatePosition(t);
152
+ }), this.rafSignal = requestAnimationFrame(() => this.render());
153
+ }
154
+ updatePosition(i) {
155
+ const t = this.historyPositionMap.get(i), e = this.vehicleObjectMap.get(i);
156
+ if (!t || !e || !e.isMoving && t.length <= 2)
157
+ return;
158
+ e.isMoving = !0, (e.graphic.getAttribute("roadLayer") || "1") === "1" ? e.graphic.visible = this.showGroundVehicle : e.graphic.visible = this.showElevatedVehicle, e.segmentStartTime || (e.segmentStartTime = Date.now(), e.segmentTotalTime = t[1].time - t[0].time);
159
+ const r = Date.now() - e.segmentStartTime, o = Math.min(
160
+ 1,
161
+ r / e.segmentTotalTime
162
+ );
163
+ if (o === 1)
164
+ if (t.shift(), t.length === 1) {
165
+ e.waitForDelete ? (this.vehicleLayer.remove(e.graphic), this.vehicleObjectMap.delete(i), this.historyPositionMap.delete(i)) : (e.segmentStartTime = void 0, e.segmentTotalTime = void 0, e.graphic.visible = !1, e.isMoving = !1);
166
+ return;
167
+ } else {
168
+ e.segmentStartTime = Date.now();
169
+ const l = r - e.segmentTotalTime;
170
+ e.segmentTotalTime = t[1].time - t[0].time - l, Math.abs(t[1].heading - t[0].heading) > 180 && (t[1].heading > t[0].heading ? t[0].heading += 360 : t[1].heading += 360), e.graphic.geometry = {
171
+ type: "point",
172
+ x: t[0].pos[0],
173
+ y: t[0].pos[1]
174
+ };
175
+ }
176
+ else {
177
+ const l = t[0].pos[0] + (t[1].pos[0] - t[0].pos[0]) * o, n = t[0].pos[1] + (t[1].pos[1] - t[0].pos[1]) * o, h = t[0].heading + (t[1].heading - t[0].heading) * o;
178
+ e.graphic.geometry = {
179
+ type: "point",
180
+ x: l,
181
+ y: n
182
+ }, e.data.heading = h, e.graphic.symbol = this.hasGpu ? this.createCIMSymbol(e.data) : this.createMarkerSymbol();
183
+ }
184
+ }
185
+ /**
186
+ * 基于轨迹数据创建cim符号,显示车辆图标和车牌号码
187
+ * @param vehTrack
188
+ * @returns
189
+ */
190
+ createCIMSymbol(i) {
191
+ const t = this.getPlateFontColor(i.plateColor), e = this.getCarPic(i.vehicleColor, i.speed);
192
+ return {
193
+ type: "cim",
194
+ data: {
195
+ type: "CIMSymbolReference",
196
+ primitiveOverrides: [
197
+ {
198
+ // 将textGraphic的TextString替换为graphic.attributes.showName
199
+ type: "CIMPrimitiveOverride",
200
+ primitiveName: "textGraphic",
201
+ propertyName: "TextString",
202
+ valueExpressionInfo: {
203
+ type: "CIMExpressionInfo",
204
+ title: "Custom",
205
+ expression: "$feature.showName",
206
+ returnType: "Default"
207
+ }
208
+ }
209
+ ],
210
+ symbol: {
211
+ type: "CIMPointSymbol",
212
+ symbolLayers: [
213
+ // 车辆号牌
214
+ {
215
+ type: "CIMVectorMarker",
216
+ enable: this.showVehiclePlate,
217
+ size: 32,
218
+ colorLocked: !0,
219
+ anchorPointUnits: "Relative",
220
+ frame: { xmin: -8, ymin: -8, xmax: 8, ymax: 8 },
221
+ markerGraphics: [
222
+ {
223
+ type: "CIMMarkerGraphic",
224
+ primitiveName: "textGraphic",
225
+ geometry: { x: 0, y: 0 },
226
+ symbol: {
227
+ type: "CIMTextSymbol",
228
+ height: 4,
229
+ horizontalAlignment: "Center",
230
+ offsetX: 0,
231
+ offsetY: 8,
232
+ haloSize: 1,
233
+ haloSymbol: {
234
+ type: "CIMPolygonSymbol",
235
+ symbolLayers: [
236
+ {
237
+ type: "CIMSolidFill",
238
+ enable: !0,
239
+ color: t.backgroundColor
240
+ }
241
+ ]
242
+ },
243
+ symbol: {
244
+ type: "CIMPolygonSymbol",
245
+ symbolLayers: [
246
+ {
247
+ type: "CIMSolidFill",
248
+ enable: !0,
249
+ color: t.fillColor
250
+ }
251
+ ]
252
+ },
253
+ verticalAlignment: "Center"
254
+ },
255
+ textString: ""
256
+ }
257
+ ],
258
+ scaleSymbolsProportionally: !0,
259
+ respectFrame: !0
260
+ },
261
+ // 车辆图标
262
+ {
263
+ type: "CIMPictureMarker",
264
+ enable: !0,
265
+ anchorPoint: {
266
+ x: 0,
267
+ y: 0
268
+ },
269
+ anchorPointUnits: "Relative",
270
+ size: e.size,
271
+ rotation: i.heading,
272
+ rotateClockwise: !0,
273
+ textureFilter: "Picture",
274
+ url: `${this.mapConfig.assetsRoot}Images/${e.pic}`
275
+ }
276
+ ]
277
+ }
278
+ }
279
+ };
280
+ }
281
+ createMarkerSymbol() {
282
+ return {
283
+ type: "simple-marker",
284
+ color: "green",
285
+ size: 5,
286
+ outline: {
287
+ color: "white",
288
+ width: 1
289
+ }
290
+ };
291
+ }
292
+ /**
293
+ * 根据车身颜色属性返回对应的车辆图标
294
+ * @param carColor
295
+ * @returns
296
+ */
297
+ getCarPic(i, t) {
298
+ if (this.view.scale >= 1e3) {
299
+ let e = "point_green.png";
300
+ return t && (t <= 4.2 ? e = "point_red.png" : t <= 8.4 ? e = "point_yellow.png" : e = "point_green.png"), {
301
+ pic: e,
302
+ size: 15
303
+ };
304
+ } else {
305
+ let e = "grey";
306
+ switch (typeof i == "string" && (i = i.toLowerCase()), i) {
307
+ case "a":
308
+ case 1:
309
+ e = "white";
310
+ break;
311
+ case "b":
312
+ case 2:
313
+ e = "grey";
314
+ break;
315
+ case "c":
316
+ case 3:
317
+ e = "yellow";
318
+ break;
319
+ case "d":
320
+ case 4:
321
+ e = "pink";
322
+ break;
323
+ case "e":
324
+ case 5:
325
+ e = "red";
326
+ break;
327
+ case "f":
328
+ case 10:
329
+ e = "purple";
330
+ break;
331
+ case "g":
332
+ case 6:
333
+ e = "green";
334
+ break;
335
+ case "h":
336
+ case 7:
337
+ e = "blue";
338
+ break;
339
+ case "i":
340
+ case 8:
341
+ e = "brown";
342
+ break;
343
+ case "j":
344
+ case 9:
345
+ e = "black";
346
+ break;
347
+ }
348
+ return { pic: "/car/" + e + ".png", size: 20 };
349
+ }
350
+ }
351
+ /**
352
+ * 根据号牌颜色属性获取填充色和背景色
353
+ * @param plateColor
354
+ * @returns
355
+ */
356
+ getPlateFontColor(i) {
357
+ let t = [255, 255, 255, 255], e = [169, 169, 169, 255];
358
+ switch (i) {
359
+ case 0:
360
+ t = [0, 0, 0, 255], e = [255, 255, 255, 255];
361
+ break;
362
+ case 1:
363
+ t = [0, 0, 0, 255], e = [244, 164, 96, 255];
364
+ break;
365
+ case 2:
366
+ t = [255, 255, 255, 255], e = [65, 105, 225, 255];
367
+ break;
368
+ case 3:
369
+ t = [255, 255, 255, 255], e = [0, 0, 0, 255];
370
+ break;
371
+ case 15:
372
+ t = [244, 164, 96, 255], e = [0, 250, 154, 255];
373
+ break;
374
+ case 16:
375
+ t = [0, 0, 0, 255], e = [0, 250, 154, 255];
376
+ break;
377
+ }
378
+ return {
379
+ fillColor: t,
380
+ backgroundColor: e
381
+ };
382
+ }
383
+ }
384
+ export {
385
+ v as default
386
+ };
@@ -1,9 +1,9 @@
1
1
  import o from "./FlyToPoints.mjs";
2
2
  import r from "./map-initializer.mjs";
3
3
  import i from "./overlay.mjs";
4
- import m from "./road-config-tool";
4
+ import m from "./road-config-tool/index.mjs";
5
5
  import t from "./sketchView.mjs";
6
- import e from "./sketchViewTool";
6
+ import e from "./sketchViewTool.mjs";
7
7
  import p from "./GreenWaveline.mjs";
8
8
  import a from "./Layers.mjs";
9
9
  import f from "./syncMapView.mjs";
@@ -0,0 +1,202 @@
1
+ import { Polygon as h } from "@arcgis/core/geometry";
2
+ import * as n from "@arcgis/core/geometry/geometryEngine.js";
3
+ import m from "@arcgis/core/Graphic";
4
+ import k from "@arcgis/core/layers/GraphicsLayer";
5
+ import g from "axios";
6
+ import { toRaw as L } from "vue";
7
+ import E from "../../stores/index.mjs";
8
+ import f from "./common-utils.mjs";
9
+ class R {
10
+ constructor(o) {
11
+ this.view = o, this.maskLayer = new k({
12
+ id: "police-jurisdiction"
13
+ }), this.view.map.add(this.maskLayer);
14
+ const t = E.useAppDataStore, r = L(t.mapConfig);
15
+ this.geoServer = r.geoServer;
16
+ }
17
+ async showJurisdiction(o) {
18
+ return this.geoServer ? o.type.toLowerCase() === "zd" ? await this.showZD(o.id) : o.type.toLowerCase() === "dd" ? await this.showDD(o.id) : { status: 0, message: "ok" } : { status: -1, message: "未配置GeoServer" };
19
+ }
20
+ /**
21
+ * 显示支队辖区
22
+ * @param zdCode
23
+ */
24
+ async showZD(o) {
25
+ let t = await g.get(`${this.geoServer}/zd_edpass/wms`, {
26
+ params: {
27
+ service: "WFS",
28
+ version: "1.1.0",
29
+ request: "GetFeature",
30
+ typename: "zd_edpass:VIEW_SH_ZD",
31
+ outputFormat: "application/json",
32
+ CQL_FILTER: `ZD_CODE = ${o}`
33
+ }
34
+ });
35
+ if (t.status !== 200)
36
+ return { status: -1, message: t.status + " " + t.statusText };
37
+ const { features: r } = t.data;
38
+ if (!r || r.length === 0)
39
+ return { status: -1, message: "未查询到数据" };
40
+ this.maskLayer.removeAll();
41
+ const l = r[0].geometry.coordinates, s = [];
42
+ l.forEach((e) => {
43
+ const i = new h({
44
+ rings: e
45
+ });
46
+ s.push(i);
47
+ });
48
+ const p = s[0].centroid, u = n.geodesicBuffer(
49
+ p,
50
+ 100,
51
+ "kilometers"
52
+ );
53
+ let a = n.difference(
54
+ u,
55
+ s[0]
56
+ );
57
+ for (let e = 1; e < s.length; e++)
58
+ a = n.difference(
59
+ a,
60
+ s[e]
61
+ );
62
+ const y = new m({
63
+ geometry: a,
64
+ symbol: {
65
+ type: "simple-fill",
66
+ color: [100, 100, 100, 0.8],
67
+ outline: {
68
+ width: 0
69
+ }
70
+ },
71
+ attributes: { type: "mask" }
72
+ });
73
+ this.maskLayer.add(y);
74
+ const d = s.map((e) => new m({
75
+ geometry: e,
76
+ symbol: {
77
+ type: "simple-line",
78
+ style: "solid",
79
+ color: [240, 156, 69],
80
+ width: 2
81
+ }
82
+ }));
83
+ if (this.maskLayer.addMany(d), await f.viewGoto(this.view, d), t = await g.get(`${this.geoServer}/zd_edpass/wms`, {
84
+ params: {
85
+ service: "WFS",
86
+ version: "1.1.0",
87
+ request: "GetFeature",
88
+ typename: "zd_edpass:VW_DWD_GEO_SH_DD",
89
+ outputFormat: "application/json",
90
+ CQL_FILTER: `ZD_CODE = ${o}`
91
+ }
92
+ }), t.status === 200) {
93
+ const { features: e } = t.data;
94
+ if (e && e.length > 0) {
95
+ const i = [];
96
+ e.forEach((c) => {
97
+ c.geometry.coordinates.forEach((_) => {
98
+ const v = new h({
99
+ rings: _
100
+ }), G = new m({
101
+ geometry: v,
102
+ symbol: {
103
+ type: "simple-line",
104
+ style: "dash",
105
+ color: [240, 156, 69],
106
+ width: 1
107
+ }
108
+ });
109
+ i.push(G);
110
+ });
111
+ const w = c.properties.DD_NAME, D = new m({
112
+ geometry: {
113
+ type: "point",
114
+ longitude: c.properties.CENTER_X,
115
+ latitude: c.properties.CENTER_Y
116
+ },
117
+ symbol: {
118
+ type: "text",
119
+ color: [240, 156, 69],
120
+ haloColor: [255, 255, 255],
121
+ haloSize: "2px",
122
+ text: w,
123
+ font: {
124
+ size: "14px",
125
+ weight: "bold",
126
+ family: "msyh"
127
+ }
128
+ }
129
+ });
130
+ i.push(D);
131
+ }), this.maskLayer.addMany(i);
132
+ }
133
+ }
134
+ return { status: 0, message: "ok" };
135
+ }
136
+ async showDD(o) {
137
+ this.maskLayer.removeAll();
138
+ const t = await g.get(`${this.geoServer}/zd_edpass/wms`, {
139
+ params: {
140
+ service: "WFS",
141
+ version: "1.1.0",
142
+ request: "GetFeature",
143
+ typename: "zd_edpass:VW_DWD_GEO_SH_DD",
144
+ outputFormat: "application/json",
145
+ CQL_FILTER: `DD_CODE = ${o}`
146
+ }
147
+ });
148
+ if (console.log(t), t.status !== 200)
149
+ return { status: -1, message: t.status + " " + t.statusText };
150
+ const { features: r } = t.data;
151
+ if (!r || r.length === 0)
152
+ return { status: -1, message: "未查询到数据" };
153
+ const l = r[0].geometry.coordinates, s = [];
154
+ l.forEach((e) => {
155
+ const i = new h({
156
+ rings: e
157
+ });
158
+ s.push(i);
159
+ });
160
+ const p = s[0].centroid, u = n.geodesicBuffer(
161
+ p,
162
+ 100,
163
+ "kilometers"
164
+ );
165
+ let a = n.difference(
166
+ u,
167
+ s[0]
168
+ );
169
+ for (let e = 1; e < s.length; e++)
170
+ a = n.difference(
171
+ a,
172
+ s[e]
173
+ );
174
+ const y = new m({
175
+ geometry: a,
176
+ symbol: {
177
+ type: "simple-fill",
178
+ color: [100, 100, 100, 0.8],
179
+ outline: {
180
+ width: 0
181
+ }
182
+ }
183
+ });
184
+ this.maskLayer.add(y);
185
+ const d = s.map((e) => new m({
186
+ geometry: e,
187
+ symbol: {
188
+ type: "simple-line",
189
+ style: "dash",
190
+ color: [240, 156, 69],
191
+ width: 1
192
+ }
193
+ }));
194
+ return this.maskLayer.addMany(d), await f.viewGoto(this.view, d), { status: 0, message: "ok" };
195
+ }
196
+ clearJurisdiction() {
197
+ this.maskLayer.removeAll();
198
+ }
199
+ }
200
+ export {
201
+ R as default
202
+ };