gisviewer-vue3-arcgis 1.0.236 → 1.0.238
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/utils/map-initializer.mjs +38 -35
- package/es/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
- package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +42 -26
- package/es/src/gis-map/utils/signal-control-area/layer-symbol.mjs +30 -34
- package/es/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
- package/es/src/gis-map/utils/signal-control-area/show-area.mjs +41 -74
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +26 -26
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +79 -86
- package/es/src/types/index.d.ts +6 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
- package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/layer-symbol.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
- package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
- package/lib/src/gis-map/utils/signal-control-area/signal-renderer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
- package/lib/src/types/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import C from "@arcgis/core/Basemap";
|
|
2
|
-
import
|
|
2
|
+
import d from "@arcgis/core/config";
|
|
3
3
|
import * as k from "@arcgis/core/core/reactiveUtils";
|
|
4
|
-
import {
|
|
4
|
+
import { Multipoint as L, Polygon as W, Polyline as z, Point as T } from "@arcgis/core/geometry";
|
|
5
5
|
import * as w from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import * as
|
|
17
|
-
import
|
|
6
|
+
import x from "@arcgis/core/layers/FeatureLayer";
|
|
7
|
+
import I from "@arcgis/core/layers/GeoJSONLayer";
|
|
8
|
+
import R from "@arcgis/core/layers/IntegratedMesh3DTilesLayer";
|
|
9
|
+
import H from "@arcgis/core/layers/MapImageLayer";
|
|
10
|
+
import G from "@arcgis/core/layers/TileLayer";
|
|
11
|
+
import O from "@arcgis/core/layers/WebTileLayer";
|
|
12
|
+
import S from "@arcgis/core/Map";
|
|
13
|
+
import B from "@arcgis/core/views/MapView";
|
|
14
|
+
import N from "@arcgis/core/views/SceneView";
|
|
15
|
+
import E from "@turf/destination";
|
|
16
|
+
import * as A from "@turf/helpers";
|
|
17
|
+
import J from "./custom-layer/custom-wmts-layer.mjs";
|
|
18
18
|
function P(h, e) {
|
|
19
19
|
return h && (h.startsWith("http://") || h.startsWith("https://") ? h : e + h);
|
|
20
20
|
}
|
|
21
|
-
class
|
|
21
|
+
class te {
|
|
22
22
|
constructor() {
|
|
23
23
|
this.mapConfig = {}, this.watchHandleMap = /* @__PURE__ */ new Map(), this.handleIndex = 0, this.zoomWatchHandle = null;
|
|
24
24
|
}
|
|
@@ -31,15 +31,15 @@ class ee {
|
|
|
31
31
|
var p, u, b, y;
|
|
32
32
|
this.mapConfig = e.mapConfig;
|
|
33
33
|
const { container: i, markerClickCallback: o, mapClickCallback: r } = e;
|
|
34
|
-
|
|
35
|
-
const s = new
|
|
36
|
-
if (((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new
|
|
34
|
+
d.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, d.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, d.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
35
|
+
const s = new S();
|
|
36
|
+
if (((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new B({
|
|
37
37
|
map: s,
|
|
38
38
|
container: i,
|
|
39
39
|
...this.mapConfig.mapOptions
|
|
40
40
|
}), this.view.on("drag", (t) => {
|
|
41
41
|
t.button === 2 && t.stopPropagation();
|
|
42
|
-
})) : this.view = new
|
|
42
|
+
})) : this.view = new N({
|
|
43
43
|
map: s,
|
|
44
44
|
container: i,
|
|
45
45
|
environment: {
|
|
@@ -110,7 +110,7 @@ class ee {
|
|
|
110
110
|
const c = P(t.url, this.mapConfig.assetsRoot);
|
|
111
111
|
switch (t.type.toLowerCase()) {
|
|
112
112
|
case "webTile".toLowerCase(): {
|
|
113
|
-
const n = new
|
|
113
|
+
const n = new O({
|
|
114
114
|
urlTemplate: c,
|
|
115
115
|
...t.options
|
|
116
116
|
});
|
|
@@ -118,7 +118,7 @@ class ee {
|
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
case "tile": {
|
|
121
|
-
const n = new
|
|
121
|
+
const n = new G({
|
|
122
122
|
url: c,
|
|
123
123
|
...t.options
|
|
124
124
|
});
|
|
@@ -126,7 +126,7 @@ class ee {
|
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
128
|
case "customWMTS".toLowerCase(): {
|
|
129
|
-
const n = new
|
|
129
|
+
const n = new J({
|
|
130
130
|
urlTemplate: c,
|
|
131
131
|
...t.options
|
|
132
132
|
});
|
|
@@ -134,7 +134,7 @@ class ee {
|
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
case "mapImage".toLowerCase(): {
|
|
137
|
-
const n = new
|
|
137
|
+
const n = new H({
|
|
138
138
|
url: c,
|
|
139
139
|
...t.options
|
|
140
140
|
});
|
|
@@ -147,12 +147,12 @@ class ee {
|
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
case "feature": {
|
|
150
|
-
const n = new
|
|
150
|
+
const n = new x({ url: c, ...t.options });
|
|
151
151
|
s.add(n);
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
154
|
case "3dtiles": {
|
|
155
|
-
const n = new
|
|
155
|
+
const n = new R({
|
|
156
156
|
url: c,
|
|
157
157
|
...t.options
|
|
158
158
|
});
|
|
@@ -169,7 +169,7 @@ class ee {
|
|
|
169
169
|
const t = this.mapConfig.hdLayers.map(
|
|
170
170
|
(c) => (
|
|
171
171
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
172
|
-
new
|
|
172
|
+
new I({
|
|
173
173
|
url: P(c.url, this.mapConfig.assetsRoot),
|
|
174
174
|
...c.options,
|
|
175
175
|
title: c.options.id
|
|
@@ -179,7 +179,7 @@ class ee {
|
|
|
179
179
|
s.addMany(t);
|
|
180
180
|
}
|
|
181
181
|
this.view.ui.remove("attribution"), await this.view.when();
|
|
182
|
-
const
|
|
182
|
+
const g = this.mapConfig.camera;
|
|
183
183
|
let l;
|
|
184
184
|
if (this.view.type === "2d") {
|
|
185
185
|
let t = this.view.center;
|
|
@@ -196,7 +196,7 @@ class ee {
|
|
|
196
196
|
tilt: this.view.camera.tilt
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
return
|
|
199
|
+
return g ? g.home = l : this.mapConfig.camera = { home: l }, this.view;
|
|
200
200
|
}
|
|
201
201
|
setLayerVisibility(e) {
|
|
202
202
|
const { id: i, visible: o } = e, r = this.view.map.findLayerById(i);
|
|
@@ -212,14 +212,17 @@ class ee {
|
|
|
212
212
|
if (!this.view)
|
|
213
213
|
return { status: -1, message: "未初始化" };
|
|
214
214
|
if (e.center || e.target) {
|
|
215
|
-
switch ((i = e.target) == null ? void 0 : i.type) {
|
|
215
|
+
switch ((i = e.target) == null ? void 0 : i.type.toLowerCase()) {
|
|
216
216
|
case "point":
|
|
217
217
|
e.target = new T(e.target);
|
|
218
218
|
break;
|
|
219
219
|
case "polyline":
|
|
220
|
-
e.target = new
|
|
220
|
+
e.target = new z(e.target);
|
|
221
221
|
break;
|
|
222
222
|
case "polygon":
|
|
223
|
+
e.target = new W(e.target);
|
|
224
|
+
break;
|
|
225
|
+
case "multipoint":
|
|
223
226
|
e.target = new L(e.target);
|
|
224
227
|
break;
|
|
225
228
|
}
|
|
@@ -248,8 +251,8 @@ class ee {
|
|
|
248
251
|
{ duration: (e.duration || 2) * 1e3 }
|
|
249
252
|
);
|
|
250
253
|
else {
|
|
251
|
-
const r = Math.tan(i * Math.PI / 180) * e.height, s =
|
|
252
|
-
|
|
254
|
+
const r = Math.tan(i * Math.PI / 180) * e.height, s = E(
|
|
255
|
+
A.point(e.center),
|
|
253
256
|
r,
|
|
254
257
|
o + 180,
|
|
255
258
|
{
|
|
@@ -284,14 +287,14 @@ class ee {
|
|
|
284
287
|
* */
|
|
285
288
|
requestCoordinateTransform(e, i) {
|
|
286
289
|
let o = 0;
|
|
287
|
-
const s = 1e3 / 30,
|
|
290
|
+
const s = 1e3 / 30, g = k.watch(
|
|
288
291
|
() => this.view.center,
|
|
289
292
|
() => {
|
|
290
293
|
const l = this.transformPoints(e), p = Date.now();
|
|
291
294
|
p - o > s && (i(l), o = p);
|
|
292
295
|
}
|
|
293
296
|
);
|
|
294
|
-
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex,
|
|
297
|
+
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, g), { handle: this.handleIndex, points: this.transformPoints(e) };
|
|
295
298
|
}
|
|
296
299
|
transformPoints(e) {
|
|
297
300
|
return e.map((i) => {
|
|
@@ -323,5 +326,5 @@ class ee {
|
|
|
323
326
|
}
|
|
324
327
|
}
|
|
325
328
|
export {
|
|
326
|
-
|
|
329
|
+
te as default
|
|
327
330
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IDistrictRoad } from 'packages/components/src/types';
|
|
1
2
|
interface ICross {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -18,6 +19,7 @@ export default class DistrictController {
|
|
|
18
19
|
areaColor: [number, number, number];
|
|
19
20
|
signalCount: number;
|
|
20
21
|
subDistrictCount: number;
|
|
22
|
+
roadConnections: IDistrictRoad[];
|
|
21
23
|
constructor(params: any, style: string);
|
|
22
24
|
/**
|
|
23
25
|
* 获取区控/子区下的所有信号机
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import h from "pako";
|
|
2
|
+
import c from "../common-utils.mjs";
|
|
3
|
+
class e {
|
|
4
|
+
constructor(o, s) {
|
|
5
|
+
this.parentName = "", this.signals = [], this.subDistricts = [], this.areaColor = this.getDarkNonGrayColor(), this.signalCount = 0, this.subDistrictCount = 0, this.roadConnections = [], this.id = o.name, this.name = o.areaDesc, this.parentId = o.parentId, s === "alarm" && (this.areaColor = [255, 0, 0]);
|
|
6
|
+
for (const t of o.children)
|
|
6
7
|
if (t.children) {
|
|
7
|
-
const i = new
|
|
8
|
-
i.id = t.id, i.name = `SS ${t.name}`, i.parentId = this.id, i.parentName = this.name, i.areaColor = this.getDarkNonGrayColor(t.id), this.subDistricts.push(i), this.subDistrictCount++, this.signalCount += i.signalCount
|
|
9
|
-
|
|
8
|
+
const i = new e(t, s);
|
|
9
|
+
if (i.id = t.id, i.name = `SS ${t.name}`, i.parentId = this.id, i.parentName = this.name, i.areaColor = this.getDarkNonGrayColor(t.id), this.subDistricts.push(i), this.subDistrictCount++, this.signalCount += i.signalCount, t.mapConnectList)
|
|
10
|
+
try {
|
|
11
|
+
const a = t.mapConnectList, n = new Uint8Array(
|
|
12
|
+
window.atob(a).split("").map((r) => r.charCodeAt(0))
|
|
13
|
+
), l = h.inflate(n, { to: "string" }), d = JSON.parse(l);
|
|
14
|
+
i.roadConnections.push(
|
|
15
|
+
...d.map((r) => ({
|
|
16
|
+
id: r.roadsectId,
|
|
17
|
+
coordinates: JSON.parse(r.geomData).coordinates,
|
|
18
|
+
districtId: i.parentId,
|
|
19
|
+
subDistrictId: i.id
|
|
20
|
+
}))
|
|
21
|
+
), console.log(i.roadConnections);
|
|
22
|
+
} catch (a) {
|
|
23
|
+
console.error("解压子区路段连接信息失败:", a);
|
|
24
|
+
}
|
|
25
|
+
} else if (c.isCoordinateValid(t)) {
|
|
10
26
|
const i = {
|
|
11
27
|
id: t.id,
|
|
12
28
|
name: t.name,
|
|
@@ -25,29 +41,29 @@ class r {
|
|
|
25
41
|
* @returns
|
|
26
42
|
*/
|
|
27
43
|
getAllSignalCoordinates() {
|
|
28
|
-
const
|
|
29
|
-
for (const
|
|
30
|
-
|
|
31
|
-
for (const
|
|
32
|
-
|
|
33
|
-
return
|
|
44
|
+
const o = [];
|
|
45
|
+
for (const s of this.signals)
|
|
46
|
+
o.push([s.longitude, s.latitude]);
|
|
47
|
+
for (const s of this.subDistricts)
|
|
48
|
+
o.push(...s.getAllSignalCoordinates());
|
|
49
|
+
return o;
|
|
34
50
|
}
|
|
35
|
-
getDarkNonGrayColor(
|
|
36
|
-
let
|
|
37
|
-
if (
|
|
38
|
-
const a = this.cyrb53(
|
|
39
|
-
|
|
51
|
+
getDarkNonGrayColor(o) {
|
|
52
|
+
let s, t, i;
|
|
53
|
+
if (o) {
|
|
54
|
+
const a = this.cyrb53(o);
|
|
55
|
+
s = ((a & 16711680) >> 16) % 200, t = ((a & 65280) >> 8) % 200, i = (a & 255) % 200;
|
|
40
56
|
} else
|
|
41
|
-
|
|
42
|
-
return [
|
|
57
|
+
s = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), i = Math.floor(Math.random() * 256);
|
|
58
|
+
return [s, t, i];
|
|
43
59
|
}
|
|
44
|
-
cyrb53(
|
|
45
|
-
let t = 3735928559 ^
|
|
46
|
-
for (let a = 0, n; a <
|
|
47
|
-
n =
|
|
60
|
+
cyrb53(o, s = 0) {
|
|
61
|
+
let t = 3735928559 ^ s, i = 1103547991 ^ s;
|
|
62
|
+
for (let a = 0, n; a < o.length; a++)
|
|
63
|
+
n = o.charCodeAt(a), t = Math.imul(t ^ n, 2654435761), i = Math.imul(i ^ n, 1597334677);
|
|
48
64
|
return t = Math.imul(t ^ t >>> 16, 2246822507), t ^= Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507), i ^= Math.imul(t ^ t >>> 13, 3266489909), 4294967296 * (2097151 & i) + (t >>> 0);
|
|
49
65
|
}
|
|
50
66
|
}
|
|
51
67
|
export {
|
|
52
|
-
|
|
68
|
+
e as default
|
|
53
69
|
};
|
|
@@ -375,14 +375,10 @@ const e = {
|
|
|
375
375
|
{
|
|
376
376
|
value: "true,true",
|
|
377
377
|
symbol: {
|
|
378
|
-
type: "
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
outline: {
|
|
383
|
-
color: "white",
|
|
384
|
-
width: 0
|
|
385
|
-
}
|
|
378
|
+
type: "picture-marker",
|
|
379
|
+
url: "/GisViewerAssets/Images/icon_star.png",
|
|
380
|
+
width: "20px",
|
|
381
|
+
height: "20px"
|
|
386
382
|
}
|
|
387
383
|
},
|
|
388
384
|
{
|
|
@@ -424,31 +420,31 @@ const e = {
|
|
|
424
420
|
}
|
|
425
421
|
}
|
|
426
422
|
}
|
|
427
|
-
],
|
|
428
|
-
visualVariables: [
|
|
429
|
-
{
|
|
430
|
-
type: "size",
|
|
431
|
-
valueExpression: "$view.scale",
|
|
432
|
-
stops: [
|
|
433
|
-
{
|
|
434
|
-
size: 8,
|
|
435
|
-
value: 9000.954822000003
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
size: 6,
|
|
439
|
-
value: 18055.954822000003
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
size: 3,
|
|
443
|
-
value: 144447.638572
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
size: 2,
|
|
447
|
-
value: 1155581108577e-6
|
|
448
|
-
}
|
|
449
|
-
]
|
|
450
|
-
}
|
|
451
423
|
]
|
|
424
|
+
// visualVariables: [
|
|
425
|
+
// {
|
|
426
|
+
// type: 'size',
|
|
427
|
+
// valueExpression: '$view.scale',
|
|
428
|
+
// stops: [
|
|
429
|
+
// {
|
|
430
|
+
// size: 8,
|
|
431
|
+
// value: 9000.954822000003
|
|
432
|
+
// },
|
|
433
|
+
// {
|
|
434
|
+
// size: 6,
|
|
435
|
+
// value: 18055.954822000003
|
|
436
|
+
// },
|
|
437
|
+
// {
|
|
438
|
+
// size: 3,
|
|
439
|
+
// value: 144447.638572
|
|
440
|
+
// },
|
|
441
|
+
// {
|
|
442
|
+
// size: 2,
|
|
443
|
+
// value: 1155581.108577
|
|
444
|
+
// }
|
|
445
|
+
// ]
|
|
446
|
+
// }
|
|
447
|
+
// ]
|
|
452
448
|
}
|
|
453
449
|
}, s = {
|
|
454
450
|
id: "signalLayer",
|
|
@@ -762,7 +758,7 @@ const e = {
|
|
|
762
758
|
}
|
|
763
759
|
]
|
|
764
760
|
}
|
|
765
|
-
},
|
|
761
|
+
}, n = {
|
|
766
762
|
id: "signalLayer",
|
|
767
763
|
source: [],
|
|
768
764
|
objectIdField: "ObjectID",
|
|
@@ -980,7 +976,7 @@ const e = {
|
|
|
980
976
|
export {
|
|
981
977
|
e as districtDashLineLayerOptions,
|
|
982
978
|
t as districtSolidLineLayerOptions,
|
|
983
|
-
|
|
979
|
+
n as signalClusterLayerOptions,
|
|
984
980
|
l as signalMarkerLayerOptions,
|
|
985
981
|
s as signalPictureLayerOptions,
|
|
986
982
|
r as subDistrictLineLayerOptions,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IFindSignalControlAreaParams, ILayerVisibleParams, IResult, IShowSignalControlAreaParams } from '../../../types';
|
|
2
2
|
export default class SignalControlAreaController1 {
|
|
3
3
|
private view;
|
|
4
|
-
private hasGpu;
|
|
5
4
|
/** 支队图层 */
|
|
6
5
|
private detachmentLayer;
|
|
7
6
|
private detachmentLayerLoaded;
|
|
@@ -9,7 +8,6 @@ export default class SignalControlAreaController1 {
|
|
|
9
8
|
private subDistrictRenderer;
|
|
10
9
|
private signalRenderer;
|
|
11
10
|
private mapConfig;
|
|
12
|
-
private roadLines;
|
|
13
11
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
14
12
|
/**
|
|
15
13
|
* 显示所有区控、子区、信号机
|
|
@@ -51,11 +49,6 @@ export default class SignalControlAreaController1 {
|
|
|
51
49
|
status: number;
|
|
52
50
|
message: string;
|
|
53
51
|
}>;
|
|
54
|
-
/**
|
|
55
|
-
* 获取道路线
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
private loadRoadLine;
|
|
59
52
|
/**
|
|
60
53
|
* 加载支队图层
|
|
61
54
|
* 现场环境用url创建FeatureLayer有各种问题,
|
|
@@ -2,17 +2,17 @@ import { Polygon as f } from "@arcgis/core/geometry";
|
|
|
2
2
|
import { webMercatorToGeographic as y } from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
3
3
|
import g from "@arcgis/core/Graphic";
|
|
4
4
|
import m from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
-
import R from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import L from "./signal-renderer.mjs";
|
|
5
|
+
import R from "../../stores/index.mjs";
|
|
6
|
+
import w from "./district-controller.mjs";
|
|
7
|
+
import D from "./district-renderer.mjs";
|
|
8
|
+
import p from "./signal-renderer.mjs";
|
|
10
9
|
import C from "./sub-district-renderer.mjs";
|
|
11
|
-
class
|
|
10
|
+
class N {
|
|
11
|
+
// private roadLines!: IRoadLine[];
|
|
12
12
|
constructor(e) {
|
|
13
|
-
this.detachmentLayerLoaded = !1, this.view = e
|
|
14
|
-
const t =
|
|
15
|
-
this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig)), this.detachmentLayer = new m(), this.view.map.add(this.detachmentLayer), this.districtRenderer = new
|
|
13
|
+
this.detachmentLayerLoaded = !1, this.view = e;
|
|
14
|
+
const t = R.useAppDataStore;
|
|
15
|
+
this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig)), this.detachmentLayer = new m(), this.view.map.add(this.detachmentLayer), this.districtRenderer = new D(e), this.subDistrictRenderer = new C(e), this.signalRenderer = new p(e);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* 显示所有区控、子区、信号机
|
|
@@ -20,16 +20,16 @@ class P {
|
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
22
|
async showSignalControlArea(e) {
|
|
23
|
-
this.detachmentLayerLoaded || await this.loadDetachmentLayer(),
|
|
24
|
-
const t = [],
|
|
25
|
-
for (const
|
|
26
|
-
const
|
|
27
|
-
|
|
23
|
+
this.detachmentLayerLoaded || await this.loadDetachmentLayer(), await this.clearSignalControlArea(), this.districtRenderer.setVisible(!1), this.subDistrictRenderer.setVisible(!1), this.signalRenderer.setClusterVisible(!1), this.signalRenderer.setPointVisible(!1);
|
|
24
|
+
const t = [], i = [];
|
|
25
|
+
for (const n of e.areaList) {
|
|
26
|
+
const s = new w(
|
|
27
|
+
n,
|
|
28
28
|
e.style || ""
|
|
29
29
|
);
|
|
30
|
-
t.push(
|
|
30
|
+
t.push(s), i.push(...s.subDistricts);
|
|
31
31
|
}
|
|
32
|
-
return this.districtRenderer.style = e.style || "", await this.districtRenderer.showDistricts(t), await this.subDistrictRenderer.showSubDistricts(
|
|
32
|
+
return this.districtRenderer.style = e.style || "", await this.districtRenderer.showDistricts(t), await this.subDistrictRenderer.showSubDistricts(i), await this.signalRenderer.showSignals(t), { status: 0, message: "ok" };
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* 清空区控、子区、信号机
|
|
@@ -88,14 +88,14 @@ class P {
|
|
|
88
88
|
async highlightSignalControlArea(e) {
|
|
89
89
|
switch (this.view.closePopup(), e.type) {
|
|
90
90
|
case "district":
|
|
91
|
-
return await this.districtRenderer.highlightDistrict(e.id) ? (this.subDistrictRenderer.filter(
|
|
91
|
+
return await this.districtRenderer.highlightDistrict(e.id) ? (this.subDistrictRenderer.filter(e), this.signalRenderer.filter(e), await this.subDistrictRenderer.showRoads(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
|
|
92
92
|
case "subDistrict": {
|
|
93
|
-
const { count: t, parentId:
|
|
94
|
-
return t > 0 ? (this.districtRenderer.filter(
|
|
93
|
+
const { count: t, parentId: i } = await this.subDistrictRenderer.highlightSubDistrict(e.id);
|
|
94
|
+
return t > 0 ? (this.districtRenderer.filter(i), this.signalRenderer.filter(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
95
95
|
}
|
|
96
96
|
case "signal": {
|
|
97
|
-
const { districtId: t, subDistrictId:
|
|
98
|
-
return
|
|
97
|
+
const { districtId: t, subDistrictId: i, count: n } = await this.signalRenderer.highlightSignal(e.id);
|
|
98
|
+
return n > 0 ? (this.districtRenderer.filter(t), this.subDistrictRenderer.filter(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到信号机" };
|
|
99
99
|
}
|
|
100
100
|
default:
|
|
101
101
|
return { status: 1, message: "未知类型" };
|
|
@@ -108,39 +108,6 @@ class P {
|
|
|
108
108
|
async resetHighlight() {
|
|
109
109
|
return this.districtRenderer.resetFilter(), this.subDistrictRenderer.resetFilter(), this.signalRenderer.resetFilter(), { status: 0, message: "ok" };
|
|
110
110
|
}
|
|
111
|
-
/**
|
|
112
|
-
* 获取道路线
|
|
113
|
-
* @returns
|
|
114
|
-
*/
|
|
115
|
-
async loadRoadLine() {
|
|
116
|
-
var t;
|
|
117
|
-
const e = (t = this.mapConfig.signalControlArea) == null ? void 0 : t.roadLayerUrl;
|
|
118
|
-
if (!e) {
|
|
119
|
-
console.warn("未配置道路线图层URL");
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
const a = await (await fetch(`/GisViewerAssets/${e}`)).text();
|
|
124
|
-
R.parse(a, {
|
|
125
|
-
header: !0,
|
|
126
|
-
skipEmptyLines: !0,
|
|
127
|
-
complete: (i) => {
|
|
128
|
-
const { data: r } = i;
|
|
129
|
-
this.roadLines = r.map((n) => ({
|
|
130
|
-
id: n.ROADSECT_ID,
|
|
131
|
-
fromNode: n.FROM_NODE_ID,
|
|
132
|
-
toNode: n.TO_NODE_ID,
|
|
133
|
-
coordinates: JSON.parse(n.GEOM).coordinates
|
|
134
|
-
}));
|
|
135
|
-
},
|
|
136
|
-
error: (i) => {
|
|
137
|
-
console.error("道路线CSV解析失败:", i);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
} catch (s) {
|
|
141
|
-
console.error("读取道路线CSV失败:", s);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
111
|
/**
|
|
145
112
|
* 加载支队图层
|
|
146
113
|
* 现场环境用url创建FeatureLayer有各种问题,
|
|
@@ -151,35 +118,35 @@ class P {
|
|
|
151
118
|
if (!e)
|
|
152
119
|
return;
|
|
153
120
|
const t = e.find(
|
|
154
|
-
(
|
|
121
|
+
(i) => i.options.id === "shanghai_district"
|
|
155
122
|
);
|
|
156
123
|
if (t)
|
|
157
124
|
try {
|
|
158
|
-
const
|
|
125
|
+
const n = await (await fetch(
|
|
159
126
|
"/GisViewerAssets/ShangHai/Layers/district.json"
|
|
160
|
-
)).json(),
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
127
|
+
)).json(), s = [], { renderer: r, labelingInfo: d } = t.options;
|
|
128
|
+
n.features.forEach((c) => {
|
|
129
|
+
const o = c.attributes.ZD_NAME;
|
|
130
|
+
if (o !== "高架支队") {
|
|
164
131
|
let l = new f({
|
|
165
|
-
rings:
|
|
132
|
+
rings: c.geometry.rings
|
|
166
133
|
});
|
|
167
134
|
l = y(l);
|
|
168
|
-
const
|
|
135
|
+
const a = new g({
|
|
169
136
|
geometry: l,
|
|
170
|
-
attributes:
|
|
137
|
+
attributes: c.attributes
|
|
171
138
|
});
|
|
172
139
|
if (r) {
|
|
173
140
|
if (r.type === "simple")
|
|
174
|
-
|
|
141
|
+
a.symbol = r.symbol;
|
|
175
142
|
else if (r.type === "unique-value") {
|
|
176
|
-
const h =
|
|
143
|
+
const h = a.getAttribute("OBJECTID"), u = r.uniqueValueInfos.find(
|
|
177
144
|
(b) => b.value == h
|
|
178
145
|
);
|
|
179
|
-
|
|
146
|
+
a.symbol = u ? u.symbol : r.defaultSymbol;
|
|
180
147
|
}
|
|
181
148
|
} else
|
|
182
|
-
|
|
149
|
+
a.symbol = {
|
|
183
150
|
type: "simple-fill",
|
|
184
151
|
color: [227, 237, 255, 0.4],
|
|
185
152
|
outline: {
|
|
@@ -187,21 +154,21 @@ class P {
|
|
|
187
154
|
width: 2
|
|
188
155
|
}
|
|
189
156
|
};
|
|
190
|
-
if (
|
|
157
|
+
if (s.push(a), d && o !== "边防港航支队" && o !== "机场支队") {
|
|
191
158
|
const h = new g({
|
|
192
159
|
geometry: l.centroid,
|
|
193
|
-
symbol: { ...
|
|
160
|
+
symbol: { ...d.symbol, text: o }
|
|
194
161
|
});
|
|
195
|
-
|
|
162
|
+
s.push(h);
|
|
196
163
|
}
|
|
197
164
|
}
|
|
198
|
-
}), this.detachmentLayer.addMany(
|
|
199
|
-
} catch (
|
|
200
|
-
console.error("加载支队图层失败:",
|
|
165
|
+
}), this.detachmentLayer.addMany(s), this.detachmentLayerLoaded = !0;
|
|
166
|
+
} catch (i) {
|
|
167
|
+
console.error("加载支队图层失败:", i);
|
|
201
168
|
return;
|
|
202
169
|
}
|
|
203
170
|
}
|
|
204
171
|
}
|
|
205
172
|
export {
|
|
206
|
-
|
|
173
|
+
N as default
|
|
207
174
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResult } from '../../../types';
|
|
1
|
+
import { IFindSignalControlAreaParams, IResult } from '../../../types';
|
|
2
2
|
import DistrictController from './district-controller';
|
|
3
3
|
export default class CrossRenderer {
|
|
4
4
|
private view;
|
|
@@ -16,6 +16,6 @@ export default class CrossRenderer {
|
|
|
16
16
|
subDistrictId: string;
|
|
17
17
|
count: number;
|
|
18
18
|
}>;
|
|
19
|
-
filter(
|
|
19
|
+
filter(params: IFindSignalControlAreaParams): void;
|
|
20
20
|
resetFilter(): void;
|
|
21
21
|
}
|