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.
- package/es/src/gis-map/gis-map.vue.d.ts +9 -2
- package/es/src/gis-map/gis-map.vue.mjs +184 -181
- package/es/src/gis-map/index.d.ts +7 -1
- package/es/src/gis-map/utils/map-initializer.mjs +86 -79
- package/es/src/gis-map/utils/police-jurisdiction.d.ts +6 -0
- package/es/src/gis-map/utils/police-jurisdiction.mjs +167 -74
- package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +101 -45
- package/es/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
- package/es/src/gis-map/utils/signal-control-area/{show-area.mjs → signal-area-controller.mjs} +11 -11
- package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
- package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.mjs +193 -0
- package/es/src/types/index.d.ts +16 -1
- package/lib/src/gis-map/gis-map.vue.d.ts +9 -2
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +7 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/police-jurisdiction.d.ts +6 -0
- package/lib/src/gis-map/utils/police-jurisdiction.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
- package/lib/src/gis-map/utils/signal-control-area/signal-area-controller.js +1 -0
- package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
- package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.js +1 -0
- package/lib/src/types/index.d.ts +16 -1
- package/package.json +1 -1
- 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
|
|
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
|
|
6
|
+
import { webMercatorToGeographic as G } from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
7
7
|
import C from "@arcgis/core/Graphic";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
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
|
|
19
|
-
import
|
|
20
|
-
import * as
|
|
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:
|
|
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
|
|
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 (
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)),
|
|
72
|
-
[
|
|
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
|
|
78
|
+
const c = this.view.camera;
|
|
79
79
|
if (this.view.spatialReference.isWebMercator) {
|
|
80
80
|
const w = b.webMercatorToGeographic(
|
|
81
|
-
|
|
81
|
+
c.position
|
|
82
82
|
), d = {
|
|
83
|
-
heading:
|
|
84
|
-
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(
|
|
89
|
+
console.log(c.toJSON());
|
|
90
90
|
console.log(this.view.zoom, this.view.scale);
|
|
91
91
|
} else {
|
|
92
|
-
let
|
|
93
|
-
this.view.spatialReference.isWebMercator && (
|
|
94
|
-
|
|
92
|
+
let c = this.view.center;
|
|
93
|
+
this.view.spatialReference.isWebMercator && (c = b.webMercatorToGeographic(
|
|
94
|
+
c
|
|
95
95
|
)), console.log({
|
|
96
|
-
center:
|
|
96
|
+
center: c.toJSON(),
|
|
97
97
|
zoom: this.view.zoom,
|
|
98
98
|
scale: this.view.scale
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
(
|
|
101
|
+
const n = (y = (await this.view.hitTest(t)).results) == null ? void 0 : y.filter(
|
|
102
|
+
(c) => c.type === "graphic"
|
|
103
103
|
);
|
|
104
|
-
|
|
104
|
+
n.length > 0 && n.forEach((c) => {
|
|
105
105
|
var d;
|
|
106
|
-
const w =
|
|
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,
|
|
117
|
-
this.view.on("pointer-move", async (
|
|
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 (!(
|
|
121
|
-
t = h,
|
|
120
|
+
if (!(a || h - t < 100)) {
|
|
121
|
+
t = h, a = !0;
|
|
122
122
|
try {
|
|
123
|
-
const w = (y = (await this.view.hitTest(
|
|
124
|
-
(
|
|
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
|
-
|
|
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
|
|
138
|
-
let
|
|
137
|
+
const a = this.processUrl(t.url);
|
|
138
|
+
let n = null;
|
|
139
139
|
switch (t.type.toLowerCase()) {
|
|
140
140
|
case "webTile".toLowerCase(): {
|
|
141
|
-
|
|
142
|
-
urlTemplate:
|
|
141
|
+
n = new R({
|
|
142
|
+
urlTemplate: a,
|
|
143
143
|
...t.options
|
|
144
144
|
});
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
147
147
|
case "tile": {
|
|
148
|
-
|
|
149
|
-
url:
|
|
148
|
+
n = new O({
|
|
149
|
+
url: a,
|
|
150
150
|
...t.options
|
|
151
151
|
});
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
154
|
case "customwmts".toLowerCase(): {
|
|
155
|
-
|
|
156
|
-
urlTemplate:
|
|
155
|
+
n = new J({
|
|
156
|
+
urlTemplate: a,
|
|
157
157
|
...t.options
|
|
158
158
|
});
|
|
159
159
|
break;
|
|
160
160
|
}
|
|
161
161
|
case "mapimage".toLowerCase(): {
|
|
162
|
-
|
|
163
|
-
url:
|
|
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
|
-
|
|
174
|
+
n = new x({ url: a, ...t.options });
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
case "3dtiles": {
|
|
178
|
-
|
|
179
|
-
url:
|
|
178
|
+
n = new H({
|
|
179
|
+
url: a,
|
|
180
180
|
...t.options
|
|
181
181
|
});
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
case "wms": {
|
|
185
|
-
|
|
186
|
-
url:
|
|
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 (
|
|
199
|
+
if (n)
|
|
193
200
|
if (t.group) {
|
|
194
201
|
let h = o.findLayerById(t.group);
|
|
195
|
-
h && h.type === "group" ? h.add(
|
|
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: [
|
|
206
|
+
layers: [n],
|
|
200
207
|
visible: t.groupVisible !== !1
|
|
201
208
|
}), o.add(h));
|
|
202
209
|
} else
|
|
203
|
-
o.add(
|
|
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
|
-
(
|
|
218
|
+
(a) => (
|
|
212
219
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
213
|
-
new
|
|
214
|
-
url: this.processUrl(
|
|
215
|
-
...
|
|
216
|
-
title:
|
|
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
|
|
248
|
-
return
|
|
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
|
|
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
|
|
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
|
|
304
|
-
|
|
305
|
-
|
|
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:
|
|
329
|
-
if (!
|
|
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 =
|
|
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
|
-
}),
|
|
354
|
-
return [
|
|
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
|
-
(
|
|
372
|
-
i &&
|
|
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
|
|
402
|
+
const r = await (await fetch(
|
|
396
403
|
"/GisViewerAssets/ShangHai/Layers/district.json"
|
|
397
404
|
)).json(), o = [], { renderer: l, labelingInfo: m } = i.options;
|
|
398
|
-
|
|
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 =
|
|
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"),
|
|
414
|
-
(
|
|
420
|
+
const t = f.getAttribute("OBJECTID"), a = l.uniqueValueInfos.find(
|
|
421
|
+
(n) => n.value == t
|
|
415
422
|
);
|
|
416
|
-
f.symbol =
|
|
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
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { toRaw as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
14
|
-
this.geoServer =
|
|
14
|
+
const t = E.useAppDataStore, r = L(t.mapConfig);
|
|
15
|
+
this.geoServer = r.geoServer;
|
|
15
16
|
}
|
|
16
|
-
async showJurisdiction(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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:
|
|
30
|
+
typename: "zd_edpass:VIEW_SH_ZD",
|
|
25
31
|
outputFormat: "application/json",
|
|
26
|
-
CQL_FILTER:
|
|
32
|
+
CQL_FILTER: `ZD_CODE = ${o}`
|
|
27
33
|
}
|
|
28
34
|
});
|
|
29
|
-
if (
|
|
30
|
-
return { status: -1, message:
|
|
31
|
-
const { features:
|
|
32
|
-
if (!
|
|
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
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
rings:
|
|
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
|
-
|
|
46
|
+
s.push(i);
|
|
75
47
|
});
|
|
76
|
-
const
|
|
77
|
-
|
|
48
|
+
const p = s[0].centroid, u = n.geodesicBuffer(
|
|
49
|
+
p,
|
|
78
50
|
100,
|
|
79
51
|
"kilometers"
|
|
80
52
|
);
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
let a = n.difference(
|
|
54
|
+
u,
|
|
55
|
+
s[0]
|
|
84
56
|
);
|
|
85
|
-
for (let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
57
|
+
for (let e = 1; e < s.length; e++)
|
|
58
|
+
a = n.difference(
|
|
59
|
+
a,
|
|
60
|
+
s[e]
|
|
89
61
|
);
|
|
90
|
-
const
|
|
91
|
-
geometry:
|
|
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
|
-
|
|
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
|
-
|
|
201
|
+
R as default
|
|
109
202
|
};
|