gisviewer-vue3-arcgis 1.0.265 → 1.0.267

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 (26) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +10 -3
  2. package/es/src/gis-map/gis-map.vue.mjs +177 -174
  3. package/es/src/gis-map/index.d.ts +8 -2
  4. package/es/src/gis-map/utils/map-initializer.mjs +86 -79
  5. package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +6 -1
  6. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +15 -12
  7. package/es/src/gis-map/utils/signal-control-area/cross-renderer.mjs +101 -45
  8. package/es/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
  9. package/es/src/gis-map/utils/signal-control-area/{show-area.mjs → signal-area-controller.mjs} +11 -11
  10. package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
  11. package/es/src/gis-map/utils/signal-control-area/signal-cross-controller.mjs +193 -0
  12. package/es/src/types/index.d.ts +15 -0
  13. package/lib/src/gis-map/gis-map.vue.d.ts +10 -3
  14. package/lib/src/gis-map/gis-map.vue.js +1 -1
  15. package/lib/src/gis-map/index.d.ts +8 -2
  16. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  17. package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +6 -1
  18. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  19. package/lib/src/gis-map/utils/signal-control-area/cross-renderer.js +1 -1
  20. package/lib/src/gis-map/utils/signal-control-area/{show-area.d.ts → signal-area-controller.d.ts} +3 -0
  21. package/lib/src/gis-map/utils/signal-control-area/signal-area-controller.js +1 -0
  22. package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.d.ts +24 -0
  23. package/lib/src/gis-map/utils/signal-control-area/signal-cross-controller.js +1 -0
  24. package/lib/src/types/index.d.ts +15 -0
  25. package/package.json +1 -1
  26. package/lib/src/gis-map/utils/signal-control-area/show-area.js +0 -1
@@ -1,12 +1,12 @@
1
1
  import L from "@arcgis/core/Basemap";
2
2
  import v from "@arcgis/core/config";
3
3
  import * as M from "@arcgis/core/core/reactiveUtils";
4
- import { Multipoint as z, Polygon as k, Polyline as W, Point as T } from "@arcgis/core/geometry";
4
+ import { Multipoint as W, Polygon as k, Polyline as I, Point as T } from "@arcgis/core/geometry";
5
5
  import * as b from "@arcgis/core/geometry/support/webMercatorUtils";
6
- import { webMercatorToGeographic as I } from "@arcgis/core/geometry/support/webMercatorUtils";
6
+ import { webMercatorToGeographic as G } from "@arcgis/core/geometry/support/webMercatorUtils";
7
7
  import C from "@arcgis/core/Graphic";
8
- import G from "@arcgis/core/layers/FeatureLayer";
9
- import x from "@arcgis/core/layers/GeoJSONLayer";
8
+ import x from "@arcgis/core/layers/FeatureLayer";
9
+ import P from "@arcgis/core/layers/GeoJSONLayer";
10
10
  import S from "@arcgis/core/layers/GroupLayer";
11
11
  import H from "@arcgis/core/layers/IntegratedMesh3DTilesLayer";
12
12
  import B from "@arcgis/core/layers/MapImageLayer";
@@ -15,9 +15,9 @@ import R from "@arcgis/core/layers/WebTileLayer";
15
15
  import E from "@arcgis/core/layers/WMSLayer";
16
16
  import N from "@arcgis/core/Map";
17
17
  import A from "@arcgis/core/views/MapView";
18
- import U from "@arcgis/core/views/SceneView";
19
- import V from "@turf/destination";
20
- import * as j from "@turf/helpers";
18
+ import j from "@arcgis/core/views/SceneView";
19
+ import U from "@turf/destination";
20
+ import * as V from "@turf/helpers";
21
21
  import D from "@arcgis/core/layers/GraphicsLayer";
22
22
  import J from "./custom-layer/custom-wmts-layer.mjs";
23
23
  class me {
@@ -35,7 +35,7 @@ class me {
35
35
  async initialize(e) {
36
36
  var p, u, g, f;
37
37
  this.mapConfig = e.mapConfig;
38
- const { container: i, markerClickCallback: s, mapClickCallback: a } = e;
38
+ const { container: i, markerClickCallback: s, mapClickCallback: r } = e;
39
39
  v.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, v.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, v.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
40
40
  const o = new N();
41
41
  ((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new A({
@@ -44,7 +44,7 @@ class me {
44
44
  ...this.mapConfig.mapOptions
45
45
  }), this.view.on("drag", (t) => {
46
46
  t.button === 2 && t.stopPropagation();
47
- })) : this.view = new U({
47
+ })) : this.view = new j({
48
48
  map: o,
49
49
  container: i,
50
50
  environment: {
@@ -64,46 +64,46 @@ class me {
64
64
  breakpoint: !1
65
65
  }, this.view.on("click", async (t) => {
66
66
  var h, y;
67
- if (a) {
68
- let n = t.mapPoint;
69
- n.spatialReference.isWebMercator && (n = b.webMercatorToGeographic(
70
- n
71
- )), a(
72
- [n.x, n.y],
67
+ if (r) {
68
+ let c = t.mapPoint;
69
+ c.spatialReference.isWebMercator && (c = b.webMercatorToGeographic(
70
+ c
71
+ )), r(
72
+ [c.x, c.y],
73
73
  [t.screenPoint.x, t.screenPoint.y],
74
74
  t
75
75
  );
76
76
  }
77
77
  if (this.view.type === "3d") {
78
- const n = this.view.camera;
78
+ const c = this.view.camera;
79
79
  if (this.view.spatialReference.isWebMercator) {
80
80
  const w = b.webMercatorToGeographic(
81
- n.position
81
+ c.position
82
82
  ), d = {
83
- heading: n.heading,
84
- tilt: n.tilt,
83
+ heading: c.heading,
84
+ tilt: c.tilt,
85
85
  position: w.toJSON()
86
86
  };
87
87
  console.log(d), (h = navigator.clipboard) == null || h.writeText(JSON.stringify(d));
88
88
  } else
89
- console.log(n.toJSON());
89
+ console.log(c.toJSON());
90
90
  console.log(this.view.zoom, this.view.scale);
91
91
  } else {
92
- let n = this.view.center;
93
- this.view.spatialReference.isWebMercator && (n = b.webMercatorToGeographic(
94
- n
92
+ let c = this.view.center;
93
+ this.view.spatialReference.isWebMercator && (c = b.webMercatorToGeographic(
94
+ c
95
95
  )), console.log({
96
- center: n.toJSON(),
96
+ center: c.toJSON(),
97
97
  zoom: this.view.zoom,
98
98
  scale: this.view.scale
99
99
  });
100
100
  }
101
- const c = (y = (await this.view.hitTest(t)).results) == null ? void 0 : y.filter(
102
- (n) => n.type === "graphic"
101
+ const n = (y = (await this.view.hitTest(t)).results) == null ? void 0 : y.filter(
102
+ (c) => c.type === "graphic"
103
103
  );
104
- c.length > 0 && c.forEach((n) => {
104
+ n.length > 0 && n.forEach((c) => {
105
105
  var d;
106
- const w = n.graphic;
106
+ const w = c.graphic;
107
107
  (d = w.attributes) != null && d.type && s && s(
108
108
  w.attributes.type,
109
109
  w.attributes.id,
@@ -113,19 +113,19 @@ class me {
113
113
  });
114
114
  });
115
115
  {
116
- let t = 0, r = !1;
117
- this.view.on("pointer-move", async (c) => {
116
+ let t = 0, a = !1;
117
+ this.view.on("pointer-move", async (n) => {
118
118
  var y;
119
119
  const h = performance.now();
120
- if (!(r || h - t < 100)) {
121
- t = h, r = !0;
120
+ if (!(a || h - t < 100)) {
121
+ t = h, a = !0;
122
122
  try {
123
- const w = (y = (await this.view.hitTest(c)).results) == null ? void 0 : y.some(
124
- (P) => P.type === "graphic"
123
+ const w = (y = (await this.view.hitTest(n)).results) == null ? void 0 : y.some(
124
+ (z) => z.type === "graphic"
125
125
  ), d = this.view.container;
126
126
  d && (d.style.cursor = w ? "pointer" : "default");
127
127
  } finally {
128
- r = !1;
128
+ a = !1;
129
129
  }
130
130
  }
131
131
  });
@@ -134,33 +134,33 @@ class me {
134
134
  const t = this.view.container;
135
135
  t && (t.style.cursor = "default");
136
136
  }), (g = this.mapConfig) != null && g.baseLayers ? this.mapConfig.baseLayers.forEach((t) => {
137
- const r = this.processUrl(t.url);
138
- let c = null;
137
+ const a = this.processUrl(t.url);
138
+ let n = null;
139
139
  switch (t.type.toLowerCase()) {
140
140
  case "webTile".toLowerCase(): {
141
- c = new R({
142
- urlTemplate: r,
141
+ n = new R({
142
+ urlTemplate: a,
143
143
  ...t.options
144
144
  });
145
145
  break;
146
146
  }
147
147
  case "tile": {
148
- c = new O({
149
- url: r,
148
+ n = new O({
149
+ url: a,
150
150
  ...t.options
151
151
  });
152
152
  break;
153
153
  }
154
154
  case "customwmts".toLowerCase(): {
155
- c = new J({
156
- urlTemplate: r,
155
+ n = new J({
156
+ urlTemplate: a,
157
157
  ...t.options
158
158
  });
159
159
  break;
160
160
  }
161
161
  case "mapimage".toLowerCase(): {
162
- c = new B({
163
- url: r,
162
+ n = new B({
163
+ url: a,
164
164
  ...t.options
165
165
  });
166
166
  break;
@@ -171,36 +171,43 @@ class me {
171
171
  break;
172
172
  }
173
173
  case "feature": {
174
- c = new G({ url: r, ...t.options });
174
+ n = new x({ url: a, ...t.options });
175
175
  break;
176
176
  }
177
177
  case "3dtiles": {
178
- c = new H({
179
- url: r,
178
+ n = new H({
179
+ url: a,
180
180
  ...t.options
181
181
  });
182
182
  break;
183
183
  }
184
184
  case "wms": {
185
- c = new E({
186
- url: r,
185
+ n = new E({
186
+ url: a,
187
+ ...t.options
188
+ });
189
+ break;
190
+ }
191
+ case "geojson": {
192
+ n = new P({
193
+ url: a,
187
194
  ...t.options
188
195
  });
189
196
  break;
190
197
  }
191
198
  }
192
- if (c)
199
+ if (n)
193
200
  if (t.group) {
194
201
  let h = o.findLayerById(t.group);
195
- h && h.type === "group" ? h.add(c) : (h = new S({
202
+ h && h.type === "group" ? h.add(n) : (h = new S({
196
203
  id: t.group,
197
204
  title: t.groupTitle,
198
205
  visibilityMode: "inherited",
199
- layers: [c],
206
+ layers: [n],
200
207
  visible: t.groupVisible !== !1
201
208
  }), o.add(h));
202
209
  } else
203
- o.add(c);
210
+ o.add(n);
204
211
  }) : o.basemap = new L({
205
212
  style: {
206
213
  id: "arcgis/light-gray",
@@ -208,12 +215,12 @@ class me {
208
215
  }
209
216
  }), (f = this.mapConfig) != null && f.hdLayers) {
210
217
  const t = this.mapConfig.hdLayers.map(
211
- (r) => (
218
+ (a) => (
212
219
  // 图层文件为GeoJson格式, renderer和symbol使用autocast配置
213
- new x({
214
- url: this.processUrl(r.url),
215
- ...r.options,
216
- title: r.options.id
220
+ new P({
221
+ url: this.processUrl(a.url),
222
+ ...a.options,
223
+ title: a.options.id
217
224
  })
218
225
  )
219
226
  );
@@ -244,8 +251,8 @@ class me {
244
251
  if (i === "shanghai_district")
245
252
  return !this.detachmentLayerLoaded && e.visible ? await this.loadDetachmentLayer() : this.detachmentLayer && (this.detachmentLayer.visible = s), { status: 0, message: "ok" };
246
253
  {
247
- const a = this.view.map.findLayerById(i);
248
- return a ? (a.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
254
+ const r = this.view.map.findLayerById(i);
255
+ return r ? (r.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
249
256
  }
250
257
  }
251
258
  /**
@@ -263,13 +270,13 @@ class me {
263
270
  e.target = new T(e.target);
264
271
  break;
265
272
  case "polyline":
266
- e.target = new W(e.target);
273
+ e.target = new I(e.target);
267
274
  break;
268
275
  case "polygon":
269
276
  e.target = new k(e.target);
270
277
  break;
271
278
  case "multipoint":
272
- e.target = new z(e.target);
279
+ e.target = new W(e.target);
273
280
  break;
274
281
  }
275
282
  await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
@@ -300,9 +307,9 @@ class me {
300
307
  { duration: (e.duration || 2) * 1e3 }
301
308
  );
302
309
  else {
303
- const a = Math.tan(i * Math.PI / 180) * e.height, o = V(
304
- j.point(e.center),
305
- a,
310
+ const r = Math.tan(i * Math.PI / 180) * e.height, o = U(
311
+ V.point(e.center),
312
+ r,
306
313
  s + 180,
307
314
  {
308
315
  units: "meters"
@@ -325,10 +332,10 @@ class me {
325
332
  async setMapCamera(e) {
326
333
  if (!this.view)
327
334
  return { status: -1, message: "未初始化" };
328
- const { name: i, duration: s = 0 } = e, { camera: a } = this.mapConfig;
329
- if (!a)
335
+ const { name: i, duration: s = 0 } = e, { camera: r } = this.mapConfig;
336
+ if (!r)
330
337
  return { status: -1, message: "未配置camera" };
331
- const o = a[i];
338
+ const o = r[i];
332
339
  return o ? (await this.view.goTo(o, { duration: s * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
333
340
  }
334
341
  /**
@@ -350,8 +357,8 @@ class me {
350
357
  const s = new T({
351
358
  x: i[0],
352
359
  y: i[1]
353
- }), a = this.view.toScreen(s);
354
- return [a.x, a.y];
360
+ }), r = this.view.toScreen(s);
361
+ return [r.x, r.y];
355
362
  });
356
363
  }
357
364
  /**
@@ -368,8 +375,8 @@ class me {
368
375
  const { min: i, max: s } = e;
369
376
  !i && !s || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = M.watch(
370
377
  () => this.view.zoom,
371
- (a) => {
372
- i && a <= i && (this.view.zoom = i), s && a >= s && (this.view.zoom = s);
378
+ (r) => {
379
+ i && r <= i && (this.view.zoom = i), s && r >= s && (this.view.zoom = s);
373
380
  }
374
381
  ));
375
382
  }
@@ -392,16 +399,16 @@ class me {
392
399
  );
393
400
  if (i)
394
401
  try {
395
- const a = await (await fetch(
402
+ const r = await (await fetch(
396
403
  "/GisViewerAssets/ShangHai/Layers/district.json"
397
404
  )).json(), o = [], { renderer: l, labelingInfo: m } = i.options;
398
- a.features.forEach((p) => {
405
+ r.features.forEach((p) => {
399
406
  const u = p.attributes.ZD_NAME;
400
407
  if (u !== "高架支队") {
401
408
  let g = new k({
402
409
  rings: p.geometry.rings
403
410
  });
404
- g = I(g);
411
+ g = G(g);
405
412
  const f = new C({
406
413
  geometry: g,
407
414
  attributes: p.attributes
@@ -410,10 +417,10 @@ class me {
410
417
  if (l.type === "simple")
411
418
  f.symbol = l.symbol;
412
419
  else if (l.type === "unique-value") {
413
- const t = f.getAttribute("OBJECTID"), r = l.uniqueValueInfos.find(
414
- (c) => c.value == t
420
+ const t = f.getAttribute("OBJECTID"), a = l.uniqueValueInfos.find(
421
+ (n) => n.value == t
415
422
  );
416
- f.symbol = r ? r.symbol : l.defaultSymbol;
423
+ f.symbol = a ? a.symbol : l.defaultSymbol;
417
424
  }
418
425
  } else
419
426
  f.symbol = {
@@ -118,12 +118,17 @@ export default class OpenDriveRenderer {
118
118
  * @returns
119
119
  */
120
120
  splitLane(params: ISplitOpenDriveLaneParams): Promise<IResult>;
121
+ clearSplitLane(): void;
121
122
  /**
122
123
  * 封闭车道,使用可计算路网的id
123
124
  * @param params
124
125
  */
125
126
  blockLane(params: IBlockOpenDriveLaneParams): void;
126
- clearSplitLane(): void;
127
+ /**
128
+ * 解除封闭车道,使用可计算路网id
129
+ * @param params
130
+ */
131
+ clearBlockLane(params: IBlockOpenDriveLaneParams): void;
127
132
  selectComputable(params: IFindSumoParams): void;
128
133
  /**
129
134
  * 更新所有路口的symbol
@@ -1099,6 +1099,9 @@ class O {
1099
1099
  });
1100
1100
  return this.splitLaneLayer.add(f), A.viewGoto(this.view, [f]), { status: 0, message: "ok", result: { coordinates: m } };
1101
1101
  }
1102
+ clearSplitLane() {
1103
+ this.splitLaneLayer.removeAll();
1104
+ }
1102
1105
  /**
1103
1106
  * 封闭车道,使用可计算路网的id
1104
1107
  * @param params
@@ -1110,13 +1113,7 @@ class O {
1110
1113
  return t.startsWith("-") && (t = t.slice(1)), s.getAttribute("roadId") === e.roadsectId && ((l = s.getAttribute("roadsectBaseIds")) == null ? void 0 : l.includes(e.roadsectBaseId)) && t === String(e.laneId);
1111
1114
  }), o = i.map((s) => {
1112
1115
  const t = s.clone();
1113
- return console.log(
1114
- i[0].getAttribute("roadsectBaseIds"),
1115
- this.selectedSectionIds,
1116
- this.selectedSectionIds.includes(
1117
- i[0].getAttribute("roadsectBaseIds")
1118
- )
1119
- ), t.symbol = {
1116
+ return t.symbol = {
1120
1117
  type: "simple-fill",
1121
1118
  color: this.selectedSectionIds.includes(
1122
1119
  i[0].getAttribute("roadsectBaseIds")
@@ -1128,14 +1125,20 @@ class O {
1128
1125
  });
1129
1126
  this.splitLaneLayer.addMany(o), A.viewGoto(this.view, o);
1130
1127
  }
1131
- clearSplitLane() {
1132
- this.splitLaneLayer.removeAll();
1128
+ /**
1129
+ * 解除封闭车道,使用可计算路网id
1130
+ * @param params
1131
+ */
1132
+ clearBlockLane(e) {
1133
+ const i = this.splitLaneLayer.graphics.filter((o) => {
1134
+ const s = o.getAttribute("roadId"), t = o.getAttribute("roadsectBaseIds");
1135
+ let l = String(o.getAttribute("laneId"));
1136
+ return l.startsWith("-") && (l = l.slice(1)), s === e.roadsectId && (t == null ? void 0 : t.includes(e.roadsectBaseId)) && l === String(e.laneId);
1137
+ });
1138
+ this.splitLaneLayer.removeMany(i.toArray());
1133
1139
  }
1134
1140
  selectComputable(e) {
1135
1141
  if (e.type === "roadsectBase") {
1136
- this.allLaneGraphics.forEach((o) => {
1137
- o.getAttribute("roadsectBaseIds") || console.log(o.attributes);
1138
- });
1139
1142
  const i = this.allLaneGraphics.filter((o) => {
1140
1143
  var s;
1141
1144
  return (s = o.getAttribute("roadsectBaseIds")) == null ? void 0 : s.includes(e.id);