gisviewer-vue3-arcgis 1.0.258 → 1.0.262

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.
Files changed (27) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +9 -1
  2. package/es/src/gis-map/gis-map.vue.mjs +96 -88
  3. package/es/src/gis-map/index.d.ts +8 -0
  4. package/es/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  5. package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
  6. package/es/src/gis-map/utils/dbscan-cluster/index.mjs +67 -76
  7. package/es/src/gis-map/utils/map-initializer.mjs +1 -1
  8. package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +2 -1
  9. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +369 -328
  10. package/es/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +51 -1
  11. package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +401 -20
  12. package/es/src/gis-map/utils/signal-control-area/show-area.mjs +23 -17
  13. package/es/src/types/index.d.ts +5 -0
  14. package/lib/src/gis-map/gis-map.vue.d.ts +9 -1
  15. package/lib/src/gis-map/gis-map.vue.js +1 -1
  16. package/lib/src/gis-map/index.d.ts +8 -0
  17. package/lib/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  18. package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
  19. package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -1
  20. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  21. package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +2 -1
  22. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  23. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.d.ts +51 -1
  24. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -1
  25. package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
  26. package/lib/src/types/index.d.ts +5 -0
  27. package/package.json +1 -1
@@ -1,20 +1,19 @@
1
- import * as f from "@arcgis/core/core/reactiveUtils";
2
1
  import { Point as h } from "@arcgis/core/geometry";
3
2
  import m from "@arcgis/core/Graphic";
4
- import b from "@arcgis/core/layers/GraphicsLayer";
5
- class I {
3
+ import p from "@arcgis/core/layers/GraphicsLayer";
4
+ class S {
6
5
  constructor(t) {
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);
6
+ this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.clusterRadius = 120, this.minClusterPoints = 2, this.zoomWatchHandle = null, this.locations = [], this.clusteredLocations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = t, this.currentZoom = t.zoom, this.clusterLayer = new p(), this.view.map.add(this.clusterLayer);
8
7
  }
9
8
  /**
10
9
  * 将地理位置转换为屏幕坐标
11
10
  */
12
11
  locationToScreen() {
13
- this.locations.forEach((t) => {
14
- const r = this.view.toScreen(
12
+ this.clusteredLocations = [], this.locations.forEach((t) => {
13
+ const s = this.view.toScreen(
15
14
  new h({ x: t.x, y: t.y })
16
15
  );
17
- t.properties.screenX = r.x, t.properties.screenY = r.y;
16
+ s.x > 0 && s.y > 0 && (t.properties.screenX = s.x, t.properties.screenY = s.y, t.visited = !1, t.clusterId = void 0, this.clusteredLocations.push(t));
18
17
  });
19
18
  }
20
19
  /**
@@ -22,8 +21,8 @@ class I {
22
21
  * @param params
23
22
  */
24
23
  addClusterPoints(t) {
25
- var i;
26
- this.locations = t.points, this.clusterMarkUrl = ((i = t.clusterSymbol) == null ? void 0 : i.url) || "/GisViewerAssets/Images/cross/gis_xhj_blue.png", this.locations = this.locations.filter((e) => e.x !== null && e.y !== null && !isNaN(e.x) && !isNaN(e.y)), this.locations.forEach((e) => {
24
+ var r;
25
+ this.locations = t.points, this.clusterMarkUrl = ((r = t.clusterSymbol) == null ? void 0 : r.url) || "/GisViewerAssets/Images/cross/gis_xhj_blue.png", this.locations = this.locations.filter((e) => e.x !== null && e.y !== null && !isNaN(e.x) && !isNaN(e.y)), this.locations.forEach((e) => {
27
26
  e.x = Number(e.x), e.y = Number(e.y), e.symbol || (e.symbol = t.pointSymbol || {
28
27
  type: "simple-marker",
29
28
  style: "circle",
@@ -34,24 +33,21 @@ class I {
34
33
  width: 1
35
34
  }
36
35
  });
37
- }), this.zoomWatchHandle || (this.zoomWatchHandle = f.watch(
38
- () => this.view.zoom,
39
- () => {
40
- if (Math.abs(this.currentZoom - this.view.zoom) >= 1) {
41
- this.currentZoom = this.view.zoom, this.locationToScreen(), console.time("cluster");
42
- const e = this.doPixelCluster(
43
- this.clusterRadius,
44
- this.minClusterPoints
45
- );
46
- console.timeEnd("cluster"), this.showClusters(e);
47
- }
36
+ }), this.zoomWatchHandle || (this.zoomWatchHandle = this.view.watch("stationary", () => {
37
+ if (Math.abs(this.currentZoom - this.view.zoom) >= 1) {
38
+ this.currentZoom = this.view.zoom, this.locationToScreen(), console.time("cluster");
39
+ const e = this.doPixelCluster(
40
+ this.clusterRadius,
41
+ this.minClusterPoints
42
+ );
43
+ console.timeEnd("cluster"), this.showClusters(e);
48
44
  }
49
- )), this.locationToScreen();
50
- const r = this.doPixelCluster(
45
+ })), this.locationToScreen();
46
+ const s = this.doPixelCluster(
51
47
  this.clusterRadius,
52
48
  this.minClusterPoints
53
49
  );
54
- this.showClusters(r);
50
+ this.showClusters(s);
55
51
  }
56
52
  removeAllClusterPoints() {
57
53
  var t;
@@ -59,14 +55,14 @@ class I {
59
55
  }
60
56
  showClusters(t) {
61
57
  this.clusterLayer.removeAll();
62
- let r = Number.MIN_VALUE, i = Number.MAX_VALUE;
58
+ let s = Number.MIN_VALUE, r = Number.MAX_VALUE;
63
59
  t.forEach((e) => {
64
- e.count > 1 && (i = Math.min(i, e.count), r = Math.max(r, e.count));
60
+ e.count > 1 && (r = Math.min(r, e.count), s = Math.max(s, e.count));
65
61
  }), t.forEach((e) => {
66
62
  if (e.id !== -1) {
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;
69
- const l = (e.count.toString().length * 8 + 6) / 2, c = new m({
63
+ let i = r === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (e.count - r) / (s - r) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
64
+ i *= 0.75;
65
+ const n = (e.count.toString().length * 8 + 6) / 2, c = new m({
70
66
  geometry: new h({ x: e.center.x, y: e.center.y }),
71
67
  attributes: {
72
68
  count: e.count
@@ -95,7 +91,7 @@ class I {
95
91
  // 聚合数量
96
92
  {
97
93
  type: "CIMVectorMarker",
98
- size: s,
94
+ size: i,
99
95
  colorLocked: !0,
100
96
  anchorPointUnits: "Relative",
101
97
  frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
@@ -106,11 +102,11 @@ class I {
106
102
  geometry: {
107
103
  rings: [
108
104
  [
109
- [-l, 40],
110
- [l, 40],
111
- [l, 20],
112
- [-l, 20],
113
- [-l, 40]
105
+ [-n, 40],
106
+ [n, 40],
107
+ [n, 20],
108
+ [-n, 20],
109
+ [-n, 40]
114
110
  ]
115
111
  ]
116
112
  },
@@ -169,7 +165,7 @@ class I {
169
165
  y: 0
170
166
  },
171
167
  anchorPointUnits: "Relative",
172
- size: s,
168
+ size: i,
173
169
  rotateClockwise: !0,
174
170
  textureFilter: "Picture",
175
171
  url: this.clusterMarkUrl
@@ -181,16 +177,16 @@ class I {
181
177
  });
182
178
  this.clusterLayer.add(c);
183
179
  } else
184
- e.items.forEach((s) => {
180
+ e.items.forEach((i) => {
185
181
  const o = new m({
186
- geometry: new h({ x: s.x, y: s.y }),
182
+ geometry: new h({ x: i.x, y: i.y }),
187
183
  attributes: {
188
- ...s,
189
- ...s.properties,
184
+ ...i,
185
+ ...i.properties,
190
186
  type: "clusterPoint",
191
- id: s.id
187
+ id: i.id
192
188
  },
193
- symbol: s.symbol
189
+ symbol: i.symbol
194
190
  });
195
191
  this.clusterLayer.add(o);
196
192
  });
@@ -203,8 +199,8 @@ class I {
203
199
  * @param eps
204
200
  * @returns
205
201
  */
206
- getNeighbors(t, r) {
207
- return this.locations.filter((i) => i.id === t.id || i.visited ? !1 : this.getDistance(t, i) <= r);
202
+ getNeighbors(t, s) {
203
+ return this.clusteredLocations.filter((r) => r.id === t.id || r.visited ? !1 : this.getDistance(t, r) <= s);
208
204
  }
209
205
  /**
210
206
  * 两点间的像素距离
@@ -212,9 +208,9 @@ class I {
212
208
  * @param point2
213
209
  * @returns
214
210
  */
215
- getDistance(t, r) {
211
+ getDistance(t, s) {
216
212
  return Math.sqrt(
217
- Math.pow(t.properties.screenX - r.properties.screenX, 2) + Math.pow(t.properties.screenY - r.properties.screenY, 2)
213
+ Math.pow(t.properties.screenX - s.properties.screenX, 2) + Math.pow(t.properties.screenY - s.properties.screenY, 2)
218
214
  );
219
215
  }
220
216
  /**
@@ -222,30 +218,28 @@ class I {
222
218
  * @param locations
223
219
  * @returns
224
220
  */
225
- createClusters(t) {
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));
230
- }
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;
221
+ createClusters() {
222
+ const t = {}, s = [];
223
+ for (const e of this.clusteredLocations)
224
+ e.clusterId === void 0 || e.clusterId === -1 ? s.push(e) : (t[e.clusterId] || (t[e.clusterId] = []), t[e.clusterId].push(e));
225
+ const r = Object.keys(t).map((e, i) => {
226
+ const o = t[Number(e)], l = o.length, n = o.reduce((u, a) => u + a.x, 0), c = o.reduce((u, a) => u + a.y, 0), y = n / l, d = c / l;
233
227
  return {
234
- id: Number(s),
235
- items: n,
228
+ id: Number(e),
229
+ items: o,
236
230
  count: l,
237
231
  center: {
238
- x: d,
239
- y: p
232
+ x: y,
233
+ y: d
240
234
  }
241
235
  };
242
236
  });
243
- return i.length > 0 && e.push({
237
+ return s.length > 0 && r.push({
244
238
  id: -1,
245
- items: i,
246
- count: i.length,
239
+ items: s,
240
+ count: s.length,
247
241
  center: null
248
- }), e;
242
+ }), r;
249
243
  }
250
244
  /**
251
245
  * 按照像素距离聚类
@@ -254,24 +248,21 @@ class I {
254
248
  * @param minPoints
255
249
  * @returns
256
250
  */
257
- doPixelCluster(t, r) {
258
- let i = 0;
259
- this.locations.forEach((e) => {
260
- e.visited = !1, e.clusterId = void 0;
261
- });
262
- for (let e = 0; e < this.locations.length; e++) {
263
- const s = this.locations[e];
264
- if (s.visited)
251
+ doPixelCluster(t, s) {
252
+ let r = 0;
253
+ for (let e = 0; e < this.clusteredLocations.length; e++) {
254
+ const i = this.clusteredLocations[e];
255
+ if (i.visited)
265
256
  continue;
266
- s.visited = !0;
267
- const o = this.getNeighbors(s, t);
268
- o.length < r ? s.clusterId = -1 : (o.forEach((n) => {
269
- n.visited = !0, n.clusterId = i;
270
- }), s.clusterId = i, i++);
257
+ i.visited = !0;
258
+ const o = this.getNeighbors(i, t);
259
+ o.length < s ? i.clusterId = -1 : (o.forEach((l) => {
260
+ l.visited = !0, l.clusterId = r;
261
+ }), i.clusterId = r, r++);
271
262
  }
272
- return this.createClusters(this.locations);
263
+ return this.createClusters();
273
264
  }
274
265
  }
275
266
  export {
276
- I as default
267
+ S as default
277
268
  };
@@ -242,7 +242,7 @@ class me {
242
242
  async setLayerVisibility(e) {
243
243
  const { id: i, visible: s } = e;
244
244
  if (i === "shanghai_district")
245
- return !this.detachmentLayerLoaded && e.visible ? await this.loadDetachmentLayer() : this.detachmentLayer.visible = s, { status: 0, message: "ok" };
245
+ return !this.detachmentLayerLoaded && e.visible ? await this.loadDetachmentLayer() : this.detachmentLayer && (this.detachmentLayer.visible = s), { status: 0, message: "ok" };
246
246
  {
247
247
  const a = this.view.map.findLayerById(i);
248
248
  return a ? (a.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
@@ -1,4 +1,4 @@
1
- import { IFindSumoParams, IResult, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IUnselectSumoParams } from '../../../types';
1
+ import { IBlockOpenDriveLaneParams, IFindSumoParams, IResult, IShowOpenDriveFromFileParams, ISplitOpenDriveLaneParams, IUnselectSumoParams } from '../../../types';
2
2
  export default class OpenDriveRenderer {
3
3
  private static instance;
4
4
  static getInstance(view: __esri.MapView | __esri.SceneView): OpenDriveRenderer;
@@ -113,6 +113,7 @@ export default class OpenDriveRenderer {
113
113
  selectSumo(params: IFindSumoParams): Promise<IResult>;
114
114
  geometrySearch(coordinate: number[][]): Promise<IResult>;
115
115
  splitLane(params: ISplitOpenDriveLaneParams): Promise<IResult>;
116
+ blockOpenDriveLane(params: IBlockOpenDriveLaneParams): void;
116
117
  clearSplitLane(): void;
117
118
  /**
118
119
  * 更新所有路口的symbol