gisviewer-vue3-arcgis 1.0.266 → 1.0.268

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 (26) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +9 -2
  2. package/es/src/gis-map/gis-map.vue.mjs +184 -181
  3. package/es/src/gis-map/index.d.ts +7 -1
  4. package/es/src/gis-map/utils/map-initializer.mjs +86 -79
  5. package/es/src/gis-map/utils/police-jurisdiction.d.ts +6 -0
  6. package/es/src/gis-map/utils/police-jurisdiction.mjs +167 -74
  7. package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +101 -45
  8. package/es/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
  9. package/es/src/gis-map/utils/signal-control-area/{show-area.mjs → signal-area-controller.mjs} +11 -11
  10. package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
  11. package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.mjs +193 -0
  12. package/es/src/types/index.d.ts +16 -1
  13. package/lib/src/gis-map/gis-map.vue.d.ts +9 -2
  14. package/lib/src/gis-map/gis-map.vue.js +1 -1
  15. package/lib/src/gis-map/index.d.ts +7 -1
  16. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  17. package/lib/src/gis-map/utils/police-jurisdiction.d.ts +6 -0
  18. package/lib/src/gis-map/utils/police-jurisdiction.js +1 -1
  19. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -1
  20. package/lib/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
  21. package/lib/src/gis-map/utils/signal-control-area/signal-area-controller.js +1 -0
  22. package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
  23. package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.js +1 -0
  24. package/lib/src/types/index.d.ts +16 -1
  25. package/package.json +1 -1
  26. package/lib/src/gis-map/utils/signal-control-area/show-area.js +0 -1
@@ -1,12 +1,12 @@
1
1
  import L from "@arcgis/core/Basemap";
2
2
  import v from "@arcgis/core/config";
3
3
  import * as M from "@arcgis/core/core/reactiveUtils";
4
- import { Multipoint as z, Polygon as k, Polyline as W, Point as T } from "@arcgis/core/geometry";
4
+ import { Multipoint as W, Polygon as k, Polyline as I, Point as T } from "@arcgis/core/geometry";
5
5
  import * as b from "@arcgis/core/geometry/support/webMercatorUtils";
6
- import { webMercatorToGeographic as I } from "@arcgis/core/geometry/support/webMercatorUtils";
6
+ import { webMercatorToGeographic as G } from "@arcgis/core/geometry/support/webMercatorUtils";
7
7
  import C from "@arcgis/core/Graphic";
8
- import G from "@arcgis/core/layers/FeatureLayer";
9
- import x from "@arcgis/core/layers/GeoJSONLayer";
8
+ import x from "@arcgis/core/layers/FeatureLayer";
9
+ import P from "@arcgis/core/layers/GeoJSONLayer";
10
10
  import S from "@arcgis/core/layers/GroupLayer";
11
11
  import H from "@arcgis/core/layers/IntegratedMesh3DTilesLayer";
12
12
  import B from "@arcgis/core/layers/MapImageLayer";
@@ -15,9 +15,9 @@ import R from "@arcgis/core/layers/WebTileLayer";
15
15
  import E from "@arcgis/core/layers/WMSLayer";
16
16
  import N from "@arcgis/core/Map";
17
17
  import A from "@arcgis/core/views/MapView";
18
- import U from "@arcgis/core/views/SceneView";
19
- import V from "@turf/destination";
20
- import * as j from "@turf/helpers";
18
+ import j from "@arcgis/core/views/SceneView";
19
+ import U from "@turf/destination";
20
+ import * as V from "@turf/helpers";
21
21
  import D from "@arcgis/core/layers/GraphicsLayer";
22
22
  import J from "./custom-layer/custom-wmts-layer.mjs";
23
23
  class me {
@@ -35,7 +35,7 @@ class me {
35
35
  async initialize(e) {
36
36
  var p, u, g, f;
37
37
  this.mapConfig = e.mapConfig;
38
- const { container: i, markerClickCallback: s, mapClickCallback: a } = e;
38
+ const { container: i, markerClickCallback: s, mapClickCallback: r } = e;
39
39
  v.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, v.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, v.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
40
40
  const o = new N();
41
41
  ((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new A({
@@ -44,7 +44,7 @@ class me {
44
44
  ...this.mapConfig.mapOptions
45
45
  }), this.view.on("drag", (t) => {
46
46
  t.button === 2 && t.stopPropagation();
47
- })) : this.view = new U({
47
+ })) : this.view = new j({
48
48
  map: o,
49
49
  container: i,
50
50
  environment: {
@@ -64,46 +64,46 @@ class me {
64
64
  breakpoint: !1
65
65
  }, this.view.on("click", async (t) => {
66
66
  var h, y;
67
- if (a) {
68
- let n = t.mapPoint;
69
- n.spatialReference.isWebMercator && (n = b.webMercatorToGeographic(
70
- n
71
- )), a(
72
- [n.x, n.y],
67
+ if (r) {
68
+ let c = t.mapPoint;
69
+ c.spatialReference.isWebMercator && (c = b.webMercatorToGeographic(
70
+ c
71
+ )), r(
72
+ [c.x, c.y],
73
73
  [t.screenPoint.x, t.screenPoint.y],
74
74
  t
75
75
  );
76
76
  }
77
77
  if (this.view.type === "3d") {
78
- const n = this.view.camera;
78
+ const c = this.view.camera;
79
79
  if (this.view.spatialReference.isWebMercator) {
80
80
  const w = b.webMercatorToGeographic(
81
- n.position
81
+ c.position
82
82
  ), d = {
83
- heading: n.heading,
84
- tilt: n.tilt,
83
+ heading: c.heading,
84
+ tilt: c.tilt,
85
85
  position: w.toJSON()
86
86
  };
87
87
  console.log(d), (h = navigator.clipboard) == null || h.writeText(JSON.stringify(d));
88
88
  } else
89
- console.log(n.toJSON());
89
+ console.log(c.toJSON());
90
90
  console.log(this.view.zoom, this.view.scale);
91
91
  } else {
92
- let n = this.view.center;
93
- this.view.spatialReference.isWebMercator && (n = b.webMercatorToGeographic(
94
- n
92
+ let c = this.view.center;
93
+ this.view.spatialReference.isWebMercator && (c = b.webMercatorToGeographic(
94
+ c
95
95
  )), console.log({
96
- center: n.toJSON(),
96
+ center: c.toJSON(),
97
97
  zoom: this.view.zoom,
98
98
  scale: this.view.scale
99
99
  });
100
100
  }
101
- const c = (y = (await this.view.hitTest(t)).results) == null ? void 0 : y.filter(
102
- (n) => n.type === "graphic"
101
+ const n = (y = (await this.view.hitTest(t)).results) == null ? void 0 : y.filter(
102
+ (c) => c.type === "graphic"
103
103
  );
104
- c.length > 0 && c.forEach((n) => {
104
+ n.length > 0 && n.forEach((c) => {
105
105
  var d;
106
- const w = n.graphic;
106
+ const w = c.graphic;
107
107
  (d = w.attributes) != null && d.type && s && s(
108
108
  w.attributes.type,
109
109
  w.attributes.id,
@@ -113,19 +113,19 @@ class me {
113
113
  });
114
114
  });
115
115
  {
116
- let t = 0, r = !1;
117
- this.view.on("pointer-move", async (c) => {
116
+ let t = 0, a = !1;
117
+ this.view.on("pointer-move", async (n) => {
118
118
  var y;
119
119
  const h = performance.now();
120
- if (!(r || h - t < 100)) {
121
- t = h, r = !0;
120
+ if (!(a || h - t < 100)) {
121
+ t = h, a = !0;
122
122
  try {
123
- const w = (y = (await this.view.hitTest(c)).results) == null ? void 0 : y.some(
124
- (P) => P.type === "graphic"
123
+ const w = (y = (await this.view.hitTest(n)).results) == null ? void 0 : y.some(
124
+ (z) => z.type === "graphic"
125
125
  ), d = this.view.container;
126
126
  d && (d.style.cursor = w ? "pointer" : "default");
127
127
  } finally {
128
- r = !1;
128
+ a = !1;
129
129
  }
130
130
  }
131
131
  });
@@ -134,33 +134,33 @@ class me {
134
134
  const t = this.view.container;
135
135
  t && (t.style.cursor = "default");
136
136
  }), (g = this.mapConfig) != null && g.baseLayers ? this.mapConfig.baseLayers.forEach((t) => {
137
- const r = this.processUrl(t.url);
138
- let c = null;
137
+ const a = this.processUrl(t.url);
138
+ let n = null;
139
139
  switch (t.type.toLowerCase()) {
140
140
  case "webTile".toLowerCase(): {
141
- c = new R({
142
- urlTemplate: r,
141
+ n = new R({
142
+ urlTemplate: a,
143
143
  ...t.options
144
144
  });
145
145
  break;
146
146
  }
147
147
  case "tile": {
148
- c = new O({
149
- url: r,
148
+ n = new O({
149
+ url: a,
150
150
  ...t.options
151
151
  });
152
152
  break;
153
153
  }
154
154
  case "customwmts".toLowerCase(): {
155
- c = new J({
156
- urlTemplate: r,
155
+ n = new J({
156
+ urlTemplate: a,
157
157
  ...t.options
158
158
  });
159
159
  break;
160
160
  }
161
161
  case "mapimage".toLowerCase(): {
162
- c = new B({
163
- url: r,
162
+ n = new B({
163
+ url: a,
164
164
  ...t.options
165
165
  });
166
166
  break;
@@ -171,36 +171,43 @@ class me {
171
171
  break;
172
172
  }
173
173
  case "feature": {
174
- c = new G({ url: r, ...t.options });
174
+ n = new x({ url: a, ...t.options });
175
175
  break;
176
176
  }
177
177
  case "3dtiles": {
178
- c = new H({
179
- url: r,
178
+ n = new H({
179
+ url: a,
180
180
  ...t.options
181
181
  });
182
182
  break;
183
183
  }
184
184
  case "wms": {
185
- c = new E({
186
- url: r,
185
+ n = new E({
186
+ url: a,
187
+ ...t.options
188
+ });
189
+ break;
190
+ }
191
+ case "geojson": {
192
+ n = new P({
193
+ url: a,
187
194
  ...t.options
188
195
  });
189
196
  break;
190
197
  }
191
198
  }
192
- if (c)
199
+ if (n)
193
200
  if (t.group) {
194
201
  let h = o.findLayerById(t.group);
195
- h && h.type === "group" ? h.add(c) : (h = new S({
202
+ h && h.type === "group" ? h.add(n) : (h = new S({
196
203
  id: t.group,
197
204
  title: t.groupTitle,
198
205
  visibilityMode: "inherited",
199
- layers: [c],
206
+ layers: [n],
200
207
  visible: t.groupVisible !== !1
201
208
  }), o.add(h));
202
209
  } else
203
- o.add(c);
210
+ o.add(n);
204
211
  }) : o.basemap = new L({
205
212
  style: {
206
213
  id: "arcgis/light-gray",
@@ -208,12 +215,12 @@ class me {
208
215
  }
209
216
  }), (f = this.mapConfig) != null && f.hdLayers) {
210
217
  const t = this.mapConfig.hdLayers.map(
211
- (r) => (
218
+ (a) => (
212
219
  // 图层文件为GeoJson格式, renderer和symbol使用autocast配置
213
- new x({
214
- url: this.processUrl(r.url),
215
- ...r.options,
216
- title: r.options.id
220
+ new P({
221
+ url: this.processUrl(a.url),
222
+ ...a.options,
223
+ title: a.options.id
217
224
  })
218
225
  )
219
226
  );
@@ -244,8 +251,8 @@ class me {
244
251
  if (i === "shanghai_district")
245
252
  return !this.detachmentLayerLoaded && e.visible ? await this.loadDetachmentLayer() : this.detachmentLayer && (this.detachmentLayer.visible = s), { status: 0, message: "ok" };
246
253
  {
247
- const a = this.view.map.findLayerById(i);
248
- return a ? (a.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
254
+ const r = this.view.map.findLayerById(i);
255
+ return r ? (r.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
249
256
  }
250
257
  }
251
258
  /**
@@ -263,13 +270,13 @@ class me {
263
270
  e.target = new T(e.target);
264
271
  break;
265
272
  case "polyline":
266
- e.target = new W(e.target);
273
+ e.target = new I(e.target);
267
274
  break;
268
275
  case "polygon":
269
276
  e.target = new k(e.target);
270
277
  break;
271
278
  case "multipoint":
272
- e.target = new z(e.target);
279
+ e.target = new W(e.target);
273
280
  break;
274
281
  }
275
282
  await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
@@ -300,9 +307,9 @@ class me {
300
307
  { duration: (e.duration || 2) * 1e3 }
301
308
  );
302
309
  else {
303
- const a = Math.tan(i * Math.PI / 180) * e.height, o = V(
304
- j.point(e.center),
305
- a,
310
+ const r = Math.tan(i * Math.PI / 180) * e.height, o = U(
311
+ V.point(e.center),
312
+ r,
306
313
  s + 180,
307
314
  {
308
315
  units: "meters"
@@ -325,10 +332,10 @@ class me {
325
332
  async setMapCamera(e) {
326
333
  if (!this.view)
327
334
  return { status: -1, message: "未初始化" };
328
- const { name: i, duration: s = 0 } = e, { camera: a } = this.mapConfig;
329
- if (!a)
335
+ const { name: i, duration: s = 0 } = e, { camera: r } = this.mapConfig;
336
+ if (!r)
330
337
  return { status: -1, message: "未配置camera" };
331
- const o = a[i];
338
+ const o = r[i];
332
339
  return o ? (await this.view.goTo(o, { duration: s * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
333
340
  }
334
341
  /**
@@ -350,8 +357,8 @@ class me {
350
357
  const s = new T({
351
358
  x: i[0],
352
359
  y: i[1]
353
- }), a = this.view.toScreen(s);
354
- return [a.x, a.y];
360
+ }), r = this.view.toScreen(s);
361
+ return [r.x, r.y];
355
362
  });
356
363
  }
357
364
  /**
@@ -368,8 +375,8 @@ class me {
368
375
  const { min: i, max: s } = e;
369
376
  !i && !s || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = M.watch(
370
377
  () => this.view.zoom,
371
- (a) => {
372
- i && a <= i && (this.view.zoom = i), s && a >= s && (this.view.zoom = s);
378
+ (r) => {
379
+ i && r <= i && (this.view.zoom = i), s && r >= s && (this.view.zoom = s);
373
380
  }
374
381
  ));
375
382
  }
@@ -392,16 +399,16 @@ class me {
392
399
  );
393
400
  if (i)
394
401
  try {
395
- const a = await (await fetch(
402
+ const r = await (await fetch(
396
403
  "/GisViewerAssets/ShangHai/Layers/district.json"
397
404
  )).json(), o = [], { renderer: l, labelingInfo: m } = i.options;
398
- a.features.forEach((p) => {
405
+ r.features.forEach((p) => {
399
406
  const u = p.attributes.ZD_NAME;
400
407
  if (u !== "高架支队") {
401
408
  let g = new k({
402
409
  rings: p.geometry.rings
403
410
  });
404
- g = I(g);
411
+ g = G(g);
405
412
  const f = new C({
406
413
  geometry: g,
407
414
  attributes: p.attributes
@@ -410,10 +417,10 @@ class me {
410
417
  if (l.type === "simple")
411
418
  f.symbol = l.symbol;
412
419
  else if (l.type === "unique-value") {
413
- const t = f.getAttribute("OBJECTID"), r = l.uniqueValueInfos.find(
414
- (c) => c.value == t
420
+ const t = f.getAttribute("OBJECTID"), a = l.uniqueValueInfos.find(
421
+ (n) => n.value == t
415
422
  );
416
- f.symbol = r ? r.symbol : l.defaultSymbol;
423
+ f.symbol = a ? a.symbol : l.defaultSymbol;
417
424
  }
418
425
  } else
419
426
  f.symbol = {
@@ -5,5 +5,11 @@ export default class PoliceJurisdiction {
5
5
  private maskLayer;
6
6
  constructor(view: __esri.MapView | __esri.SceneView);
7
7
  showJurisdiction(params: IShowJurisdictionParams): Promise<IResult>;
8
+ /**
9
+ * 显示支队辖区
10
+ * @param zdCode
11
+ */
12
+ private showZD;
13
+ private showDD;
8
14
  clearJurisdiction(): void;
9
15
  }
@@ -1,94 +1,66 @@
1
- import { Polygon as L } from "@arcgis/core/geometry";
2
- import * as l from "@arcgis/core/geometry/geometryEngine";
3
- import i from "@arcgis/core/Graphic";
4
- import S from "@arcgis/core/layers/GraphicsLayer";
5
- import _ from "axios";
6
- import { toRaw as b } from "vue";
7
- import k from "../stores/index.mjs";
8
- class M {
9
- constructor(e) {
10
- this.view = e, this.maskLayer = new S({
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({
11
12
  id: "police-jurisdiction"
12
13
  }), this.view.map.add(this.maskLayer);
13
- const a = k.useAppDataStore, n = b(a.mapConfig);
14
- this.geoServer = n.geoServer;
14
+ const t = E.useAppDataStore, r = L(t.mapConfig);
15
+ this.geoServer = r.geoServer;
15
16
  }
16
- async showJurisdiction(e) {
17
- if (!this.geoServer)
18
- return { status: -1, message: "未配置GeoServer" };
19
- const a = e.type.toLowerCase() === "zd" ? "VIEW_SH_ZD" : "VW_DWD_GEO_SH_DD", n = e.type.toLowerCase() === "zd" ? "ZD_CODE" : "DD_CODE", y = e.type.toLowerCase() === "zd" ? "ZD_NAME" : "DD_NAME", h = e.ids.join(","), s = await _.get(`${this.geoServer}/zd_edpass/wms`, {
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`, {
20
26
  params: {
21
27
  service: "WFS",
22
28
  version: "1.1.0",
23
29
  request: "GetFeature",
24
- typename: `zd_edpass:${a}`,
30
+ typename: "zd_edpass:VIEW_SH_ZD",
25
31
  outputFormat: "application/json",
26
- CQL_FILTER: `${n} IN (${h})`
32
+ CQL_FILTER: `ZD_CODE = ${o}`
27
33
  }
28
34
  });
29
- if (s.status !== 200)
30
- return { status: -1, message: s.status + " " + s.statusText };
31
- const { features: c } = s.data;
32
- if (!c || c.length === 0)
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)
33
39
  return { status: -1, message: "未查询到数据" };
34
40
  this.maskLayer.removeAll();
35
- const t = [], p = [], d = [];
36
- c.forEach((o) => {
37
- const w = o.geometry.coordinates, r = new L({
38
- rings: w[0]
39
- });
40
- t.push(r);
41
- const v = new i({
42
- geometry: r,
43
- symbol: {
44
- type: "simple-line",
45
- style: "dash",
46
- color: [111, 100, 255],
47
- width: 4
48
- }
49
- }), D = new i({
50
- geometry: r,
51
- symbol: {
52
- type: "simple-line",
53
- style: "solid",
54
- color: [111, 100, 255, 0.6],
55
- width: 4
56
- }
57
- });
58
- p.push(v, D);
59
- const G = new i({
60
- geometry: r.centroid,
61
- symbol: {
62
- type: "text",
63
- color: [0, 0, 0],
64
- haloColor: [255, 255, 255],
65
- haloSize: "1px",
66
- text: o.properties[y],
67
- font: {
68
- size: "14px",
69
- weight: "bold",
70
- family: "msyh"
71
- }
72
- }
41
+ const l = r[0].geometry.coordinates, s = [];
42
+ l.forEach((e) => {
43
+ const i = new h({
44
+ rings: e
73
45
  });
74
- d.push(G);
46
+ s.push(i);
75
47
  });
76
- const u = t[0].centroid, f = l.geodesicBuffer(
77
- u,
48
+ const p = s[0].centroid, u = n.geodesicBuffer(
49
+ p,
78
50
  100,
79
51
  "kilometers"
80
52
  );
81
- let m = l.difference(
82
- f,
83
- t[0]
53
+ let a = n.difference(
54
+ u,
55
+ s[0]
84
56
  );
85
- for (let o = 1; o < t.length; o++)
86
- m = l.difference(
87
- m,
88
- t[o]
57
+ for (let e = 1; e < s.length; e++)
58
+ a = n.difference(
59
+ a,
60
+ s[e]
89
61
  );
90
- const g = new i({
91
- geometry: m,
62
+ const y = new m({
63
+ geometry: a,
92
64
  symbol: {
93
65
  type: "simple-fill",
94
66
  color: [100, 100, 100, 0.8],
@@ -98,12 +70,133 @@ class M {
98
70
  },
99
71
  attributes: { type: "mask" }
100
72
  });
101
- return this.maskLayer.add(g), this.maskLayer.addMany(p), this.maskLayer.addMany(d), await this.view.goTo(t), { status: 0, message: "ok" };
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" };
102
195
  }
103
196
  clearJurisdiction() {
104
197
  this.maskLayer.removeAll();
105
198
  }
106
199
  }
107
200
  export {
108
- M as default
201
+ R as default
109
202
  };