gisviewer-vue3-arcgis 1.0.251 → 1.0.252
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 -1
- package/es/src/gis-map/gis-map.vue.mjs +155 -153
- package/es/src/gis-map/index.d.ts +2 -0
- package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
- package/es/src/gis-map/utils/dbscan-cluster/index.mjs +256 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +69 -65
- package/es/src/gis-map/utils/overlay.d.ts +3 -8
- package/es/src/gis-map/utils/overlay.mjs +48 -52
- package/es/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
- package/es/src/gis-map/utils/signal-control-area/district-renderer.mjs +6 -2
- package/es/src/gis-map/utils/signal-control-area/show-area.mjs +15 -15
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +6 -2
- package/es/src/types/index.d.ts +29 -2
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +2 -0
- package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
- package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
- package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -1
- package/lib/src/gis-map/utils/overlay.d.ts +3 -8
- package/lib/src/gis-map/utils/overlay.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
- package/lib/src/gis-map/utils/signal-control-area/district-renderer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
- package/lib/src/types/index.d.ts +29 -2
- package/package.json +1 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import * as f from "@arcgis/core/core/reactiveUtils";
|
|
2
|
+
import { Point as a } from "@arcgis/core/geometry";
|
|
3
|
+
import m from "@arcgis/core/Graphic";
|
|
4
|
+
import b from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
class M {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = e, this.currentZoom = e.zoom, this.clusterLayer = new b(), this.view.map.add(this.clusterLayer);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 将地理位置转换为屏幕坐标
|
|
11
|
+
*/
|
|
12
|
+
locationToScreen() {
|
|
13
|
+
this.locations.forEach((e) => {
|
|
14
|
+
const s = this.view.toScreen(
|
|
15
|
+
new a({ x: e.x, y: e.y })
|
|
16
|
+
);
|
|
17
|
+
e.properties.screenX = s.x, e.properties.screenY = s.y;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 添加聚类点到视图
|
|
22
|
+
* @param params
|
|
23
|
+
*/
|
|
24
|
+
addClusterPoints(e) {
|
|
25
|
+
var o;
|
|
26
|
+
this.locations = e.points, this.clusterMarkUrl = ((o = e.clusterSymbol) == null ? void 0 : o.url) || "/GisViewerAssets/Images/cross/gis_xhj_blue.png", e.points.forEach((r) => {
|
|
27
|
+
r.symbol || (r.symbol = e.pointSymbol || {
|
|
28
|
+
type: "simple-marker",
|
|
29
|
+
style: "circle",
|
|
30
|
+
color: "#3388ff",
|
|
31
|
+
size: 8,
|
|
32
|
+
outline: {
|
|
33
|
+
color: "#ffffff",
|
|
34
|
+
width: 1
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}), this.zoomWatchHandle || (this.zoomWatchHandle = f.watch(
|
|
38
|
+
() => this.view.zoom,
|
|
39
|
+
() => {
|
|
40
|
+
Math.abs(this.currentZoom - this.view.zoom) >= 1 && (this.currentZoom = this.view.zoom, this.locationToScreen(), this.clusterLayer.removeAll(), this.addClusterPoints(e));
|
|
41
|
+
}
|
|
42
|
+
)), this.locationToScreen(), console.time("cluster");
|
|
43
|
+
const s = this.doPixelCluster(e.points, 120, 3);
|
|
44
|
+
console.timeEnd("cluster"), this.showClusters(s);
|
|
45
|
+
}
|
|
46
|
+
showClusters(e) {
|
|
47
|
+
let s = Number.MIN_VALUE, o = Number.MAX_VALUE;
|
|
48
|
+
e.forEach((r) => {
|
|
49
|
+
r.count > 1 && (o = Math.min(o, r.count), s = Math.max(s, r.count));
|
|
50
|
+
}), e.forEach((r) => {
|
|
51
|
+
if (r.id !== -1) {
|
|
52
|
+
let t = o === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (r.count - o) / (s - o) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
|
|
53
|
+
t *= 0.75;
|
|
54
|
+
const i = new m({
|
|
55
|
+
geometry: new a({ x: r.center.x, y: r.center.y }),
|
|
56
|
+
attributes: {
|
|
57
|
+
count: r.count
|
|
58
|
+
},
|
|
59
|
+
symbol: {
|
|
60
|
+
type: "cim",
|
|
61
|
+
data: {
|
|
62
|
+
type: "CIMSymbolReference",
|
|
63
|
+
primitiveOverrides: [
|
|
64
|
+
{
|
|
65
|
+
// 将textGraphic的TextString替换为graphic.attributes.name
|
|
66
|
+
type: "CIMPrimitiveOverride",
|
|
67
|
+
primitiveName: "textGraphic",
|
|
68
|
+
propertyName: "TextString",
|
|
69
|
+
valueExpressionInfo: {
|
|
70
|
+
type: "CIMExpressionInfo",
|
|
71
|
+
title: "Custom",
|
|
72
|
+
expression: "$feature.count",
|
|
73
|
+
returnType: "Default"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
symbol: {
|
|
78
|
+
type: "CIMPointSymbol",
|
|
79
|
+
symbolLayers: [
|
|
80
|
+
// 聚合数量
|
|
81
|
+
{
|
|
82
|
+
type: "CIMVectorMarker",
|
|
83
|
+
size: t,
|
|
84
|
+
colorLocked: !0,
|
|
85
|
+
anchorPointUnits: "Relative",
|
|
86
|
+
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
87
|
+
markerGraphics: [
|
|
88
|
+
// 数量文本框
|
|
89
|
+
{
|
|
90
|
+
type: "CIMMarkerGraphic",
|
|
91
|
+
geometry: {
|
|
92
|
+
rings: [
|
|
93
|
+
[
|
|
94
|
+
[-15, 40],
|
|
95
|
+
[15, 40],
|
|
96
|
+
[15, 20],
|
|
97
|
+
[-15, 20],
|
|
98
|
+
[-15, 40]
|
|
99
|
+
]
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
symbol: {
|
|
103
|
+
type: "CIMPolygonSymbol",
|
|
104
|
+
symbolLayers: [
|
|
105
|
+
{
|
|
106
|
+
type: "CIMSolidFill",
|
|
107
|
+
enable: !0,
|
|
108
|
+
color: [2, 72, 200, 255]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "CIMSolidStroke",
|
|
112
|
+
enable: !0,
|
|
113
|
+
width: 5,
|
|
114
|
+
color: [2, 72, 200, 128]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
// 数量文字
|
|
120
|
+
{
|
|
121
|
+
type: "CIMMarkerGraphic",
|
|
122
|
+
primitiveName: "textGraphic",
|
|
123
|
+
geometry: { x: 0, y: 0 },
|
|
124
|
+
symbol: {
|
|
125
|
+
type: "CIMTextSymbol",
|
|
126
|
+
height: 16,
|
|
127
|
+
horizontalAlignment: "Center",
|
|
128
|
+
offsetX: 0,
|
|
129
|
+
offsetY: 30,
|
|
130
|
+
symbol: {
|
|
131
|
+
type: "CIMPolygonSymbol",
|
|
132
|
+
symbolLayers: [
|
|
133
|
+
{
|
|
134
|
+
type: "CIMSolidFill",
|
|
135
|
+
enable: !0,
|
|
136
|
+
color: [255, 255, 255, 255]
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
verticalAlignment: "Center"
|
|
141
|
+
},
|
|
142
|
+
textString: ""
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
scaleSymbolsProportionally: !0,
|
|
146
|
+
respectFrame: !0
|
|
147
|
+
},
|
|
148
|
+
// 聚合图标
|
|
149
|
+
{
|
|
150
|
+
type: "CIMPictureMarker",
|
|
151
|
+
enable: !0,
|
|
152
|
+
anchorPoint: {
|
|
153
|
+
x: 0,
|
|
154
|
+
y: 0
|
|
155
|
+
},
|
|
156
|
+
anchorPointUnits: "Relative",
|
|
157
|
+
size: t,
|
|
158
|
+
rotateClockwise: !0,
|
|
159
|
+
textureFilter: "Picture",
|
|
160
|
+
url: this.clusterMarkUrl
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
this.clusterLayer.add(i);
|
|
168
|
+
} else
|
|
169
|
+
r.items.forEach((t) => {
|
|
170
|
+
const i = new m({
|
|
171
|
+
geometry: new a({ x: t.x, y: t.y }),
|
|
172
|
+
attributes: t.properties,
|
|
173
|
+
symbol: t.symbol
|
|
174
|
+
});
|
|
175
|
+
this.clusterLayer.add(i);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 获取邻居点
|
|
181
|
+
* @param locations
|
|
182
|
+
* @param index
|
|
183
|
+
* @param eps
|
|
184
|
+
* @returns
|
|
185
|
+
*/
|
|
186
|
+
getNeighbors(e, s, o) {
|
|
187
|
+
const r = e[s];
|
|
188
|
+
return e.filter((t) => t.id === r.id || t.visited ? !1 : this.getDistance(r, t) <= o);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 两点间的像素距离
|
|
192
|
+
* @param point1
|
|
193
|
+
* @param point2
|
|
194
|
+
* @returns
|
|
195
|
+
*/
|
|
196
|
+
getDistance(e, s) {
|
|
197
|
+
return Math.sqrt(
|
|
198
|
+
Math.pow(e.properties.screenX - s.properties.screenX, 2) + Math.pow(e.properties.screenY - s.properties.screenY, 2)
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* 从聚类结果中创建聚类对象
|
|
203
|
+
* @param locations
|
|
204
|
+
* @returns
|
|
205
|
+
*/
|
|
206
|
+
createClusters(e) {
|
|
207
|
+
const s = {}, o = [];
|
|
208
|
+
for (let t = 0; t < e.length; t++) {
|
|
209
|
+
const i = e[t];
|
|
210
|
+
i.clusterId === void 0 || i.clusterId === -1 ? o.push(i) : (s[i.clusterId] || (s[i.clusterId] = []), s[i.clusterId].push(i));
|
|
211
|
+
}
|
|
212
|
+
const r = Object.keys(s).map((t, i) => {
|
|
213
|
+
const l = s[Number(t)], n = l.length, h = l.reduce((c, u) => c + u.x, 0), y = l.reduce((c, u) => c + u.y, 0), p = h / n, d = y / n;
|
|
214
|
+
return {
|
|
215
|
+
id: Number(t),
|
|
216
|
+
items: l,
|
|
217
|
+
count: n,
|
|
218
|
+
center: {
|
|
219
|
+
x: p,
|
|
220
|
+
y: d
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
return o.length > 0 && r.push({
|
|
225
|
+
id: -1,
|
|
226
|
+
items: o,
|
|
227
|
+
count: o.length,
|
|
228
|
+
center: null
|
|
229
|
+
}), r;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* 按照像素距离聚类
|
|
233
|
+
* @param locations
|
|
234
|
+
* @param eps
|
|
235
|
+
* @param minPoints
|
|
236
|
+
* @returns
|
|
237
|
+
*/
|
|
238
|
+
doPixelCluster(e, s, o) {
|
|
239
|
+
let r = 0;
|
|
240
|
+
e.forEach((t) => t.visited = !1);
|
|
241
|
+
for (let t = 0; t < e.length; t++) {
|
|
242
|
+
const i = e[t];
|
|
243
|
+
if (i.visited)
|
|
244
|
+
continue;
|
|
245
|
+
i.visited = !0;
|
|
246
|
+
const l = this.getNeighbors(e, t, s);
|
|
247
|
+
l.length < o ? i.clusterId = -1 : (l.forEach((n) => {
|
|
248
|
+
n.visited = !0, n.clusterId = r;
|
|
249
|
+
}), i.clusterId = r, r++);
|
|
250
|
+
}
|
|
251
|
+
return this.createClusters(e);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
export {
|
|
255
|
+
M as default
|
|
256
|
+
};
|
|
@@ -24,6 +24,7 @@ export default class GreenWaveBandController {
|
|
|
24
24
|
addGreenWaveBand(params: IEditSignalControlAreaParams): void;
|
|
25
25
|
stopAddGreenWaveBand(): void;
|
|
26
26
|
showGreenWaveBand(params: IShowGreenWaveBandParams): Promise<void>;
|
|
27
|
+
removeGreenWaveBand(bandId: string): void;
|
|
27
28
|
/**
|
|
28
29
|
* 显示所有路口,进入待选状态
|
|
29
30
|
* @param nodeAttributes
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as y from "@arcgis/core/core/reactiveUtils.js";
|
|
2
|
-
import { Polyline as
|
|
2
|
+
import { Polyline as m } from "@arcgis/core/geometry";
|
|
3
3
|
import n from "@arcgis/core/Graphic";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import c from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
import b from "axios";
|
|
6
6
|
class w {
|
|
7
7
|
constructor(e) {
|
|
8
|
-
this.selectedNodeIds = [], this.nodeScale = 5e3, this.hasGpu = !1, this.hasGpu = localStorage.getItem("gpu") !== "Unknown", this.view = e, this.roadsectLayer = new
|
|
8
|
+
this.selectedNodeIds = [], this.nodeScale = 5e3, this.hasGpu = !1, this.hasGpu = localStorage.getItem("gpu") !== "Unknown", this.view = e, this.roadsectLayer = new c({
|
|
9
9
|
id: "roadsectLayer"
|
|
10
|
-
}), this.view.map.add(this.roadsectLayer), this.allNodesLayer = new
|
|
10
|
+
}), this.view.map.add(this.roadsectLayer), this.allNodesLayer = new c({
|
|
11
11
|
id: "allNodesLayer"
|
|
12
|
-
}), this.view.map.add(this.allNodesLayer), this.bandLayer = new
|
|
12
|
+
}), this.view.map.add(this.allNodesLayer), this.bandLayer = new c({
|
|
13
13
|
id: "bandLayer"
|
|
14
14
|
}), this.view.map.add(this.bandLayer);
|
|
15
15
|
}
|
|
@@ -27,23 +27,19 @@ class w {
|
|
|
27
27
|
(e = this.viewClickWatcher) == null || e.remove(), this.viewClickWatcher = void 0, this.allNodesLayer.removeAll(), this.selectedNodeIds = [], this.roadsectLayer.removeAll(), this.bandLayer.removeAll();
|
|
28
28
|
}
|
|
29
29
|
async showGreenWaveBand(e) {
|
|
30
|
-
this.
|
|
31
|
-
t.getAttribute("bandId") === e.bandId && this.bandLayer.remove(t);
|
|
32
|
-
}), this.roadsectLayer.graphics.forEach((t) => {
|
|
33
|
-
t.getAttribute("bandId") === e.bandId && this.roadsectLayer.remove(t);
|
|
34
|
-
}), this.scaleWatcher || (this.scaleWatcher = y.watch(
|
|
30
|
+
this.removeGreenWaveBand(e.bandId), this.scaleWatcher || (this.scaleWatcher = y.watch(
|
|
35
31
|
() => this.view.scale,
|
|
36
|
-
(
|
|
37
|
-
|
|
32
|
+
(s, o) => {
|
|
33
|
+
s > this.nodeScale && o <= this.nodeScale ? this.bandLayer.graphics.forEach((a) => {
|
|
38
34
|
a.geometry.type === "point" && (a.symbol = this.getShowNodeSymbol("marker"));
|
|
39
|
-
}) :
|
|
35
|
+
}) : s <= this.nodeScale && o > this.nodeScale && this.bandLayer.graphics.forEach((a) => {
|
|
40
36
|
a.geometry.type === "point" && (a.symbol = this.getShowNodeSymbol("picture"));
|
|
41
37
|
});
|
|
42
38
|
}
|
|
43
39
|
));
|
|
44
|
-
const i = new
|
|
40
|
+
const i = new m({
|
|
45
41
|
paths: [e.coordinates]
|
|
46
|
-
}),
|
|
42
|
+
}), t = new n({
|
|
47
43
|
geometry: i,
|
|
48
44
|
symbol: this.getLineSymbol(!0, e),
|
|
49
45
|
attributes: {
|
|
@@ -52,39 +48,47 @@ class w {
|
|
|
52
48
|
id: e.bandId
|
|
53
49
|
}
|
|
54
50
|
});
|
|
55
|
-
this.roadsectLayer.add(
|
|
56
|
-
const
|
|
51
|
+
this.roadsectLayer.add(t), await this.view.goTo(t), e.nodeList && e.nodeList.forEach((s) => {
|
|
52
|
+
const o = new n({
|
|
57
53
|
geometry: {
|
|
58
54
|
type: "point",
|
|
59
|
-
x:
|
|
60
|
-
y:
|
|
55
|
+
x: s.longitude,
|
|
56
|
+
y: s.latitude
|
|
61
57
|
},
|
|
62
58
|
symbol: this.getShowNodeSymbol("picture"),
|
|
63
59
|
attributes: {
|
|
64
|
-
...
|
|
60
|
+
...s,
|
|
65
61
|
bandId: e.bandId,
|
|
66
62
|
type: "greenWaveBandNode"
|
|
67
63
|
}
|
|
68
64
|
});
|
|
69
|
-
this.bandLayer.add(
|
|
65
|
+
this.bandLayer.add(o);
|
|
70
66
|
});
|
|
71
67
|
}
|
|
68
|
+
removeGreenWaveBand(e) {
|
|
69
|
+
let i = this.bandLayer.graphics.filter(
|
|
70
|
+
(t) => t.getAttribute("bandId") === e
|
|
71
|
+
);
|
|
72
|
+
this.bandLayer.removeMany(i.toArray()), i = this.roadsectLayer.graphics.filter(
|
|
73
|
+
(t) => t.getAttribute("bandId") === e
|
|
74
|
+
), this.roadsectLayer.removeMany(i.toArray());
|
|
75
|
+
}
|
|
72
76
|
/**
|
|
73
77
|
* 显示所有路口,进入待选状态
|
|
74
78
|
* @param nodeAttributes
|
|
75
79
|
*/
|
|
76
80
|
showAllNodes(e) {
|
|
77
81
|
const i = [];
|
|
78
|
-
e.forEach((
|
|
82
|
+
e.forEach((t) => {
|
|
79
83
|
i.push(
|
|
80
84
|
new n({
|
|
81
85
|
geometry: {
|
|
82
86
|
type: "point",
|
|
83
|
-
x:
|
|
84
|
-
y:
|
|
87
|
+
x: t.longitude,
|
|
88
|
+
y: t.latitude
|
|
85
89
|
},
|
|
86
90
|
symbol: this.getEditableNodeSymbol(!1),
|
|
87
|
-
attributes: { ...
|
|
91
|
+
attributes: { ...t, selected: !1 }
|
|
88
92
|
})
|
|
89
93
|
);
|
|
90
94
|
}), this.allNodesLayer.addMany(i);
|
|
@@ -96,50 +100,50 @@ class w {
|
|
|
96
100
|
*/
|
|
97
101
|
async handleViewClick(e) {
|
|
98
102
|
var a;
|
|
99
|
-
const
|
|
103
|
+
const t = (a = (await this.view.hitTest(e, {
|
|
100
104
|
include: [this.allNodesLayer]
|
|
101
105
|
})).results) == null ? void 0 : a.filter(
|
|
102
106
|
(d) => d.type === "graphic"
|
|
103
107
|
);
|
|
104
|
-
if (
|
|
108
|
+
if (t.length === 0)
|
|
105
109
|
return;
|
|
106
|
-
const
|
|
107
|
-
if (this.selectedNodeIds.includes(
|
|
108
|
-
const d = this.selectedNodeIds.indexOf(
|
|
110
|
+
const s = t[0].graphic, o = s.getAttribute("id");
|
|
111
|
+
if (this.selectedNodeIds.includes(o)) {
|
|
112
|
+
const d = this.selectedNodeIds.indexOf(o) + 1;
|
|
109
113
|
if (d === 1)
|
|
110
|
-
this.removeAllNodeCallback && this.removeAllNodeCallback(), this.selectedNodeIds = [], this.allNodesLayer.graphics.forEach((
|
|
111
|
-
|
|
114
|
+
this.removeAllNodeCallback && this.removeAllNodeCallback(), this.selectedNodeIds = [], this.allNodesLayer.graphics.forEach((r) => {
|
|
115
|
+
r.setAttribute("selected", !1), r.symbol = this.getEditableNodeSymbol(!1), r.visible = !0;
|
|
112
116
|
}), this.roadsectLayer.removeAll();
|
|
113
117
|
else {
|
|
114
|
-
for (let
|
|
118
|
+
for (let r = d; r < this.selectedNodeIds.length; r++) {
|
|
115
119
|
this.removeNodeCallback && this.removeNodeCallback({
|
|
116
|
-
id: this.selectedNodeIds[
|
|
120
|
+
id: this.selectedNodeIds[r]
|
|
117
121
|
});
|
|
118
122
|
for (let l = 0; l < this.roadsectLayer.graphics.length; l++) {
|
|
119
|
-
const
|
|
120
|
-
(
|
|
123
|
+
const h = this.roadsectLayer.graphics.getItemAt(l);
|
|
124
|
+
(h.getAttribute("id") === this.selectedNodeIds[r] || !h.getAttribute("selected")) && (this.roadsectLayer.remove(h), l--);
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
|
-
this.selectedNodeIds = this.selectedNodeIds.slice(0, d), this.allNodesLayer.graphics.forEach((
|
|
127
|
+
this.selectedNodeIds = this.selectedNodeIds.slice(0, d), this.allNodesLayer.graphics.forEach((r) => {
|
|
124
128
|
const l = this.selectedNodeIds.includes(
|
|
125
|
-
|
|
129
|
+
r.getAttribute("id")
|
|
126
130
|
);
|
|
127
|
-
|
|
128
|
-
}), await this.showDownstreamNodes(
|
|
131
|
+
r.setAttribute("selected", l), r.symbol = this.getEditableNodeSymbol(l), r.visible = l;
|
|
132
|
+
}), await this.showDownstreamNodes(o);
|
|
129
133
|
}
|
|
130
134
|
} else {
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
s.setAttribute("selected", !0), s.symbol = this.getEditableNodeSymbol(!0), this.selectedNodeIds.push(o), this.allNodesLayer.graphics.forEach((r) => {
|
|
136
|
+
r.visible = r.getAttribute("selected");
|
|
133
137
|
});
|
|
134
138
|
let d = [];
|
|
135
|
-
for (let
|
|
136
|
-
const l = this.roadsectLayer.graphics.getItemAt(
|
|
137
|
-
l.getAttribute("id") ===
|
|
139
|
+
for (let r = 0; r < this.roadsectLayer.graphics.length; r++) {
|
|
140
|
+
const l = this.roadsectLayer.graphics.getItemAt(r);
|
|
141
|
+
l.getAttribute("id") === o ? (l.symbol = this.getLineSymbol(!0), l.setAttribute("selected", !0), d = l.geometry.paths[0]) : l.getAttribute("selected") || (this.roadsectLayer.remove(l), r--);
|
|
138
142
|
}
|
|
139
143
|
this.addNodeCallback && this.addNodeCallback({
|
|
140
|
-
...
|
|
144
|
+
...s.attributes,
|
|
141
145
|
roadsect: d
|
|
142
|
-
}), await this.showDownstreamNodes(
|
|
146
|
+
}), await this.showDownstreamNodes(o);
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
/**
|
|
@@ -148,7 +152,7 @@ class w {
|
|
|
148
152
|
*/
|
|
149
153
|
async showDownstreamNodes(e) {
|
|
150
154
|
this.view.container.style.cursor = "progress";
|
|
151
|
-
const i = await
|
|
155
|
+
const i = await b.get(
|
|
152
156
|
`http://${this.openDriveServer}/api/computable/getDownstreamNodes`,
|
|
153
157
|
{ params: { nodeId: e } }
|
|
154
158
|
);
|
|
@@ -156,16 +160,16 @@ class w {
|
|
|
156
160
|
this.view.container.style.cursor = "default";
|
|
157
161
|
return;
|
|
158
162
|
}
|
|
159
|
-
i.data.result.forEach((
|
|
160
|
-
this.allNodesLayer.graphics.forEach((
|
|
161
|
-
if (
|
|
163
|
+
i.data.result.forEach((s) => {
|
|
164
|
+
this.allNodesLayer.graphics.forEach((o) => {
|
|
165
|
+
if (o.getAttribute("nodeId") === s.id && o.getAttribute("selected") === !1 && (o.visible = !0, s.coordinates)) {
|
|
162
166
|
const a = new n({
|
|
163
167
|
geometry: {
|
|
164
168
|
type: "polyline",
|
|
165
|
-
paths: [
|
|
169
|
+
paths: [s.coordinates]
|
|
166
170
|
},
|
|
167
171
|
symbol: this.getLineSymbol(!1),
|
|
168
|
-
attributes: { ...
|
|
172
|
+
attributes: { ...s, selected: !1 }
|
|
169
173
|
});
|
|
170
174
|
this.roadsectLayer.add(a);
|
|
171
175
|
}
|
|
@@ -174,8 +178,8 @@ class w {
|
|
|
174
178
|
}
|
|
175
179
|
getLineSymbol(e, i) {
|
|
176
180
|
if (e) {
|
|
177
|
-
const
|
|
178
|
-
return Array.isArray(
|
|
181
|
+
const t = (i == null ? void 0 : i.lineWidth) || 4, s = (i == null ? void 0 : i.lineColor) || [55, 125, 34, 255], o = (i == null ? void 0 : i.arrowColor) || [255, 255, 255, 255];
|
|
182
|
+
return Array.isArray(s) && s.length === 3 && s.push(255), Array.isArray(o) && o.length === 3 && o.push(255), {
|
|
179
183
|
type: "cim",
|
|
180
184
|
data: {
|
|
181
185
|
type: "CIMSymbolReference",
|
|
@@ -204,14 +208,14 @@ class w {
|
|
|
204
208
|
geometry: {
|
|
205
209
|
paths: [
|
|
206
210
|
[
|
|
207
|
-
[
|
|
208
|
-
[3 *
|
|
209
|
-
[
|
|
211
|
+
[t, -t],
|
|
212
|
+
[3 * t, 0],
|
|
213
|
+
[t, t]
|
|
210
214
|
],
|
|
211
215
|
[
|
|
212
|
-
[-
|
|
213
|
-
[-3 *
|
|
214
|
-
[-
|
|
216
|
+
[-t, t],
|
|
217
|
+
[-3 * t, 0],
|
|
218
|
+
[-t, -t]
|
|
215
219
|
]
|
|
216
220
|
]
|
|
217
221
|
},
|
|
@@ -222,7 +226,7 @@ class w {
|
|
|
222
226
|
type: "CIMSolidStroke",
|
|
223
227
|
enable: !0,
|
|
224
228
|
width: 1.5,
|
|
225
|
-
color:
|
|
229
|
+
color: o
|
|
226
230
|
}
|
|
227
231
|
]
|
|
228
232
|
}
|
|
@@ -232,8 +236,8 @@ class w {
|
|
|
232
236
|
{
|
|
233
237
|
type: "CIMSolidStroke",
|
|
234
238
|
enable: !0,
|
|
235
|
-
width:
|
|
236
|
-
color:
|
|
239
|
+
width: t,
|
|
240
|
+
color: s
|
|
237
241
|
}
|
|
238
242
|
]
|
|
239
243
|
}
|
|
@@ -2,7 +2,7 @@ import Graphic from '@arcgis/core/Graphic';
|
|
|
2
2
|
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
3
|
import MapView from '@arcgis/core/views/MapView';
|
|
4
4
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
-
import {
|
|
5
|
+
import { IClusterPointParams, IMaskParam, IOverlayParam, IResult } from '../../types';
|
|
6
6
|
interface IOverlayOptions {
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
@@ -73,13 +73,8 @@ export default class Overlay {
|
|
|
73
73
|
* @memberof Overlay
|
|
74
74
|
*/
|
|
75
75
|
showLayer(): void;
|
|
76
|
-
/**
|
|
77
|
-
* 添加点覆盖物
|
|
78
|
-
* @param overlay
|
|
79
|
-
* @param symbol
|
|
80
|
-
* @param properties
|
|
81
|
-
*/
|
|
82
|
-
addPoint(overlay: IOverlay, symbol: IPointSymbol, properties: any, visible?: boolean): IResult;
|
|
83
76
|
private addOverlay;
|
|
77
|
+
private clusterLayer;
|
|
78
|
+
addClusterPoint(params: IClusterPointParams): void;
|
|
84
79
|
}
|
|
85
80
|
export {};
|