gisviewer-vue3-arcgis 1.0.269 → 1.0.272
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 +4 -0
- package/es/src/gis-map/gis-map.vue.mjs +54 -53
- package/es/src/gis-map/index.d.ts +4 -0
- package/es/src/gis-map/utils/common-utils.mjs +31 -31
- package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +12 -1
- package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.mjs +98 -72
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +105 -99
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +4 -0
- package/lib/src/gis-map/utils/common-utils.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +12 -1
- package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { Point as u } from "@arcgis/core/geometry";
|
|
2
2
|
import y from "@arcgis/core/Graphic";
|
|
3
|
-
import
|
|
3
|
+
import p from "@arcgis/core/layers/GraphicsLayer";
|
|
4
4
|
class C {
|
|
5
5
|
constructor(e) {
|
|
6
|
-
this.
|
|
6
|
+
this.iconSymbolScale = 1e4, this.largeMarkerScale = 4e4, this.oldScale = 0, this.showName = "detail", this.showStyle = "scatter", this.clusterRadius = 120, this.minClusterPoints = 2, this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.clusteredLocations = [], this.locations = [], this.view = e, this.crossLayer = new p({
|
|
7
7
|
id: "signal-control-cross-layer",
|
|
8
8
|
title: "信控路口图层"
|
|
9
9
|
}), this.view.map.add(this.crossLayer);
|
|
10
10
|
}
|
|
11
|
+
didCrossScaleThreshold(e, s, t) {
|
|
12
|
+
return e < t && s >= t || e >= t && s < t;
|
|
13
|
+
}
|
|
11
14
|
locationToScreen() {
|
|
12
15
|
this.clusteredLocations = [], this.locations.forEach((e) => {
|
|
13
|
-
const
|
|
16
|
+
const s = this.view.toScreen(
|
|
14
17
|
new u({ x: e.x, y: e.y })
|
|
15
18
|
);
|
|
16
|
-
|
|
19
|
+
s.x > 0 && s.y > 0 && (e.properties.screenX = s.x, e.properties.screenY = s.y, e.visited = !1, e.clusterId = void 0, this.clusteredLocations.push(e));
|
|
17
20
|
});
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
@@ -22,50 +25,57 @@ class C {
|
|
|
22
25
|
* @returns
|
|
23
26
|
*/
|
|
24
27
|
showSignalCross(e) {
|
|
25
|
-
if (this.crossLayer.removeAll(), this.showName = e.showName || "
|
|
26
|
-
if (this.showStyle === "scatter")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (this.crossLayer.removeAll(), this.showName = e.showName || "detail", this.showStyle = e.style || "scatter", this.oldScale = this.view.scale, this.scaleWatchHandle || (this.scaleWatchHandle = this.view.watch("stationary", () => {
|
|
29
|
+
if (this.showStyle === "scatter") {
|
|
30
|
+
const s = this.view.scale, t = this.didCrossScaleThreshold(
|
|
31
|
+
this.oldScale,
|
|
32
|
+
s,
|
|
33
|
+
this.iconSymbolScale
|
|
34
|
+
), i = this.didCrossScaleThreshold(
|
|
35
|
+
this.oldScale,
|
|
36
|
+
s,
|
|
37
|
+
this.largeMarkerScale
|
|
38
|
+
);
|
|
39
|
+
(t || i) && this.updateScatterSymbol(), this.oldScale = s;
|
|
40
|
+
} else {
|
|
31
41
|
this.locationToScreen();
|
|
32
|
-
const
|
|
33
|
-
this.showClusterResult(
|
|
42
|
+
const s = this.doPixelCluster(this.clusterRadius);
|
|
43
|
+
this.showClusterResult(s);
|
|
34
44
|
}
|
|
35
45
|
})), this.showStyle === "scatter") {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
46
|
+
const s = e.points.map((t) => {
|
|
47
|
+
const i = this.getCrossSymbol(t), r = this.getBrandLabel(t.brand), o = this.getOnlineLabel(t.isOnline), a = this.getMalfunctionLabel(
|
|
48
|
+
t.isMalfunction
|
|
39
49
|
);
|
|
40
50
|
return new y({
|
|
41
51
|
geometry: {
|
|
42
52
|
type: "point",
|
|
43
|
-
longitude:
|
|
44
|
-
latitude:
|
|
53
|
+
longitude: t.x,
|
|
54
|
+
latitude: t.y
|
|
45
55
|
},
|
|
46
|
-
symbol:
|
|
56
|
+
symbol: i,
|
|
47
57
|
attributes: {
|
|
48
58
|
type: "signal-cross",
|
|
49
|
-
id:
|
|
59
|
+
id: t.crossId,
|
|
50
60
|
brandLabel: r,
|
|
51
61
|
isOnlineLabel: o,
|
|
52
|
-
isMalfunctionLabel:
|
|
53
|
-
...
|
|
62
|
+
isMalfunctionLabel: a,
|
|
63
|
+
...t
|
|
54
64
|
}
|
|
55
65
|
});
|
|
56
66
|
});
|
|
57
|
-
this.crossLayer.addMany(
|
|
67
|
+
this.crossLayer.addMany(s);
|
|
58
68
|
} else {
|
|
59
|
-
this.locations = e.points.map((
|
|
60
|
-
id:
|
|
61
|
-
x:
|
|
62
|
-
y:
|
|
69
|
+
this.locations = e.points.map((t) => ({
|
|
70
|
+
id: t.crossId,
|
|
71
|
+
x: t.x,
|
|
72
|
+
y: t.y,
|
|
63
73
|
visited: !1,
|
|
64
74
|
clusterId: void 0,
|
|
65
|
-
properties:
|
|
75
|
+
properties: t
|
|
66
76
|
})), this.locationToScreen();
|
|
67
|
-
const
|
|
68
|
-
this.showClusterResult(
|
|
77
|
+
const s = this.doPixelCluster(this.clusterRadius);
|
|
78
|
+
this.showClusterResult(s);
|
|
69
79
|
}
|
|
70
80
|
return { status: 0, message: "ok" };
|
|
71
81
|
}
|
|
@@ -73,6 +83,21 @@ class C {
|
|
|
73
83
|
var e;
|
|
74
84
|
this.crossLayer.removeAll(), (e = this.scaleWatchHandle) == null || e.remove(), this.scaleWatchHandle = null;
|
|
75
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* 更改路口显示名称内容
|
|
88
|
+
* @param showName
|
|
89
|
+
*/
|
|
90
|
+
changeShowName(e) {
|
|
91
|
+
this.showName = e, this.showStyle === "scatter" && this.updateScatterSymbol();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 更新散点符号
|
|
95
|
+
*/
|
|
96
|
+
updateScatterSymbol() {
|
|
97
|
+
this.crossLayer.graphics.forEach((e) => {
|
|
98
|
+
e.symbol = this.getCrossSymbol(e.attributes);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
76
101
|
/**
|
|
77
102
|
* 按照像素距离聚类
|
|
78
103
|
* @param locations
|
|
@@ -81,16 +106,16 @@ class C {
|
|
|
81
106
|
* @returns
|
|
82
107
|
*/
|
|
83
108
|
doPixelCluster(e) {
|
|
84
|
-
let
|
|
85
|
-
for (let
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
109
|
+
let s = 0;
|
|
110
|
+
for (let t = 0; t < this.clusteredLocations.length; t++) {
|
|
111
|
+
const i = this.clusteredLocations[t];
|
|
112
|
+
if (i.visited)
|
|
88
113
|
continue;
|
|
89
|
-
|
|
90
|
-
const r = this.getNeighbors(
|
|
91
|
-
r.length < this.minClusterPoints ?
|
|
92
|
-
o.visited = !0, o.clusterId =
|
|
93
|
-
}),
|
|
114
|
+
i.visited = !0;
|
|
115
|
+
const r = this.getNeighbors(i, e);
|
|
116
|
+
r.length < this.minClusterPoints ? i.clusterId = -1 : (r.forEach((o) => {
|
|
117
|
+
o.visited = !0, o.clusterId = s;
|
|
118
|
+
}), i.clusterId = s, s++);
|
|
94
119
|
}
|
|
95
120
|
return this.createClusters();
|
|
96
121
|
}
|
|
@@ -101,8 +126,8 @@ class C {
|
|
|
101
126
|
* @param eps
|
|
102
127
|
* @returns
|
|
103
128
|
*/
|
|
104
|
-
getNeighbors(e,
|
|
105
|
-
return this.clusteredLocations.filter((
|
|
129
|
+
getNeighbors(e, s) {
|
|
130
|
+
return this.clusteredLocations.filter((t) => t.id === e.id || t.visited ? !1 : this.getDistance(e, t) <= s);
|
|
106
131
|
}
|
|
107
132
|
/**
|
|
108
133
|
* 两点间的像素距离
|
|
@@ -110,9 +135,9 @@ class C {
|
|
|
110
135
|
* @param point2
|
|
111
136
|
* @returns
|
|
112
137
|
*/
|
|
113
|
-
getDistance(e,
|
|
138
|
+
getDistance(e, s) {
|
|
114
139
|
return Math.sqrt(
|
|
115
|
-
Math.pow(e.properties.screenX -
|
|
140
|
+
Math.pow(e.properties.screenX - s.properties.screenX, 2) + Math.pow(e.properties.screenY - s.properties.screenY, 2)
|
|
116
141
|
);
|
|
117
142
|
}
|
|
118
143
|
/**
|
|
@@ -121,41 +146,41 @@ class C {
|
|
|
121
146
|
* @returns
|
|
122
147
|
*/
|
|
123
148
|
createClusters() {
|
|
124
|
-
const e = {},
|
|
125
|
-
for (const
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
const o = e[Number(
|
|
149
|
+
const e = {}, s = [];
|
|
150
|
+
for (const i of this.clusteredLocations)
|
|
151
|
+
i.clusterId === void 0 || i.clusterId === -1 ? s.push(i) : (e[i.clusterId] || (e[i.clusterId] = []), e[i.clusterId].push(i));
|
|
152
|
+
const t = Object.keys(e).map((i, r) => {
|
|
153
|
+
const o = e[Number(i)], a = o.length, l = o.reduce((c, h) => c + h.x, 0), n = o.reduce((c, h) => c + h.y, 0), m = l / a, d = n / a;
|
|
129
154
|
return {
|
|
130
|
-
id: Number(
|
|
155
|
+
id: Number(i),
|
|
131
156
|
items: o,
|
|
132
|
-
count:
|
|
157
|
+
count: a,
|
|
133
158
|
center: {
|
|
134
159
|
x: m,
|
|
135
|
-
y:
|
|
160
|
+
y: d
|
|
136
161
|
}
|
|
137
162
|
};
|
|
138
163
|
});
|
|
139
|
-
return
|
|
164
|
+
return s.length > 0 && t.push({
|
|
140
165
|
id: -1,
|
|
141
|
-
items:
|
|
142
|
-
count:
|
|
166
|
+
items: s,
|
|
167
|
+
count: s.length,
|
|
143
168
|
center: null
|
|
144
|
-
}),
|
|
169
|
+
}), t;
|
|
145
170
|
}
|
|
146
171
|
showClusterResult(e) {
|
|
147
172
|
this.crossLayer.removeAll();
|
|
148
|
-
let
|
|
149
|
-
e.forEach((
|
|
150
|
-
|
|
151
|
-
}), e.forEach((
|
|
152
|
-
if (
|
|
153
|
-
let r =
|
|
173
|
+
let s = Number.MIN_VALUE, t = Number.MAX_VALUE;
|
|
174
|
+
e.forEach((i) => {
|
|
175
|
+
i.count > 1 && (t = Math.min(t, i.count), s = Math.max(s, i.count));
|
|
176
|
+
}), e.forEach((i) => {
|
|
177
|
+
if (i.id !== -1) {
|
|
178
|
+
let r = t === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (i.count - t) / (s - t) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
|
|
154
179
|
r *= 0.75;
|
|
155
|
-
const l = (
|
|
156
|
-
geometry: new u({ x:
|
|
180
|
+
const l = (i.count.toString().length * 8 + 6) / 2, n = new y({
|
|
181
|
+
geometry: new u({ x: i.center.x, y: i.center.y }),
|
|
157
182
|
attributes: {
|
|
158
|
-
count:
|
|
183
|
+
count: i.count
|
|
159
184
|
},
|
|
160
185
|
symbol: {
|
|
161
186
|
type: "cim",
|
|
@@ -265,9 +290,9 @@ class C {
|
|
|
265
290
|
}
|
|
266
291
|
}
|
|
267
292
|
});
|
|
268
|
-
this.crossLayer.add(
|
|
293
|
+
this.crossLayer.add(n);
|
|
269
294
|
} else
|
|
270
|
-
|
|
295
|
+
i.items.forEach((r) => {
|
|
271
296
|
const o = new y({
|
|
272
297
|
geometry: new u({ x: r.x, y: r.y }),
|
|
273
298
|
attributes: {
|
|
@@ -283,8 +308,8 @@ class C {
|
|
|
283
308
|
});
|
|
284
309
|
}
|
|
285
310
|
getBrandLabel(e) {
|
|
286
|
-
const
|
|
287
|
-
return
|
|
311
|
+
const s = (e ?? "").toLowerCase();
|
|
312
|
+
return s === "scats" ? "SCATS" : s === "gc" ? "国产" : e ?? "";
|
|
288
313
|
}
|
|
289
314
|
getOnlineLabel(e) {
|
|
290
315
|
return e ? "在线" : "离线";
|
|
@@ -293,7 +318,8 @@ class C {
|
|
|
293
318
|
return e ? "故障" : "正常";
|
|
294
319
|
}
|
|
295
320
|
getCrossSymbol(e) {
|
|
296
|
-
|
|
321
|
+
var s;
|
|
322
|
+
if (this.view.scale <= this.iconSymbolScale) {
|
|
297
323
|
let t = "/GisViewerAssets/Images/cross/ic_";
|
|
298
324
|
return t += e.brand === "scats" ? "scats_" : "gc_", t += e.isOnline ? "online_" : "offline_", t += e.isMalfunction ? "malfunction.png" : "normal.png", {
|
|
299
325
|
type: "cim",
|
|
@@ -308,7 +334,7 @@ class C {
|
|
|
308
334
|
valueExpressionInfo: {
|
|
309
335
|
type: "CIMExpressionInfo",
|
|
310
336
|
title: "Custom",
|
|
311
|
-
expression: this.showName === "
|
|
337
|
+
expression: this.showName === "crossName" ? 'Replace($feature.name, "与", "/")' : this.showName === "signalId" ? "$feature.signalId" : 'Replace($feature.name, "与", "/") + " " + $feature.signalId',
|
|
312
338
|
returnType: "Default"
|
|
313
339
|
}
|
|
314
340
|
}
|
|
@@ -385,10 +411,10 @@ class C {
|
|
|
385
411
|
const t = {
|
|
386
412
|
type: "simple-marker",
|
|
387
413
|
style: "circle",
|
|
388
|
-
size: 6,
|
|
389
|
-
outline: { width:
|
|
414
|
+
size: this.view.scale > this.largeMarkerScale ? 3 : 6,
|
|
415
|
+
outline: { width: 1 }
|
|
390
416
|
};
|
|
391
|
-
return e.brand.toLowerCase() === "scats" ? (e.isOnline ? t.color = [
|
|
417
|
+
return ((s = e.brand) == null ? void 0 : s.toLowerCase()) === "scats" ? (e.isOnline ? t.color = [68, 203, 188] : t.color = [200, 200, 200], t.outline.color = [32, 97, 90]) : (e.isOnline ? t.color = [129, 226, 73] : t.color = [200, 200, 200], t.outline.color = [65, 115, 37]), t;
|
|
392
418
|
}
|
|
393
419
|
}
|
|
394
420
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import m from "@arcgis/core/Graphic";
|
|
2
|
-
import
|
|
2
|
+
import w from "@arcgis/core/layers/FeatureLayer";
|
|
3
3
|
import D from "../common-utils.mjs";
|
|
4
|
-
import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as
|
|
5
|
-
class
|
|
4
|
+
import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as P } from "./layer-symbol.mjs";
|
|
5
|
+
class R {
|
|
6
6
|
constructor(i) {
|
|
7
|
-
this.roadConnections = [], this.view = i, this.subDistrictPointLayer = new
|
|
7
|
+
this.roadConnections = [], this.view = i, this.subDistrictPointLayer = new w(
|
|
8
8
|
I
|
|
9
|
-
), this.subDistrictPointLayer.spatialReference = i.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new
|
|
10
|
-
|
|
9
|
+
), this.subDistrictPointLayer.spatialReference = i.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new w(
|
|
10
|
+
P
|
|
11
11
|
), this.subDistrictLineLayer.spatialReference = i.spatialReference, this.subDistrictLineLayer.popupEnabled = !0, this.view.map.addMany([
|
|
12
12
|
this.subDistrictLineLayer,
|
|
13
13
|
this.subDistrictPointLayer
|
|
@@ -17,22 +17,22 @@ class C {
|
|
|
17
17
|
var a;
|
|
18
18
|
await this.clearSubDistricts(), (a = this.clickHandler) == null || a.remove(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
|
|
19
19
|
let s = 0;
|
|
20
|
-
const
|
|
21
|
-
i.forEach((
|
|
22
|
-
|
|
23
|
-
value:
|
|
24
|
-
label:
|
|
20
|
+
const t = [], r = [];
|
|
21
|
+
i.forEach((e) => {
|
|
22
|
+
e.roadConnections.length > 0 && this.roadConnections.push(...e.roadConnections), r.push({
|
|
23
|
+
value: e.id,
|
|
24
|
+
label: e.name,
|
|
25
25
|
symbol: {
|
|
26
26
|
type: "simple-marker",
|
|
27
27
|
style: "circle",
|
|
28
|
-
color: [...
|
|
28
|
+
color: [...e.areaColor, 0.8],
|
|
29
29
|
size: "8px",
|
|
30
30
|
outline: {
|
|
31
|
-
color: [...
|
|
31
|
+
color: [...e.areaColor],
|
|
32
32
|
width: 4
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), e.signals.forEach((n) => {
|
|
36
36
|
const d = new m({
|
|
37
37
|
geometry: {
|
|
38
38
|
type: "point",
|
|
@@ -43,16 +43,16 @@ class C {
|
|
|
43
43
|
ObjectID: s++,
|
|
44
44
|
id: n.nodeId,
|
|
45
45
|
name: n.name,
|
|
46
|
-
subDistrictId:
|
|
47
|
-
subDistrictName:
|
|
48
|
-
districtId:
|
|
49
|
-
districtName:
|
|
50
|
-
signalCount:
|
|
51
|
-
color:
|
|
46
|
+
subDistrictId: e.id,
|
|
47
|
+
subDistrictName: e.name,
|
|
48
|
+
districtId: e.parentId,
|
|
49
|
+
districtName: e.parentName,
|
|
50
|
+
signalCount: e.signalCount,
|
|
51
|
+
color: e.areaColor.join(","),
|
|
52
52
|
type: "subDistrict"
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
t.push(d);
|
|
56
56
|
});
|
|
57
57
|
}), this.subDistrictPointLayer.renderer = {
|
|
58
58
|
type: "unique-value",
|
|
@@ -97,118 +97,124 @@ class C {
|
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
}, this.currentPointRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
|
|
100
|
-
addFeatures:
|
|
101
|
-
}), await D.viewGoto(this.view,
|
|
100
|
+
addFeatures: t
|
|
101
|
+
}), await D.viewGoto(this.view, t);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* 显示区控下的所有子区,用道路线表示
|
|
105
105
|
* @param id 区控ID
|
|
106
106
|
*/
|
|
107
107
|
async showRoads(i) {
|
|
108
|
-
const { type: s, id:
|
|
109
|
-
|
|
110
|
-
const
|
|
108
|
+
const { type: s, id: t } = i, r = this.subDistrictPointLayer.createQuery(), a = s === "district" ? "districtId" : "subDistrictId";
|
|
109
|
+
t !== "" ? r.where = `${a} = '${t}'` : r.where = "1=1";
|
|
110
|
+
const e = await this.subDistrictPointLayer.queryFeatures(
|
|
111
111
|
r
|
|
112
112
|
), n = /* @__PURE__ */ new Map();
|
|
113
|
-
|
|
113
|
+
e.features.forEach((o) => {
|
|
114
114
|
var b;
|
|
115
115
|
const {
|
|
116
|
-
subDistrictId:
|
|
116
|
+
subDistrictId: u,
|
|
117
117
|
color: c,
|
|
118
|
-
id:
|
|
119
|
-
districtName:
|
|
120
|
-
subDistrictName:
|
|
118
|
+
id: h,
|
|
119
|
+
districtName: p,
|
|
120
|
+
subDistrictName: f,
|
|
121
121
|
signalCount: y
|
|
122
|
-
} =
|
|
123
|
-
n.has(
|
|
122
|
+
} = o.attributes;
|
|
123
|
+
n.has(u) || n.set(u, {
|
|
124
124
|
color: c,
|
|
125
125
|
signalIds: [],
|
|
126
|
-
districtName:
|
|
127
|
-
subDistrictName:
|
|
126
|
+
districtName: p,
|
|
127
|
+
subDistrictName: f,
|
|
128
128
|
signalCount: y
|
|
129
|
-
}), (b = n.get(
|
|
129
|
+
}), (b = n.get(u)) == null || b.signalIds.push(h);
|
|
130
130
|
});
|
|
131
|
-
const d = [],
|
|
132
|
-
for (const
|
|
133
|
-
let
|
|
134
|
-
const c =
|
|
131
|
+
const d = [], L = [];
|
|
132
|
+
for (const o of n) {
|
|
133
|
+
let u = 0;
|
|
134
|
+
const c = o[0];
|
|
135
135
|
d.push({
|
|
136
136
|
value: c,
|
|
137
137
|
symbol: {
|
|
138
138
|
type: "simple-line",
|
|
139
|
-
color:
|
|
139
|
+
color: o[1].color.split(",").map(Number),
|
|
140
140
|
width: 2,
|
|
141
141
|
style: "solid"
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
-
const { districtName:
|
|
144
|
+
const { districtName: h, subDistrictName: p, signalIds: f, signalCount: y } = o[1];
|
|
145
145
|
this.roadConnections.filter(
|
|
146
146
|
(l) => l.subDistrictId === c
|
|
147
147
|
).forEach((l) => {
|
|
148
|
-
const
|
|
148
|
+
const v = new m({
|
|
149
149
|
geometry: {
|
|
150
150
|
type: "polyline",
|
|
151
151
|
paths: l.coordinates
|
|
152
152
|
},
|
|
153
153
|
attributes: {
|
|
154
|
-
ObjectID:
|
|
154
|
+
ObjectID: u++,
|
|
155
155
|
id: l.id,
|
|
156
156
|
districtId: l.districtId,
|
|
157
157
|
subDistrictId: c,
|
|
158
|
-
subDistrictName:
|
|
159
|
-
districtName:
|
|
158
|
+
subDistrictName: p,
|
|
159
|
+
districtName: h,
|
|
160
160
|
signalCount: y,
|
|
161
|
-
color:
|
|
161
|
+
color: o[1].color
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
L.push(v);
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
this.subDistrictLineLayer.renderer = {
|
|
168
|
-
type: "
|
|
169
|
-
|
|
170
|
-
defaultSymbol: {
|
|
168
|
+
type: "simple",
|
|
169
|
+
symbol: {
|
|
171
170
|
type: "simple-line",
|
|
172
|
-
color: [
|
|
173
|
-
width: 2
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
171
|
+
color: [23, 151, 255],
|
|
172
|
+
width: 2
|
|
173
|
+
}
|
|
174
|
+
// type: 'unique-value',
|
|
175
|
+
// field: 'subDistrictId',
|
|
176
|
+
// defaultSymbol: {
|
|
177
|
+
// type: 'simple-line',
|
|
178
|
+
// color: [180, 180, 180, 0.5],
|
|
179
|
+
// width: 2,
|
|
180
|
+
// style: 'solid'
|
|
181
|
+
// },
|
|
182
|
+
// defaultLabel: '其他子区',
|
|
183
|
+
// uniqueValueInfos,
|
|
184
|
+
// visualVariables: [
|
|
185
|
+
// {
|
|
186
|
+
// type: 'size',
|
|
187
|
+
// valueExpression: '$view.scale',
|
|
188
|
+
// stops: [
|
|
189
|
+
// {
|
|
190
|
+
// size: 6,
|
|
191
|
+
// value: 2500
|
|
192
|
+
// },
|
|
193
|
+
// {
|
|
194
|
+
// size: 5,
|
|
195
|
+
// value: 5000
|
|
196
|
+
// },
|
|
197
|
+
// {
|
|
198
|
+
// size: 4,
|
|
199
|
+
// value: 18055.954822000003
|
|
200
|
+
// },
|
|
201
|
+
// {
|
|
202
|
+
// size: 3,
|
|
203
|
+
// value: 144447.638572
|
|
204
|
+
// },
|
|
205
|
+
// {
|
|
206
|
+
// size: 2,
|
|
207
|
+
// value: 1155581.108577
|
|
208
|
+
// }
|
|
209
|
+
// ]
|
|
210
|
+
// }
|
|
211
|
+
// ]
|
|
206
212
|
}, this.currentLineRenderer = this.subDistrictLineLayer.renderer.clone(), await this.subDistrictLineLayer.applyEdits({
|
|
207
|
-
addFeatures:
|
|
213
|
+
addFeatures: L
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
216
|
async clearSubDistricts() {
|
|
211
|
-
var
|
|
217
|
+
var t;
|
|
212
218
|
const i = await this.subDistrictPointLayer.queryFeatures();
|
|
213
219
|
i.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
|
|
214
220
|
deleteFeatures: i.features
|
|
@@ -216,7 +222,7 @@ class C {
|
|
|
216
222
|
const s = await this.subDistrictLineLayer.queryFeatures();
|
|
217
223
|
s.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
|
|
218
224
|
deleteFeatures: s.features
|
|
219
|
-
}), this.subDistrictLineLayer.definitionExpression = "1=1", this.roadConnections = [], (
|
|
225
|
+
}), this.subDistrictLineLayer.definitionExpression = "1=1", this.roadConnections = [], (t = this.clickHandler) == null || t.remove();
|
|
220
226
|
}
|
|
221
227
|
setVisible(i) {
|
|
222
228
|
this.showRoads({ type: "district", id: "" }), this.subDistrictPointLayer.visible = i, this.subDistrictLineLayer.visible = i;
|
|
@@ -228,8 +234,8 @@ class C {
|
|
|
228
234
|
async locateSubDistrict(i) {
|
|
229
235
|
const s = this.subDistrictPointLayer.createQuery();
|
|
230
236
|
s.where = `subDistrictId = '${i}'`, s.returnGeometry = !0;
|
|
231
|
-
const
|
|
232
|
-
return
|
|
237
|
+
const t = await this.subDistrictPointLayer.queryFeatures(s);
|
|
238
|
+
return t.features.length > 0 ? (await D.viewGoto(this.view, t.features, !1), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
233
239
|
}
|
|
234
240
|
/**
|
|
235
241
|
* 高亮子区, 其他子区隐藏
|
|
@@ -238,14 +244,14 @@ class C {
|
|
|
238
244
|
*/
|
|
239
245
|
async highlightSubDistrict(i) {
|
|
240
246
|
let s = "";
|
|
241
|
-
const
|
|
247
|
+
const t = this.subDistrictPointLayer.definitionExpression;
|
|
242
248
|
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${i.id}'`;
|
|
243
249
|
const r = await this.subDistrictPointLayer.queryFeatures(), a = r.features.length;
|
|
244
250
|
return a > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${i.id}'`, s = r.features[0].attributes.districtId, await D.viewGoto(
|
|
245
251
|
this.view,
|
|
246
252
|
r.features,
|
|
247
253
|
i.needZoom !== !1
|
|
248
|
-
)) : this.subDistrictPointLayer.definitionExpression =
|
|
254
|
+
)) : this.subDistrictPointLayer.definitionExpression = t, { count: a, parentId: s };
|
|
249
255
|
}
|
|
250
256
|
/**
|
|
251
257
|
* 按照区控、子区id显示子区
|
|
@@ -253,7 +259,7 @@ class C {
|
|
|
253
259
|
* @param id
|
|
254
260
|
*/
|
|
255
261
|
filter(i) {
|
|
256
|
-
const { type: s, id:
|
|
262
|
+
const { type: s, id: t } = i, r = `${s === "district" ? "districtId" : "subDistrictId"} = '${t}'`;
|
|
257
263
|
this.subDistrictPointLayer.definitionExpression = r, this.subDistrictLineLayer.definitionExpression = r;
|
|
258
264
|
}
|
|
259
265
|
/**
|
|
@@ -268,15 +274,15 @@ class C {
|
|
|
268
274
|
*/
|
|
269
275
|
async viewHitTest(i) {
|
|
270
276
|
var r;
|
|
271
|
-
const
|
|
277
|
+
const t = (r = (await this.view.hitTest(i, {
|
|
272
278
|
include: [this.subDistrictPointLayer, this.subDistrictLineLayer]
|
|
273
279
|
})).results) == null ? void 0 : r.filter(
|
|
274
280
|
(a) => a.type === "graphic"
|
|
275
281
|
);
|
|
276
|
-
if (
|
|
282
|
+
if (t.length === 0)
|
|
277
283
|
console.time("resetRenderer"), this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
278
284
|
else {
|
|
279
|
-
const a =
|
|
285
|
+
const a = t[0].graphic, e = a.attributes.color.split(",").map(Number);
|
|
280
286
|
this.subDistrictPointLayer.renderer = {
|
|
281
287
|
type: "unique-value",
|
|
282
288
|
field: "subDistrictId",
|
|
@@ -297,10 +303,10 @@ class C {
|
|
|
297
303
|
symbol: {
|
|
298
304
|
type: "simple-marker",
|
|
299
305
|
style: "circle",
|
|
300
|
-
color: [...
|
|
306
|
+
color: [...e, 0.8],
|
|
301
307
|
size: "8px",
|
|
302
308
|
outline: {
|
|
303
|
-
color:
|
|
309
|
+
color: e,
|
|
304
310
|
width: 4
|
|
305
311
|
}
|
|
306
312
|
}
|
|
@@ -388,5 +394,5 @@ class C {
|
|
|
388
394
|
}
|
|
389
395
|
}
|
|
390
396
|
export {
|
|
391
|
-
|
|
397
|
+
R as default
|
|
392
398
|
};
|
|
@@ -193,6 +193,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
193
193
|
status: number;
|
|
194
194
|
message: string;
|
|
195
195
|
};
|
|
196
|
+
changeSignalCrossShowName: (nameType: string) => void | {
|
|
197
|
+
status: number;
|
|
198
|
+
message: string;
|
|
199
|
+
};
|
|
196
200
|
addGreenWaveBand: (params: IEditSignalControlAreaParams) => void;
|
|
197
201
|
stopAddGreenWaveBand: () => {
|
|
198
202
|
status: number;
|