gisviewer-vue3-arcgis 1.0.254 → 1.0.255
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 +3 -1
- package/es/src/gis-map/gis-map.vue.mjs +175 -173
- package/es/src/gis-map/index.d.ts +3 -1
- package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +4 -2
- package/es/src/gis-map/utils/dbscan-cluster/index.mjs +42 -36
- package/es/src/gis-map/utils/map-initializer.d.ts +10 -1
- package/es/src/gis-map/utils/map-initializer.mjs +181 -111
- package/es/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +9 -0
- package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +145 -0
- package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +51 -35
- package/es/src/gis-map/utils/signal-control-area/show-area.d.ts +3 -8
- package/es/src/gis-map/utils/signal-control-area/show-area.mjs +63 -105
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +1 -1
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +5 -5
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +84 -83
- package/es/src/types/index.d.ts +1 -1
- package/lib/src/gis-map/gis-map.vue.d.ts +3 -1
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +3 -1
- package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +4 -2
- package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.d.ts +10 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +9 -0
- package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -0
- package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/show-area.d.ts +3 -8
- 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 +1 -1
- 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.js +1 -1
- package/lib/src/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,17 +4,17 @@ import m from "@arcgis/core/Graphic";
|
|
|
4
4
|
import b from "@arcgis/core/layers/GraphicsLayer";
|
|
5
5
|
class I {
|
|
6
6
|
constructor(t) {
|
|
7
|
-
this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = t, this.currentZoom = t.zoom, this.clusterLayer = new b(), this.view.map.add(this.clusterLayer);
|
|
7
|
+
this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.clusterRadius = 120, this.minClusterPoints = 2, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = t, this.currentZoom = t.zoom, this.clusterLayer = new b(), this.view.map.add(this.clusterLayer);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* 将地理位置转换为屏幕坐标
|
|
11
11
|
*/
|
|
12
12
|
locationToScreen() {
|
|
13
13
|
this.locations.forEach((t) => {
|
|
14
|
-
const
|
|
14
|
+
const r = this.view.toScreen(
|
|
15
15
|
new h({ x: t.x, y: t.y })
|
|
16
16
|
);
|
|
17
|
-
t.properties.screenX =
|
|
17
|
+
t.properties.screenX = r.x, t.properties.screenY = r.y;
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -39,13 +39,19 @@ class I {
|
|
|
39
39
|
() => {
|
|
40
40
|
if (Math.abs(this.currentZoom - this.view.zoom) >= 1) {
|
|
41
41
|
this.currentZoom = this.view.zoom, this.locationToScreen(), console.time("cluster");
|
|
42
|
-
const e = this.doPixelCluster(
|
|
42
|
+
const e = this.doPixelCluster(
|
|
43
|
+
this.clusterRadius,
|
|
44
|
+
this.minClusterPoints
|
|
45
|
+
);
|
|
43
46
|
console.timeEnd("cluster"), this.showClusters(e);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
)), this.locationToScreen();
|
|
47
|
-
const
|
|
48
|
-
|
|
50
|
+
const r = this.doPixelCluster(
|
|
51
|
+
this.clusterRadius,
|
|
52
|
+
this.minClusterPoints
|
|
53
|
+
);
|
|
54
|
+
this.showClusters(r);
|
|
49
55
|
}
|
|
50
56
|
removeAllClusterPoints() {
|
|
51
57
|
var t;
|
|
@@ -53,13 +59,13 @@ class I {
|
|
|
53
59
|
}
|
|
54
60
|
showClusters(t) {
|
|
55
61
|
this.clusterLayer.removeAll();
|
|
56
|
-
let
|
|
62
|
+
let r = Number.MIN_VALUE, i = Number.MAX_VALUE;
|
|
57
63
|
t.forEach((e) => {
|
|
58
|
-
e.count > 1 && (i = Math.min(i, e.count),
|
|
64
|
+
e.count > 1 && (i = Math.min(i, e.count), r = Math.max(r, e.count));
|
|
59
65
|
}), t.forEach((e) => {
|
|
60
66
|
if (e.id !== -1) {
|
|
61
|
-
let
|
|
62
|
-
|
|
67
|
+
let s = i === r ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (e.count - i) / (r - i) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
|
|
68
|
+
s *= 0.75;
|
|
63
69
|
const l = (e.count.toString().length * 8 + 6) / 2, c = new m({
|
|
64
70
|
geometry: new h({ x: e.center.x, y: e.center.y }),
|
|
65
71
|
attributes: {
|
|
@@ -89,7 +95,7 @@ class I {
|
|
|
89
95
|
// 聚合数量
|
|
90
96
|
{
|
|
91
97
|
type: "CIMVectorMarker",
|
|
92
|
-
size:
|
|
98
|
+
size: s,
|
|
93
99
|
colorLocked: !0,
|
|
94
100
|
anchorPointUnits: "Relative",
|
|
95
101
|
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
@@ -163,7 +169,7 @@ class I {
|
|
|
163
169
|
y: 0
|
|
164
170
|
},
|
|
165
171
|
anchorPointUnits: "Relative",
|
|
166
|
-
size:
|
|
172
|
+
size: s,
|
|
167
173
|
rotateClockwise: !0,
|
|
168
174
|
textureFilter: "Picture",
|
|
169
175
|
url: this.clusterMarkUrl
|
|
@@ -175,15 +181,16 @@ class I {
|
|
|
175
181
|
});
|
|
176
182
|
this.clusterLayer.add(c);
|
|
177
183
|
} else
|
|
178
|
-
e.items.forEach((
|
|
184
|
+
e.items.forEach((s) => {
|
|
179
185
|
const o = new m({
|
|
180
|
-
geometry: new h({ x:
|
|
186
|
+
geometry: new h({ x: s.x, y: s.y }),
|
|
181
187
|
attributes: {
|
|
182
|
-
...
|
|
188
|
+
...s,
|
|
189
|
+
...s.properties,
|
|
183
190
|
type: "clusterPoint",
|
|
184
|
-
id:
|
|
191
|
+
id: s.id
|
|
185
192
|
},
|
|
186
|
-
symbol:
|
|
193
|
+
symbol: s.symbol
|
|
187
194
|
});
|
|
188
195
|
this.clusterLayer.add(o);
|
|
189
196
|
});
|
|
@@ -196,9 +203,8 @@ class I {
|
|
|
196
203
|
* @param eps
|
|
197
204
|
* @returns
|
|
198
205
|
*/
|
|
199
|
-
getNeighbors(t,
|
|
200
|
-
|
|
201
|
-
return t.filter((r) => r.id === e.id || r.visited ? !1 : this.getDistance(e, r) <= i);
|
|
206
|
+
getNeighbors(t, r) {
|
|
207
|
+
return this.locations.filter((i) => i.id === t.id || i.visited ? !1 : this.getDistance(t, i) <= r);
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
210
|
* 两点间的像素距离
|
|
@@ -206,9 +212,9 @@ class I {
|
|
|
206
212
|
* @param point2
|
|
207
213
|
* @returns
|
|
208
214
|
*/
|
|
209
|
-
getDistance(t,
|
|
215
|
+
getDistance(t, r) {
|
|
210
216
|
return Math.sqrt(
|
|
211
|
-
Math.pow(t.properties.screenX -
|
|
217
|
+
Math.pow(t.properties.screenX - r.properties.screenX, 2) + Math.pow(t.properties.screenY - r.properties.screenY, 2)
|
|
212
218
|
);
|
|
213
219
|
}
|
|
214
220
|
/**
|
|
@@ -217,15 +223,15 @@ class I {
|
|
|
217
223
|
* @returns
|
|
218
224
|
*/
|
|
219
225
|
createClusters(t) {
|
|
220
|
-
const
|
|
221
|
-
for (let
|
|
222
|
-
const o = t[
|
|
223
|
-
o.clusterId === void 0 || o.clusterId === -1 ? i.push(o) : (
|
|
226
|
+
const r = {}, i = [];
|
|
227
|
+
for (let s = 0; s < t.length; s++) {
|
|
228
|
+
const o = t[s];
|
|
229
|
+
o.clusterId === void 0 || o.clusterId === -1 ? i.push(o) : (r[o.clusterId] || (r[o.clusterId] = []), r[o.clusterId].push(o));
|
|
224
230
|
}
|
|
225
|
-
const e = Object.keys(
|
|
226
|
-
const n =
|
|
231
|
+
const e = Object.keys(r).map((s, o) => {
|
|
232
|
+
const n = r[Number(s)], l = n.length, c = n.reduce((a, u) => a + u.x, 0), y = n.reduce((a, u) => a + u.y, 0), d = c / l, p = y / l;
|
|
227
233
|
return {
|
|
228
|
-
id: Number(
|
|
234
|
+
id: Number(s),
|
|
229
235
|
items: n,
|
|
230
236
|
count: l,
|
|
231
237
|
center: {
|
|
@@ -248,20 +254,20 @@ class I {
|
|
|
248
254
|
* @param minPoints
|
|
249
255
|
* @returns
|
|
250
256
|
*/
|
|
251
|
-
doPixelCluster(t,
|
|
257
|
+
doPixelCluster(t, r) {
|
|
252
258
|
let i = 0;
|
|
253
259
|
this.locations.forEach((e) => {
|
|
254
260
|
e.visited = !1, e.clusterId = void 0;
|
|
255
261
|
});
|
|
256
262
|
for (let e = 0; e < this.locations.length; e++) {
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
263
|
+
const s = this.locations[e];
|
|
264
|
+
if (s.visited)
|
|
259
265
|
continue;
|
|
260
|
-
|
|
261
|
-
const o = this.getNeighbors(
|
|
262
|
-
o.length <
|
|
266
|
+
s.visited = !0;
|
|
267
|
+
const o = this.getNeighbors(s, t);
|
|
268
|
+
o.length < r ? s.clusterId = -1 : (o.forEach((n) => {
|
|
263
269
|
n.visited = !0, n.clusterId = i;
|
|
264
|
-
}),
|
|
270
|
+
}), s.clusterId = i, i++);
|
|
265
271
|
}
|
|
266
272
|
return this.createClusters(this.locations);
|
|
267
273
|
}
|
|
@@ -16,7 +16,7 @@ export default class MapInitializer {
|
|
|
16
16
|
markerClickCallback?: (type: string, id: string, detail: any, event?: any) => void;
|
|
17
17
|
mapClickCallback?: (mapPoint: number[], screenPoint: number[], event?: any) => void;
|
|
18
18
|
}): Promise<MapView | SceneView>;
|
|
19
|
-
setLayerVisibility(params: ILayerVisibleParams): IResult
|
|
19
|
+
setLayerVisibility(params: ILayerVisibleParams): Promise<IResult>;
|
|
20
20
|
/**
|
|
21
21
|
* 设置地图中心点
|
|
22
22
|
* @param params
|
|
@@ -53,4 +53,13 @@ export default class MapInitializer {
|
|
|
53
53
|
min?: number;
|
|
54
54
|
max?: number;
|
|
55
55
|
}): void;
|
|
56
|
+
/** 支队图层 */
|
|
57
|
+
private detachmentLayer;
|
|
58
|
+
private detachmentLayerLoaded;
|
|
59
|
+
/**
|
|
60
|
+
* 加载支队图层
|
|
61
|
+
* 现场环境用url创建FeatureLayer有各种问题,
|
|
62
|
+
* 改为图层导出为json,用json创建Graphic,再将Graphic添加到FeatureLayer
|
|
63
|
+
*/
|
|
64
|
+
private loadDetachmentLayer;
|
|
56
65
|
}
|