gisviewer-vue3-arcgis 1.0.273 → 1.0.275
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/edpass-device-controller.d.ts +8 -2
- package/es/src/gis-map/utils/edpass-device-controller.mjs +83 -63
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +127 -158
- package/es/src/types/index.d.ts +2 -2
- package/lib/src/gis-map/utils/edpass-device-controller.d.ts +8 -2
- package/lib/src/gis-map/utils/edpass-device-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
- package/lib/src/types/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -7,10 +7,16 @@ export default class EdpassDeviceController {
|
|
|
7
7
|
private kkAbnormalLayer;
|
|
8
8
|
private mapInitializer;
|
|
9
9
|
private watchHandle;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private currentShowParams;
|
|
11
|
+
private isCameraVisible;
|
|
12
|
+
private isKkVisible;
|
|
12
13
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
13
14
|
setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
|
|
15
|
+
/**
|
|
16
|
+
* 控制散点图层显示隐藏
|
|
17
|
+
* @param visible
|
|
18
|
+
*/
|
|
19
|
+
private showScatter;
|
|
14
20
|
private getLayerConfig;
|
|
15
21
|
private showClusterInExtent;
|
|
16
22
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "@arcgis/core/core/reactiveUtils.js";
|
|
2
2
|
import u from "@arcgis/core/Graphic";
|
|
3
|
-
import
|
|
4
|
-
import { toRaw as
|
|
5
|
-
import
|
|
6
|
-
class
|
|
3
|
+
import m from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
+
import { toRaw as p } from "vue";
|
|
5
|
+
import k from "../stores/index.mjs";
|
|
6
|
+
class S {
|
|
7
7
|
constructor(e) {
|
|
8
|
-
this.watchHandle = null, this.
|
|
9
|
-
const t =
|
|
10
|
-
this.mapInitializer =
|
|
8
|
+
this.watchHandle = null, this.currentShowParams = null, this.isCameraVisible = !1, this.isKkVisible = !1, this.view = e;
|
|
9
|
+
const t = k.useAppDataStore;
|
|
10
|
+
this.mapInitializer = p(t.mapInitializer), this.cameraNormalLayer = new m({
|
|
11
11
|
id: "cameraNormalLayer",
|
|
12
12
|
visible: !1
|
|
13
|
-
}), this.cameraAbnormalLayer = new
|
|
13
|
+
}), this.cameraAbnormalLayer = new m({
|
|
14
14
|
id: "cameraAbnormalLayer",
|
|
15
15
|
visible: !1
|
|
16
|
-
}), this.kkNormalLayer = new
|
|
16
|
+
}), this.kkNormalLayer = new m({
|
|
17
17
|
id: "kkNormalLayer",
|
|
18
18
|
visible: !1
|
|
19
|
-
}), this.kkAbnormalLayer = new
|
|
19
|
+
}), this.kkAbnormalLayer = new m({
|
|
20
20
|
id: "kkAbnormalLayer",
|
|
21
21
|
visible: !1
|
|
22
22
|
}), this.view.map.addMany([
|
|
@@ -28,26 +28,26 @@ class I {
|
|
|
28
28
|
}
|
|
29
29
|
async setEdpassLayerVisibility(e) {
|
|
30
30
|
var t;
|
|
31
|
-
if (e.deviceType !== "camera" && e.deviceType !== "kk")
|
|
31
|
+
if (this.currentShowParams = e, e.deviceType !== "camera" && e.deviceType !== "kk")
|
|
32
32
|
return { status: -1, message: "不支持的设备类型" };
|
|
33
|
-
switch (e.
|
|
34
|
-
case "scatter":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
33
|
+
switch (e.deviceType === "camera" && (this.isCameraVisible = e.visible), e.deviceType === "kk" && (this.isKkVisible = e.visible), e.style) {
|
|
34
|
+
case "scatter": {
|
|
35
|
+
this.showScatter();
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
39
38
|
case "cluster": {
|
|
40
39
|
const { deviceLayer: i } = this.getLayerConfig(e);
|
|
41
|
-
i.visible = e.visible,
|
|
40
|
+
i.visible = e.visible, e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = v.when(
|
|
42
41
|
() => this.view.stationary,
|
|
43
42
|
async () => {
|
|
43
|
+
var r, s, o, l, c, a, y, h;
|
|
44
44
|
this.cameraNormalLayer.visible && await this.showClusterInExtent(
|
|
45
45
|
{
|
|
46
46
|
deviceType: "camera",
|
|
47
47
|
deviceState: "normal",
|
|
48
|
-
|
|
49
|
-
ddCode: this.
|
|
50
|
-
zdCode: this.
|
|
48
|
+
style: "cluster",
|
|
49
|
+
ddCode: ((r = this.currentShowParams) == null ? void 0 : r.ddCode) || "",
|
|
50
|
+
zdCode: ((s = this.currentShowParams) == null ? void 0 : s.zdCode) || "",
|
|
51
51
|
visible: !0
|
|
52
52
|
},
|
|
53
53
|
this.view.extent
|
|
@@ -55,9 +55,9 @@ class I {
|
|
|
55
55
|
{
|
|
56
56
|
deviceType: "camera",
|
|
57
57
|
deviceState: "abnormal",
|
|
58
|
-
|
|
59
|
-
ddCode: this.
|
|
60
|
-
zdCode: this.
|
|
58
|
+
style: "cluster",
|
|
59
|
+
ddCode: ((o = this.currentShowParams) == null ? void 0 : o.ddCode) || "",
|
|
60
|
+
zdCode: ((l = this.currentShowParams) == null ? void 0 : l.zdCode) || "",
|
|
61
61
|
visible: !0
|
|
62
62
|
},
|
|
63
63
|
this.view.extent
|
|
@@ -65,9 +65,9 @@ class I {
|
|
|
65
65
|
{
|
|
66
66
|
deviceType: "kk",
|
|
67
67
|
deviceState: "normal",
|
|
68
|
-
|
|
69
|
-
ddCode: this.
|
|
70
|
-
zdCode: this.
|
|
68
|
+
style: "cluster",
|
|
69
|
+
ddCode: ((c = this.currentShowParams) == null ? void 0 : c.ddCode) || "",
|
|
70
|
+
zdCode: ((a = this.currentShowParams) == null ? void 0 : a.zdCode) || "",
|
|
71
71
|
visible: !0
|
|
72
72
|
},
|
|
73
73
|
this.view.extent
|
|
@@ -75,9 +75,9 @@ class I {
|
|
|
75
75
|
{
|
|
76
76
|
deviceType: "kk",
|
|
77
77
|
deviceState: "abnormal",
|
|
78
|
-
|
|
79
|
-
ddCode: this.
|
|
80
|
-
zdCode: this.
|
|
78
|
+
style: "cluster",
|
|
79
|
+
ddCode: ((y = this.currentShowParams) == null ? void 0 : y.ddCode) || "",
|
|
80
|
+
zdCode: ((h = this.currentShowParams) == null ? void 0 : h.zdCode) || "",
|
|
81
81
|
visible: !0
|
|
82
82
|
},
|
|
83
83
|
this.view.extent
|
|
@@ -92,12 +92,32 @@ class I {
|
|
|
92
92
|
message: "Success"
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* 控制散点图层显示隐藏
|
|
97
|
+
* @param visible
|
|
98
|
+
*/
|
|
99
|
+
showScatter(e) {
|
|
100
|
+
const t = e ?? this.isCameraVisible, i = e ?? this.isKkVisible;
|
|
101
|
+
this.mapInitializer.setLayerVisibility({
|
|
102
|
+
id: "camera-normal",
|
|
103
|
+
visible: t
|
|
104
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
105
|
+
id: "camera-abnormal",
|
|
106
|
+
visible: t
|
|
107
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
108
|
+
id: "kk-normal",
|
|
109
|
+
visible: i
|
|
110
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
111
|
+
id: "kk-abnormal",
|
|
112
|
+
visible: i
|
|
113
|
+
});
|
|
114
|
+
}
|
|
95
115
|
getLayerConfig(e) {
|
|
96
|
-
let t, i,
|
|
97
|
-
return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196],
|
|
116
|
+
let t, i, r;
|
|
117
|
+
return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], r = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], r = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], r = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], r = this.kkAbnormalLayer), {
|
|
98
118
|
icon: t,
|
|
99
119
|
color: i,
|
|
100
|
-
deviceLayer:
|
|
120
|
+
deviceLayer: r
|
|
101
121
|
};
|
|
102
122
|
}
|
|
103
123
|
async showClusterInExtent(e, t) {
|
|
@@ -112,7 +132,7 @@ class I {
|
|
|
112
132
|
topLeftLon: t.xmin,
|
|
113
133
|
bottomRightLat: t.ymin,
|
|
114
134
|
bottomRightLon: t.xmax,
|
|
115
|
-
devStateSet: [e.deviceState === "normal" ? "1" : "2"],
|
|
135
|
+
devStateSet: e.deviceState ? [e.deviceState === "normal" ? "1" : "2"] : ["1", "2"],
|
|
116
136
|
zdCode: e.zdCode || "",
|
|
117
137
|
ddCode: e.ddCode || "",
|
|
118
138
|
mapLevel: this.view.zoom + 9
|
|
@@ -122,29 +142,29 @@ class I {
|
|
|
122
142
|
console.error(i.statusText);
|
|
123
143
|
return;
|
|
124
144
|
}
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
145
|
+
const r = await i.json();
|
|
146
|
+
if (r.code !== 200)
|
|
127
147
|
return;
|
|
128
|
-
const { icon:
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
var
|
|
132
|
-
const
|
|
148
|
+
const { icon: s, color: o, deviceLayer: l } = this.getLayerConfig(e);
|
|
149
|
+
l.removeAll();
|
|
150
|
+
const c = r.data.map((a) => {
|
|
151
|
+
var b;
|
|
152
|
+
const n = (a.count.toString().length * 6 + 6) / 2, d = new u({
|
|
133
153
|
geometry: {
|
|
134
154
|
type: "point",
|
|
135
|
-
x:
|
|
136
|
-
y:
|
|
155
|
+
x: a.lon,
|
|
156
|
+
y: a.lat
|
|
137
157
|
},
|
|
138
158
|
attributes: {
|
|
139
|
-
id: ((
|
|
159
|
+
id: ((b = a.devInfo) == null ? void 0 : b.deviceId) || a.key,
|
|
140
160
|
type: e.deviceType,
|
|
141
|
-
count:
|
|
161
|
+
count: a.count,
|
|
142
162
|
typeName: e.deviceType === "camera" ? "视频" : "卡口",
|
|
143
163
|
stateName: e.deviceState === "normal" ? "正常" : "异常",
|
|
144
|
-
...
|
|
164
|
+
...a.devInfo
|
|
145
165
|
}
|
|
146
166
|
});
|
|
147
|
-
return
|
|
167
|
+
return a.count > 1 ? d.symbol = {
|
|
148
168
|
type: "cim",
|
|
149
169
|
data: {
|
|
150
170
|
type: "CIMSymbolReference",
|
|
@@ -165,11 +185,11 @@ class I {
|
|
|
165
185
|
geometry: {
|
|
166
186
|
rings: [
|
|
167
187
|
[
|
|
168
|
-
[-
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[-
|
|
172
|
-
[-
|
|
188
|
+
[-n, 30],
|
|
189
|
+
[n, 30],
|
|
190
|
+
[n, 15],
|
|
191
|
+
[-n, 15],
|
|
192
|
+
[-n, 30]
|
|
173
193
|
]
|
|
174
194
|
]
|
|
175
195
|
},
|
|
@@ -179,13 +199,13 @@ class I {
|
|
|
179
199
|
{
|
|
180
200
|
type: "CIMSolidFill",
|
|
181
201
|
enable: !0,
|
|
182
|
-
color:
|
|
202
|
+
color: o.concat([255])
|
|
183
203
|
},
|
|
184
204
|
{
|
|
185
205
|
type: "CIMSolidStroke",
|
|
186
206
|
enable: !0,
|
|
187
207
|
width: 3,
|
|
188
|
-
color:
|
|
208
|
+
color: o.concat([128])
|
|
189
209
|
}
|
|
190
210
|
]
|
|
191
211
|
}
|
|
@@ -214,7 +234,7 @@ class I {
|
|
|
214
234
|
},
|
|
215
235
|
verticalAlignment: "Center"
|
|
216
236
|
},
|
|
217
|
-
textString:
|
|
237
|
+
textString: a.count.toString()
|
|
218
238
|
}
|
|
219
239
|
],
|
|
220
240
|
scaleSymbolsProportionally: !0,
|
|
@@ -232,17 +252,17 @@ class I {
|
|
|
232
252
|
size: 24,
|
|
233
253
|
rotateClockwise: !0,
|
|
234
254
|
textureFilter: "Picture",
|
|
235
|
-
url:
|
|
255
|
+
url: s
|
|
236
256
|
}
|
|
237
257
|
]
|
|
238
258
|
}
|
|
239
259
|
}
|
|
240
|
-
} : (
|
|
260
|
+
} : (d.symbol = {
|
|
241
261
|
type: "picture-marker",
|
|
242
|
-
url:
|
|
262
|
+
url: s,
|
|
243
263
|
width: 18,
|
|
244
264
|
height: 18
|
|
245
|
-
},
|
|
265
|
+
}, d.popupTemplate = {
|
|
246
266
|
title: "视频信息",
|
|
247
267
|
content: [
|
|
248
268
|
{
|
|
@@ -267,11 +287,11 @@ class I {
|
|
|
267
287
|
]
|
|
268
288
|
}
|
|
269
289
|
]
|
|
270
|
-
}),
|
|
290
|
+
}), d;
|
|
271
291
|
});
|
|
272
|
-
|
|
292
|
+
l.addMany(c);
|
|
273
293
|
}
|
|
274
294
|
}
|
|
275
295
|
export {
|
|
276
|
-
|
|
296
|
+
S as default
|
|
277
297
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import m from "@arcgis/core/Graphic";
|
|
2
2
|
import w from "@arcgis/core/layers/FeatureLayer";
|
|
3
3
|
import D from "../common-utils.mjs";
|
|
4
|
-
import { subDistrictPointLayerOptions as
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
this.roadConnections = [], this.view =
|
|
8
|
-
I
|
|
9
|
-
), this.subDistrictPointLayer.spatialReference = i.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new w(
|
|
4
|
+
import { subDistrictPointLayerOptions as P, subDistrictLineLayerOptions as g } from "./layer-symbol.mjs";
|
|
5
|
+
class q {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
this.roadConnections = [], this.view = t, this.subDistrictPointLayer = new w(
|
|
10
8
|
P
|
|
11
|
-
), this.
|
|
9
|
+
), this.subDistrictPointLayer.spatialReference = t.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new w(
|
|
10
|
+
g
|
|
11
|
+
), this.subDistrictLineLayer.spatialReference = t.spatialReference, this.subDistrictLineLayer.popupEnabled = !0, this.view.map.addMany([
|
|
12
12
|
this.subDistrictLineLayer,
|
|
13
13
|
this.subDistrictPointLayer
|
|
14
14
|
]);
|
|
15
15
|
}
|
|
16
|
-
async showSubDistricts(
|
|
17
|
-
var
|
|
18
|
-
await this.clearSubDistricts(), (
|
|
16
|
+
async showSubDistricts(t) {
|
|
17
|
+
var n;
|
|
18
|
+
await this.clearSubDistricts(), (n = this.clickHandler) == null || n.remove(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
|
|
19
19
|
let s = 0;
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const i = [], r = [];
|
|
21
|
+
t.forEach((e) => {
|
|
22
22
|
e.roadConnections.length > 0 && this.roadConnections.push(...e.roadConnections), r.push({
|
|
23
23
|
value: e.id,
|
|
24
24
|
label: e.name,
|
|
@@ -32,17 +32,17 @@ class R {
|
|
|
32
32
|
width: 4
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
}), e.signals.forEach((
|
|
35
|
+
}), e.signals.forEach((a) => {
|
|
36
36
|
const d = new m({
|
|
37
37
|
geometry: {
|
|
38
38
|
type: "point",
|
|
39
|
-
longitude:
|
|
40
|
-
latitude:
|
|
39
|
+
longitude: a.longitude,
|
|
40
|
+
latitude: a.latitude
|
|
41
41
|
},
|
|
42
42
|
attributes: {
|
|
43
43
|
ObjectID: s++,
|
|
44
|
-
id:
|
|
45
|
-
name:
|
|
44
|
+
id: a.nodeId,
|
|
45
|
+
name: a.name,
|
|
46
46
|
subDistrictId: e.id,
|
|
47
47
|
subDistrictName: e.name,
|
|
48
48
|
districtId: e.parentId,
|
|
@@ -52,88 +52,57 @@ class R {
|
|
|
52
52
|
type: "subDistrict"
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
i.push(d);
|
|
56
56
|
});
|
|
57
57
|
}), this.subDistrictPointLayer.renderer = {
|
|
58
|
-
type: "
|
|
59
|
-
|
|
60
|
-
defaultSymbol: {
|
|
58
|
+
type: "simple",
|
|
59
|
+
symbol: {
|
|
61
60
|
type: "simple-marker",
|
|
62
|
-
color: [
|
|
61
|
+
color: [23, 151, 255, 0.8],
|
|
63
62
|
size: "8px",
|
|
64
63
|
outline: {
|
|
65
64
|
color: "white",
|
|
66
65
|
width: 1
|
|
67
66
|
}
|
|
68
|
-
}
|
|
69
|
-
defaultLabel: "其他子区",
|
|
70
|
-
uniqueValueInfos: r,
|
|
71
|
-
visualVariables: [
|
|
72
|
-
{
|
|
73
|
-
type: "size",
|
|
74
|
-
valueExpression: "$view.scale",
|
|
75
|
-
stops: [
|
|
76
|
-
{
|
|
77
|
-
size: 24,
|
|
78
|
-
value: 2500
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
size: 20,
|
|
82
|
-
value: 5e3
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
size: 8,
|
|
86
|
-
value: 18055.954822000003
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
size: 4,
|
|
90
|
-
value: 144447.638572
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
size: 2,
|
|
94
|
-
value: 1155581108577e-6
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
]
|
|
67
|
+
}
|
|
99
68
|
}, this.currentPointRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
|
|
100
|
-
addFeatures:
|
|
101
|
-
}), await D.viewGoto(this.view,
|
|
69
|
+
addFeatures: i
|
|
70
|
+
}), await D.viewGoto(this.view, i);
|
|
102
71
|
}
|
|
103
72
|
/**
|
|
104
73
|
* 显示区控下的所有子区,用道路线表示
|
|
105
74
|
* @param id 区控ID
|
|
106
75
|
*/
|
|
107
|
-
async showRoads(
|
|
108
|
-
const { type: s, id:
|
|
109
|
-
|
|
76
|
+
async showRoads(t) {
|
|
77
|
+
const { type: s, id: i } = t, r = this.subDistrictPointLayer.createQuery(), n = s === "district" ? "districtId" : "subDistrictId";
|
|
78
|
+
i !== "" ? r.where = `${n} = '${i}'` : r.where = "1=1";
|
|
110
79
|
const e = await this.subDistrictPointLayer.queryFeatures(
|
|
111
80
|
r
|
|
112
|
-
),
|
|
81
|
+
), a = /* @__PURE__ */ new Map();
|
|
113
82
|
e.features.forEach((o) => {
|
|
114
83
|
var b;
|
|
115
84
|
const {
|
|
116
|
-
subDistrictId:
|
|
117
|
-
color:
|
|
85
|
+
subDistrictId: c,
|
|
86
|
+
color: u,
|
|
118
87
|
id: h,
|
|
119
88
|
districtName: p,
|
|
120
89
|
subDistrictName: f,
|
|
121
90
|
signalCount: y
|
|
122
91
|
} = o.attributes;
|
|
123
|
-
|
|
124
|
-
color:
|
|
92
|
+
a.has(c) || a.set(c, {
|
|
93
|
+
color: u,
|
|
125
94
|
signalIds: [],
|
|
126
95
|
districtName: p,
|
|
127
96
|
subDistrictName: f,
|
|
128
97
|
signalCount: y
|
|
129
|
-
}), (b =
|
|
98
|
+
}), (b = a.get(c)) == null || b.signalIds.push(h);
|
|
130
99
|
});
|
|
131
100
|
const d = [], L = [];
|
|
132
|
-
for (const o of
|
|
133
|
-
let
|
|
134
|
-
const
|
|
101
|
+
for (const o of a) {
|
|
102
|
+
let c = 0;
|
|
103
|
+
const u = o[0];
|
|
135
104
|
d.push({
|
|
136
|
-
value:
|
|
105
|
+
value: u,
|
|
137
106
|
symbol: {
|
|
138
107
|
type: "simple-line",
|
|
139
108
|
color: o[1].color.split(",").map(Number),
|
|
@@ -143,25 +112,25 @@ class R {
|
|
|
143
112
|
});
|
|
144
113
|
const { districtName: h, subDistrictName: p, signalIds: f, signalCount: y } = o[1];
|
|
145
114
|
this.roadConnections.filter(
|
|
146
|
-
(l) => l.subDistrictId ===
|
|
115
|
+
(l) => l.subDistrictId === u
|
|
147
116
|
).forEach((l) => {
|
|
148
|
-
const
|
|
117
|
+
const I = new m({
|
|
149
118
|
geometry: {
|
|
150
119
|
type: "polyline",
|
|
151
120
|
paths: l.coordinates
|
|
152
121
|
},
|
|
153
122
|
attributes: {
|
|
154
|
-
ObjectID:
|
|
123
|
+
ObjectID: c++,
|
|
155
124
|
id: l.id,
|
|
156
125
|
districtId: l.districtId,
|
|
157
|
-
subDistrictId:
|
|
126
|
+
subDistrictId: u,
|
|
158
127
|
subDistrictName: p,
|
|
159
128
|
districtName: h,
|
|
160
129
|
signalCount: y,
|
|
161
130
|
color: o[1].color
|
|
162
131
|
}
|
|
163
132
|
});
|
|
164
|
-
L.push(
|
|
133
|
+
L.push(I);
|
|
165
134
|
});
|
|
166
135
|
}
|
|
167
136
|
this.subDistrictLineLayer.renderer = {
|
|
@@ -214,52 +183,52 @@ class R {
|
|
|
214
183
|
});
|
|
215
184
|
}
|
|
216
185
|
async clearSubDistricts() {
|
|
217
|
-
var
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
deleteFeatures:
|
|
186
|
+
var i;
|
|
187
|
+
const t = await this.subDistrictPointLayer.queryFeatures();
|
|
188
|
+
t.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
|
|
189
|
+
deleteFeatures: t.features
|
|
221
190
|
}), this.subDistrictPointLayer.definitionExpression = "1=1";
|
|
222
191
|
const s = await this.subDistrictLineLayer.queryFeatures();
|
|
223
192
|
s.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
|
|
224
193
|
deleteFeatures: s.features
|
|
225
|
-
}), this.subDistrictLineLayer.definitionExpression = "1=1", this.roadConnections = [], (
|
|
194
|
+
}), this.subDistrictLineLayer.definitionExpression = "1=1", this.roadConnections = [], (i = this.clickHandler) == null || i.remove();
|
|
226
195
|
}
|
|
227
|
-
setVisible(
|
|
228
|
-
this.showRoads({ type: "district", id: "" }), this.subDistrictPointLayer.visible =
|
|
196
|
+
setVisible(t) {
|
|
197
|
+
this.showRoads({ type: "district", id: "" }), this.subDistrictPointLayer.visible = t, this.subDistrictLineLayer.visible = t;
|
|
229
198
|
}
|
|
230
199
|
/**
|
|
231
200
|
* 定位子区
|
|
232
201
|
* @param id 子区ID
|
|
233
202
|
*/
|
|
234
|
-
async locateSubDistrict(
|
|
203
|
+
async locateSubDistrict(t) {
|
|
235
204
|
const s = this.subDistrictPointLayer.createQuery();
|
|
236
|
-
s.where = `subDistrictId = '${
|
|
237
|
-
const
|
|
238
|
-
return
|
|
205
|
+
s.where = `subDistrictId = '${t}'`, s.returnGeometry = !0;
|
|
206
|
+
const i = await this.subDistrictPointLayer.queryFeatures(s);
|
|
207
|
+
return i.features.length > 0 ? (await D.viewGoto(this.view, i.features, !1), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
239
208
|
}
|
|
240
209
|
/**
|
|
241
210
|
* 高亮子区, 其他子区隐藏
|
|
242
211
|
* @param id 子区ID
|
|
243
212
|
* @return 返回高亮子区的数量以及区控id
|
|
244
213
|
*/
|
|
245
|
-
async highlightSubDistrict(
|
|
214
|
+
async highlightSubDistrict(t) {
|
|
246
215
|
let s = "";
|
|
247
|
-
const
|
|
248
|
-
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${
|
|
249
|
-
const r = await this.subDistrictPointLayer.queryFeatures(),
|
|
250
|
-
return
|
|
216
|
+
const i = this.subDistrictPointLayer.definitionExpression;
|
|
217
|
+
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${t.id}'`;
|
|
218
|
+
const r = await this.subDistrictPointLayer.queryFeatures(), n = r.features.length;
|
|
219
|
+
return n > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${t.id}'`, s = r.features[0].attributes.districtId, await D.viewGoto(
|
|
251
220
|
this.view,
|
|
252
221
|
r.features,
|
|
253
|
-
|
|
254
|
-
)) : this.subDistrictPointLayer.definitionExpression =
|
|
222
|
+
t.needZoom !== !1
|
|
223
|
+
)) : this.subDistrictPointLayer.definitionExpression = i, { count: n, parentId: s };
|
|
255
224
|
}
|
|
256
225
|
/**
|
|
257
226
|
* 按照区控、子区id显示子区
|
|
258
227
|
* @param type 类型,district 或 subDistrict
|
|
259
228
|
* @param id
|
|
260
229
|
*/
|
|
261
|
-
filter(
|
|
262
|
-
const { type: s, id:
|
|
230
|
+
filter(t) {
|
|
231
|
+
const { type: s, id: i } = t, r = `${s === "district" ? "districtId" : "subDistrictId"} = '${i}'`;
|
|
263
232
|
this.subDistrictPointLayer.definitionExpression = r, this.subDistrictLineLayer.definitionExpression = r;
|
|
264
233
|
}
|
|
265
234
|
/**
|
|
@@ -272,17 +241,17 @@ class R {
|
|
|
272
241
|
* 监听地图点击事件,进行子区高亮
|
|
273
242
|
* @param event
|
|
274
243
|
*/
|
|
275
|
-
async viewHitTest(
|
|
244
|
+
async viewHitTest(t) {
|
|
276
245
|
var r;
|
|
277
|
-
const
|
|
246
|
+
const i = (r = (await this.view.hitTest(t, {
|
|
278
247
|
include: [this.subDistrictPointLayer, this.subDistrictLineLayer]
|
|
279
248
|
})).results) == null ? void 0 : r.filter(
|
|
280
|
-
(
|
|
249
|
+
(n) => n.type === "graphic"
|
|
281
250
|
);
|
|
282
|
-
if (
|
|
251
|
+
if (i.length === 0)
|
|
283
252
|
console.time("resetRenderer"), this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
284
253
|
else {
|
|
285
|
-
const
|
|
254
|
+
const n = i[0].graphic, e = n.attributes.color.split(",").map(Number);
|
|
286
255
|
this.subDistrictPointLayer.renderer = {
|
|
287
256
|
type: "unique-value",
|
|
288
257
|
field: "subDistrictId",
|
|
@@ -299,7 +268,7 @@ class R {
|
|
|
299
268
|
defaultLabel: "其他子区",
|
|
300
269
|
uniqueValueInfos: [
|
|
301
270
|
{
|
|
302
|
-
value:
|
|
271
|
+
value: n.attributes.subDistrictId,
|
|
303
272
|
symbol: {
|
|
304
273
|
type: "simple-marker",
|
|
305
274
|
style: "circle",
|
|
@@ -311,35 +280,35 @@ class R {
|
|
|
311
280
|
}
|
|
312
281
|
}
|
|
313
282
|
}
|
|
314
|
-
],
|
|
315
|
-
visualVariables: [
|
|
316
|
-
{
|
|
317
|
-
type: "size",
|
|
318
|
-
valueExpression: "$view.scale",
|
|
319
|
-
stops: [
|
|
320
|
-
{
|
|
321
|
-
size: 24,
|
|
322
|
-
value: 2500
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
size: 20,
|
|
326
|
-
value: 5e3
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
size: 8,
|
|
330
|
-
value: 18055.954822000003
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
size: 4,
|
|
334
|
-
value: 144447.638572
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
size: 2,
|
|
338
|
-
value: 1155581108577e-6
|
|
339
|
-
}
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
283
|
]
|
|
284
|
+
// visualVariables: [
|
|
285
|
+
// {
|
|
286
|
+
// type: 'size',
|
|
287
|
+
// valueExpression: '$view.scale',
|
|
288
|
+
// stops: [
|
|
289
|
+
// {
|
|
290
|
+
// size: 24,
|
|
291
|
+
// value: 2500
|
|
292
|
+
// },
|
|
293
|
+
// {
|
|
294
|
+
// size: 20,
|
|
295
|
+
// value: 5000
|
|
296
|
+
// },
|
|
297
|
+
// {
|
|
298
|
+
// size: 8,
|
|
299
|
+
// value: 18055.954822000003
|
|
300
|
+
// },
|
|
301
|
+
// {
|
|
302
|
+
// size: 4,
|
|
303
|
+
// value: 144447.638572
|
|
304
|
+
// },
|
|
305
|
+
// {
|
|
306
|
+
// size: 2,
|
|
307
|
+
// value: 1155581.108577
|
|
308
|
+
// }
|
|
309
|
+
// ]
|
|
310
|
+
// }
|
|
311
|
+
// ]
|
|
343
312
|
}, this.subDistrictLineLayer.renderer = {
|
|
344
313
|
type: "unique-value",
|
|
345
314
|
field: "subDistrictId",
|
|
@@ -352,47 +321,47 @@ class R {
|
|
|
352
321
|
defaultLabel: "其他子区",
|
|
353
322
|
uniqueValueInfos: [
|
|
354
323
|
{
|
|
355
|
-
value:
|
|
324
|
+
value: n.attributes.subDistrictId,
|
|
356
325
|
symbol: {
|
|
357
326
|
type: "simple-line",
|
|
358
327
|
style: "solid",
|
|
359
|
-
color:
|
|
328
|
+
color: n.attributes.color.split(",").map(Number),
|
|
360
329
|
width: "8px"
|
|
361
330
|
}
|
|
362
331
|
}
|
|
363
|
-
],
|
|
364
|
-
visualVariables: [
|
|
365
|
-
{
|
|
366
|
-
type: "size",
|
|
367
|
-
valueExpression: "$view.scale",
|
|
368
|
-
stops: [
|
|
369
|
-
{
|
|
370
|
-
size: 6,
|
|
371
|
-
value: 2500
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
size: 5,
|
|
375
|
-
value: 5e3
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
size: 4,
|
|
379
|
-
value: 18055.954822000003
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
size: 3,
|
|
383
|
-
value: 144447.638572
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
size: 2,
|
|
387
|
-
value: 1155581108577e-6
|
|
388
|
-
}
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
332
|
]
|
|
333
|
+
// visualVariables: [
|
|
334
|
+
// {
|
|
335
|
+
// type: 'size',
|
|
336
|
+
// valueExpression: '$view.scale',
|
|
337
|
+
// stops: [
|
|
338
|
+
// {
|
|
339
|
+
// size: 6,
|
|
340
|
+
// value: 2500
|
|
341
|
+
// },
|
|
342
|
+
// {
|
|
343
|
+
// size: 5,
|
|
344
|
+
// value: 5000
|
|
345
|
+
// },
|
|
346
|
+
// {
|
|
347
|
+
// size: 4,
|
|
348
|
+
// value: 18055.954822000003
|
|
349
|
+
// },
|
|
350
|
+
// {
|
|
351
|
+
// size: 3,
|
|
352
|
+
// value: 144447.638572
|
|
353
|
+
// },
|
|
354
|
+
// {
|
|
355
|
+
// size: 2,
|
|
356
|
+
// value: 1155581.108577
|
|
357
|
+
// }
|
|
358
|
+
// ]
|
|
359
|
+
// }
|
|
360
|
+
// ]
|
|
392
361
|
};
|
|
393
362
|
}
|
|
394
363
|
}
|
|
395
364
|
}
|
|
396
365
|
export {
|
|
397
|
-
|
|
366
|
+
q as default
|
|
398
367
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -372,8 +372,8 @@ export interface IShowJurisdictionParams {
|
|
|
372
372
|
}
|
|
373
373
|
export interface IShowEdpassDeviceParams {
|
|
374
374
|
deviceType: string;
|
|
375
|
-
deviceState
|
|
376
|
-
|
|
375
|
+
deviceState?: string;
|
|
376
|
+
style: string;
|
|
377
377
|
visible: boolean;
|
|
378
378
|
zdCode?: string;
|
|
379
379
|
ddCode?: string;
|
|
@@ -7,10 +7,16 @@ export default class EdpassDeviceController {
|
|
|
7
7
|
private kkAbnormalLayer;
|
|
8
8
|
private mapInitializer;
|
|
9
9
|
private watchHandle;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private currentShowParams;
|
|
11
|
+
private isCameraVisible;
|
|
12
|
+
private isKkVisible;
|
|
12
13
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
13
14
|
setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
|
|
15
|
+
/**
|
|
16
|
+
* 控制散点图层显示隐藏
|
|
17
|
+
* @param visible
|
|
18
|
+
*/
|
|
19
|
+
private showScatter;
|
|
14
20
|
private getLayerConfig;
|
|
15
21
|
private showClusterInExtent;
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/core/reactiveUtils.js"),p=require("@arcgis/core/Graphic"),m=require("@arcgis/core/layers/GraphicsLayer"),f=require("vue"),k=require("../stores/index.js");function w(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const g=w(v);class C{constructor(e){this.watchHandle=null,this.currentShowParams=null,this.isCameraVisible=!1,this.isKkVisible=!1,this.view=e;const t=k.default.useAppDataStore;this.mapInitializer=f.toRaw(t.mapInitializer),this.cameraNormalLayer=new m({id:"cameraNormalLayer",visible:!1}),this.cameraAbnormalLayer=new m({id:"cameraAbnormalLayer",visible:!1}),this.kkNormalLayer=new m({id:"kkNormalLayer",visible:!1}),this.kkAbnormalLayer=new m({id:"kkAbnormalLayer",visible:!1}),this.view.map.addMany([this.cameraNormalLayer,this.cameraAbnormalLayer,this.kkNormalLayer,this.kkAbnormalLayer])}async setEdpassLayerVisibility(e){var t;if(this.currentShowParams=e,e.deviceType!=="camera"&&e.deviceType!=="kk")return{status:-1,message:"不支持的设备类型"};switch(e.deviceType==="camera"&&(this.isCameraVisible=e.visible),e.deviceType==="kk"&&(this.isKkVisible=e.visible),e.style){case"scatter":{this.showScatter();break}case"cluster":{const{deviceLayer:i}=this.getLayerConfig(e);i.visible=e.visible,e.visible?(await this.showClusterInExtent(e,this.view.extent),this.watchHandle||(this.watchHandle=g.when(()=>this.view.stationary,async()=>{var r,o,l,n,d,a,h,u;this.cameraNormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"normal",style:"cluster",ddCode:((r=this.currentShowParams)==null?void 0:r.ddCode)||"",zdCode:((o=this.currentShowParams)==null?void 0:o.zdCode)||"",visible:!0},this.view.extent),this.cameraAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"abnormal",style:"cluster",ddCode:((l=this.currentShowParams)==null?void 0:l.ddCode)||"",zdCode:((n=this.currentShowParams)==null?void 0:n.zdCode)||"",visible:!0},this.view.extent),this.kkNormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"normal",style:"cluster",ddCode:((d=this.currentShowParams)==null?void 0:d.ddCode)||"",zdCode:((a=this.currentShowParams)==null?void 0:a.zdCode)||"",visible:!0},this.view.extent),this.kkAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"abnormal",style:"cluster",ddCode:((h=this.currentShowParams)==null?void 0:h.ddCode)||"",zdCode:((u=this.currentShowParams)==null?void 0:u.zdCode)||"",visible:!0},this.view.extent)}))):(i.removeAll(),!this.cameraNormalLayer.visible&&!this.cameraAbnormalLayer.visible&&!this.kkNormalLayer.visible&&!this.kkAbnormalLayer.visible&&((t=this.watchHandle)==null||t.remove(),this.watchHandle=null));break}}return{status:0,message:"Success"}}showScatter(e){const t=e??this.isCameraVisible,i=e??this.isKkVisible;this.mapInitializer.setLayerVisibility({id:"camera-normal",visible:t}),this.mapInitializer.setLayerVisibility({id:"camera-abnormal",visible:t}),this.mapInitializer.setLayerVisibility({id:"kk-normal",visible:i}),this.mapInitializer.setLayerVisibility({id:"kk-abnormal",visible:i})}getLayerConfig(e){let t,i,r;return e.deviceType==="camera"?e.deviceState==="normal"?(t="/GisViewerAssets/Images/gis/gis_sxj_map.png",i=[45,108,196],r=this.cameraNormalLayer):(t="/GisViewerAssets/Images/gis/gis_sxj_yc.png",i=[189,49,50],r=this.cameraAbnormalLayer):e.deviceState==="normal"?(t="/GisViewerAssets/Images/gis/gis_kk_map.png",i=[45,108,196],r=this.kkNormalLayer):(t="/GisViewerAssets/Images/gis/gis_kk_yc.png",i=[189,49,50],r=this.kkAbnormalLayer),{icon:t,color:i,deviceLayer:r}}async showClusterInExtent(e,t){const i=await fetch("/es/queryGeoAggregation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceType:e.deviceType,topLeftLat:t.ymax,topLeftLon:t.xmin,bottomRightLat:t.ymin,bottomRightLon:t.xmax,devStateSet:e.deviceState?[e.deviceState==="normal"?"1":"2"]:["1","2"],zdCode:e.zdCode||"",ddCode:e.ddCode||"",mapLevel:this.view.zoom+9})});if(i.status!==200){console.error(i.statusText);return}const r=await i.json();if(r.code!==200)return;const{icon:o,color:l,deviceLayer:n}=this.getLayerConfig(e);n.removeAll();const d=r.data.map(a=>{var b;const c=(a.count.toString().length*6+6)/2,y=new p({geometry:{type:"point",x:a.lon,y:a.lat},attributes:{id:((b=a.devInfo)==null?void 0:b.deviceId)||a.key,type:e.deviceType,count:a.count,typeName:e.deviceType==="camera"?"视频":"卡口",stateName:e.deviceState==="normal"?"正常":"异常",...a.devInfo}});return a.count>1?y.symbol={type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-c,30],[c,30],[c,15],[-c,15],[-c,30]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:l.concat([255])},{type:"CIMSolidStroke",enable:!0,width:3,color:l.concat([128])}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",fontFamilyName:"msyh",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:22,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:a.count.toString()}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:24,rotateClockwise:!0,textureFilter:"Picture",url:o}]}}}:(y.symbol={type:"picture-marker",url:o,width:18,height:18},y.popupTemplate={title:"视频信息",content:[{type:"fields",fieldInfos:[{fieldName:"deviceId",label:"设备编号"},{fieldName:"deviceName",label:"设备名称"},{fieldName:"typeName",label:"设备类型"},{fieldName:"stateName",label:"设备状态"}]}]}),y});n.addMany(d)}}exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/FeatureLayer"),D=require("../common-utils.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/FeatureLayer"),D=require("../common-utils.js"),I=require("./layer-symbol.js");class P{constructor(t){this.roadConnections=[],this.view=t,this.subDistrictPointLayer=new w(I.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=t.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new w(I.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=t.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(t){var n;await this.clearSubDistricts(),(n=this.clickHandler)==null||n.remove(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const i=[],r=[];t.forEach(e=>{e.roadConnections.length>0&&this.roadConnections.push(...e.roadConnections),r.push({value:e.id,label:e.name,symbol:{type:"simple-marker",style:"circle",color:[...e.areaColor,.8],size:"8px",outline:{color:[...e.areaColor],width:4}}}),e.signals.forEach(a=>{const d=new m({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.nodeId,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount,color:e.areaColor.join(","),type:"subDistrict"}});i.push(d)})}),this.subDistrictPointLayer.renderer={type:"simple",symbol:{type:"simple-marker",color:[23,151,255,.8],size:"8px",outline:{color:"white",width:1}}},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:i}),await D.default.viewGoto(this.view,i)}async showRoads(t){const{type:s,id:i}=t,r=this.subDistrictPointLayer.createQuery(),n=s==="district"?"districtId":"subDistrictId";i!==""?r.where=`${n} = '${i}'`:r.where="1=1";const e=await this.subDistrictPointLayer.queryFeatures(r),a=new Map;e.features.forEach(o=>{var p;const{subDistrictId:u,color:c,id:h,districtName:y,subDistrictName:f,signalCount:b}=o.attributes;a.has(u)||a.set(u,{color:c,signalIds:[],districtName:y,subDistrictName:f,signalCount:b}),(p=a.get(u))==null||p.signalIds.push(h)});const d=[],L=[];for(const o of a){let u=0;const c=o[0];d.push({value:c,symbol:{type:"simple-line",color:o[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:h,subDistrictName:y,signalIds:f,signalCount:b}=o[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const g=new m({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:u++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:y,districtName:h,signalCount:b,color:o[1].color}});L.push(g)})}this.subDistrictLineLayer.renderer={type:"simple",symbol:{type:"simple-line",color:[23,151,255],width:2}},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:L})}async clearSubDistricts(){var i;const t=await this.subDistrictPointLayer.queryFeatures();t.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:t.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",this.roadConnections=[],(i=this.clickHandler)==null||i.remove()}setVisible(t){this.showRoads({type:"district",id:""}),this.subDistrictPointLayer.visible=t,this.subDistrictLineLayer.visible=t}async locateSubDistrict(t){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${t}'`,s.returnGeometry=!0;const i=await this.subDistrictPointLayer.queryFeatures(s);return i.features.length>0?(await D.default.viewGoto(this.view,i.features,!1),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(t){let s="";const i=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${t.id}'`;const r=await this.subDistrictPointLayer.queryFeatures(),n=r.features.length;return n>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${t.id}'`,s=r.features[0].attributes.districtId,await D.default.viewGoto(this.view,r.features,t.needZoom!==!1)):this.subDistrictPointLayer.definitionExpression=i,{count:n,parentId:s}}filter(t){const{type:s,id:i}=t,r=`${s==="district"?"districtId":"subDistrictId"} = '${i}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(t){var r;const i=(r=(await this.view.hitTest(t,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(n=>n.type==="graphic");if(i.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const n=i[0].graphic,e=n.attributes.color.split(",").map(Number);this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:n.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...e,.8],size:"8px",outline:{color:e,width:4}}}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:n.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:n.attributes.color.split(",").map(Number),width:"8px"}}]}}}}exports.default=P;
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -372,8 +372,8 @@ export interface IShowJurisdictionParams {
|
|
|
372
372
|
}
|
|
373
373
|
export interface IShowEdpassDeviceParams {
|
|
374
374
|
deviceType: string;
|
|
375
|
-
deviceState
|
|
376
|
-
|
|
375
|
+
deviceState?: string;
|
|
376
|
+
style: string;
|
|
377
377
|
visible: boolean;
|
|
378
378
|
zdCode?: string;
|
|
379
379
|
ddCode?: string;
|