gisviewer-vue3-arcgis 1.0.166 → 1.0.167

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 +11 -2
  2. package/es/src/gis-map/gis-map.vue.mjs +26 -23
  3. package/es/src/gis-map/index.d.ts +11 -2
  4. package/es/src/gis-map/utils/common-utils.mjs +9 -9
  5. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +9 -1
  6. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +1 -1
  7. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +6 -5
  8. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -0
  9. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +103 -73
  10. package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
  11. package/es/src/gis-map/utils/map-initializer.mjs +121 -122
  12. package/es/src/types/index.d.ts +1 -0
  13. package/es/style.css +1 -1
  14. package/lib/src/gis-map/gis-map.vue.d.ts +11 -2
  15. package/lib/src/gis-map/gis-map.vue.js +1 -1
  16. package/lib/src/gis-map/index.d.ts +11 -2
  17. package/lib/src/gis-map/utils/common-utils.js +1 -1
  18. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +9 -1
  19. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
  20. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -1
  21. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -0
  22. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  23. package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
  24. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  25. package/lib/src/types/index.d.ts +1 -0
  26. package/package.json +1 -1
@@ -1,20 +1,19 @@
1
- import y from "@arcgis/core/Basemap";
2
- import g from "@arcgis/core/config";
3
- import * as M from "@arcgis/core/core/reactiveUtils";
4
- import { Polygon as P, Polyline as L, Point as k } from "@arcgis/core/geometry";
5
- import * as f from "@arcgis/core/geometry/support/webMercatorUtils";
6
- import W from "@arcgis/core/layers/GeoJSONLayer";
7
- import z from "@arcgis/core/layers/MapImageLayer";
8
- import x from "@arcgis/core/layers/TileLayer";
9
- import S from "@arcgis/core/layers/WebTileLayer";
10
- import I from "@arcgis/core/Map";
11
- import O from "@arcgis/core/views/MapView";
12
- import R from "@arcgis/core/views/SceneView";
13
- import C from "@turf/destination";
14
- import * as H from "@turf/helpers";
15
- import G from "../stores/index.mjs";
1
+ import C from "@arcgis/core/Basemap";
2
+ import d from "@arcgis/core/config";
3
+ import * as k from "@arcgis/core/core/reactiveUtils";
4
+ import { Polygon as W, Polyline as z, Point as T } from "@arcgis/core/geometry";
5
+ import * as w from "@arcgis/core/geometry/support/webMercatorUtils";
6
+ import L from "@arcgis/core/layers/GeoJSONLayer";
7
+ import x from "@arcgis/core/layers/MapImageLayer";
8
+ import I from "@arcgis/core/layers/TileLayer";
9
+ import R from "@arcgis/core/layers/WebTileLayer";
10
+ import H from "@arcgis/core/Map";
11
+ import G from "@arcgis/core/views/MapView";
12
+ import O from "@arcgis/core/views/SceneView";
13
+ import S from "@turf/destination";
14
+ import * as B from "@turf/helpers";
16
15
  import N from "./custom-layer/custom-wmts-layer.mjs";
17
- function T(h, e) {
16
+ function P(h, e) {
18
17
  return h && (h.startsWith("http://") || h.startsWith("https://") ? h : e + h);
19
18
  }
20
19
  class Z {
@@ -27,25 +26,25 @@ class Z {
27
26
  * @returns view
28
27
  */
29
28
  async initialize(e) {
30
- const i = G.useAppDataStore, t = JSON.parse(JSON.stringify(i.mapConfig));
31
- this.mapConfig = t;
32
- const { container: a, markerClickCallback: c, mapClickCallback: d } = e;
33
- g.assetsPath = `${t.assetsRoot}/ArcgisAssets`, g.fontsUrl = `${t.assetsRoot}/fonts`, g.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
34
- const n = new I();
35
- if ((t == null ? void 0 : t.mapOptions.mode.toLowerCase()) === "2d" ? this.view = new O({
29
+ var p, u, b, v;
30
+ this.mapConfig = e.mapConfig;
31
+ const { container: t, markerClickCallback: s, mapClickCallback: a } = e;
32
+ d.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, d.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, d.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
33
+ const n = new H();
34
+ if (((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? this.view = new G({
36
35
  map: n,
37
- container: a,
38
- ...t.mapOptions
39
- }) : this.view = new R({
36
+ container: t,
37
+ ...this.mapConfig.mapOptions
38
+ }) : this.view = new O({
40
39
  map: n,
41
- container: a,
40
+ container: t,
42
41
  environment: {
43
42
  atmosphereEnabled: !0,
44
43
  lighting: {
45
44
  type: "virtual"
46
45
  }
47
46
  },
48
- ...t == null ? void 0 : t.mapOptions
47
+ ...(u = this.mapConfig) == null ? void 0 : u.mapOptions
49
48
  }), this.view.popup.visibleElements = {
50
49
  closeButton: !0,
51
50
  collapseButton: !1,
@@ -54,35 +53,35 @@ class Z {
54
53
  }, this.view.popup.dockOptions = {
55
54
  buttonEnabled: !1,
56
55
  breakpoint: !1
57
- }, this.view.on("click", async (s) => {
58
- var b, v;
59
- if (d) {
60
- let o = s.mapPoint;
61
- o.spatialReference.isWebMercator && (o = f.webMercatorToGeographic(
56
+ }, this.view.on("click", async (i) => {
57
+ var y, M;
58
+ if (a) {
59
+ let o = i.mapPoint;
60
+ o.spatialReference.isWebMercator && (o = w.webMercatorToGeographic(
62
61
  o
63
- )), d(
62
+ )), a(
64
63
  [o.x, o.y],
65
- [s.screenPoint.x, s.screenPoint.y],
66
- s
64
+ [i.screenPoint.x, i.screenPoint.y],
65
+ i
67
66
  );
68
67
  }
69
68
  if (this.view.type === "3d") {
70
69
  const o = this.view.camera;
71
70
  if (this.view.spatialReference.isWebMercator) {
72
- const p = f.webMercatorToGeographic(
71
+ const m = w.webMercatorToGeographic(
73
72
  o.position
74
- ), w = {
73
+ ), f = {
75
74
  heading: o.heading,
76
75
  tilt: o.tilt,
77
- position: p.toJSON()
76
+ position: m.toJSON()
78
77
  };
79
- console.log(w), (b = navigator.clipboard) == null || b.writeText(JSON.stringify(w));
78
+ console.log(f), (y = navigator.clipboard) == null || y.writeText(JSON.stringify(f));
80
79
  } else
81
80
  console.log(o.toJSON());
82
81
  console.log(this.view.zoom, this.view.scale);
83
82
  } else {
84
83
  let o = this.view.center;
85
- this.view.spatialReference.isWebMercator && (o = f.webMercatorToGeographic(
84
+ this.view.spatialReference.isWebMercator && (o = w.webMercatorToGeographic(
86
85
  o
87
86
  )), console.log({
88
87
  center: o.toJSON(),
@@ -90,101 +89,101 @@ class Z {
90
89
  scale: this.view.scale
91
90
  });
92
91
  }
93
- const r = (v = (await this.view.hitTest(s)).results) == null ? void 0 : v.filter(
92
+ const r = (M = (await this.view.hitTest(i)).results) == null ? void 0 : M.filter(
94
93
  (o) => o.type === "graphic"
95
94
  );
96
95
  r.length > 0 && r.forEach((o) => {
97
- var w;
98
- const p = o.graphic;
99
- (w = p.attributes) != null && w.type && c && c(
100
- p.attributes.type,
101
- p.attributes.id,
102
- p.attributes,
103
- s
96
+ var f;
97
+ const m = o.graphic;
98
+ (f = m.attributes) != null && f.type && s && s(
99
+ m.attributes.type,
100
+ m.attributes.id,
101
+ m.attributes,
102
+ i
104
103
  );
105
104
  });
106
- }), t != null && t.baseLayers ? (console.log(t.baseLayers), t.baseLayers.forEach((s) => {
107
- const l = T(s.url, t.assetsRoot);
108
- switch (s.type.toLowerCase()) {
105
+ }), (b = this.mapConfig) != null && b.baseLayers ? this.mapConfig.baseLayers.forEach((i) => {
106
+ const c = P(i.url, this.mapConfig.assetsRoot);
107
+ switch (i.type.toLowerCase()) {
109
108
  case "webTile".toLowerCase(): {
110
- const r = new S({
111
- urlTemplate: l,
112
- ...s.options
109
+ const r = new R({
110
+ urlTemplate: c,
111
+ ...i.options
113
112
  });
114
113
  n.add(r);
115
114
  break;
116
115
  }
117
116
  case "tile": {
118
- const r = new x({
119
- url: l,
120
- ...s.options
117
+ const r = new I({
118
+ url: c,
119
+ ...i.options
121
120
  });
122
121
  n.add(r);
123
122
  break;
124
123
  }
125
124
  case "customWMTS".toLowerCase(): {
126
125
  const r = new N({
127
- urlTemplate: l,
128
- ...s.options
126
+ urlTemplate: c,
127
+ ...i.options
129
128
  });
130
129
  n.add(r);
131
130
  break;
132
131
  }
133
132
  case "mapImage".toLowerCase(): {
134
- const r = new z({
135
- url: l,
136
- ...s.options
133
+ const r = new x({
134
+ url: c,
135
+ ...i.options
137
136
  });
138
- n.add(r), console.log(r);
137
+ n.add(r);
139
138
  break;
140
139
  }
141
140
  case "arcgis": {
142
- const r = new y(s.options);
141
+ const r = new C(i.options);
143
142
  n.basemap = r;
144
143
  break;
145
144
  }
146
145
  }
147
- })) : n.basemap = new y({
146
+ }) : n.basemap = new C({
148
147
  style: {
149
148
  id: "arcgis/light-gray",
150
149
  language: "zh-CN"
151
150
  }
152
- }), t != null && t.hdLayers) {
153
- const s = t.hdLayers.map(
154
- (l) => (
151
+ }), (v = this.mapConfig) != null && v.hdLayers) {
152
+ const i = this.mapConfig.hdLayers.map(
153
+ (c) => (
155
154
  // 图层文件为GeoJson格式, renderer和symbol使用autocast配置
156
- new W({
157
- url: T(l.url, t.assetsRoot),
158
- ...l.options,
159
- title: l.options.id
155
+ new L({
156
+ url: P(c.url, this.mapConfig.assetsRoot),
157
+ ...c.options,
158
+ title: c.options.id
160
159
  })
161
160
  )
162
161
  );
163
- n.addMany(s);
162
+ n.addMany(i);
164
163
  }
165
- this.view.ui.remove("attribution"), this.view.ui.add("compass", "top-left"), await this.view.when();
166
- const m = this.mapConfig.camera;
167
- let u;
164
+ this.view.ui.remove("attribution"), await this.view.when();
165
+ const g = this.mapConfig.camera;
166
+ let l;
168
167
  if (this.view.type === "2d") {
169
- let s = this.view.center;
170
- this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
171
- s
172
- )), u = { center: [s.x, s.y], zoom: this.view.zoom };
168
+ let i = this.view.center;
169
+ this.view.spatialReference.isWebMercator && (i = w.webMercatorToGeographic(
170
+ i
171
+ )), l = { center: [i.x, i.y], zoom: this.view.zoom };
173
172
  } else {
174
- let s = this.view.camera.position;
175
- this.view.spatialReference.isWebMercator && (s = f.webMercatorToGeographic(
176
- s
177
- )), u = {
178
- position: s,
173
+ let i = this.view.camera.position;
174
+ this.view.spatialReference.isWebMercator && (i = w.webMercatorToGeographic(
175
+ i
176
+ )), l = {
177
+ position: i,
179
178
  heading: this.view.camera.heading,
180
179
  tilt: this.view.camera.tilt
181
180
  };
182
181
  }
183
- return m ? m.home = u : this.mapConfig.camera = { home: u }, this.view;
182
+ return g ? g.home = l : this.mapConfig.camera = { home: l }, this.view;
184
183
  }
185
184
  setLayerVisibility(e) {
186
- const { id: i, visible: t } = e, a = this.view.map.findLayerById(i);
187
- return a ? (a.visible = t, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
185
+ const { id: t, visible: s } = e, a = this.view.map.findLayerById(t);
186
+ return a ? (a.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
188
187
  }
189
188
  /**
190
189
  * 设置地图中心点
@@ -192,19 +191,19 @@ class Z {
192
191
  * @returns
193
192
  */
194
193
  async setMapCenter(e) {
195
- var i;
194
+ var t;
196
195
  if (!this.view)
197
196
  return { status: -1, message: "未初始化" };
198
197
  if (e.center || e.target) {
199
- switch ((i = e.target) == null ? void 0 : i.type) {
198
+ switch ((t = e.target) == null ? void 0 : t.type) {
200
199
  case "point":
201
- e.target = new k(e.target);
200
+ e.target = new T(e.target);
202
201
  break;
203
202
  case "polyline":
204
- e.target = new L(e.target);
203
+ e.target = new z(e.target);
205
204
  break;
206
205
  case "polygon":
207
- e.target = new P(e.target);
206
+ e.target = new W(e.target);
208
207
  break;
209
208
  }
210
209
  await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
@@ -217,8 +216,8 @@ class Z {
217
216
  async lookAt(e) {
218
217
  if (this.view.type === "2d")
219
218
  return;
220
- const i = e.tilt || 0, t = e.heading || 0;
221
- if (i === 0)
219
+ const t = e.tilt || 0, s = e.heading || 0;
220
+ if (t === 0)
222
221
  await this.view.goTo(
223
222
  {
224
223
  position: {
@@ -226,16 +225,16 @@ class Z {
226
225
  y: e.center[1],
227
226
  z: e.height
228
227
  },
229
- heading: t,
228
+ heading: s,
230
229
  tilt: 0
231
230
  },
232
231
  { duration: (e.duration || 2) * 1e3 }
233
232
  );
234
233
  else {
235
- const a = Math.tan(i * Math.PI / 180) * e.height, c = C(
236
- H.point(e.center),
234
+ const a = Math.tan(t * Math.PI / 180) * e.height, n = S(
235
+ B.point(e.center),
237
236
  a,
238
- t + 180,
237
+ s + 180,
239
238
  {
240
239
  units: "meters"
241
240
  }
@@ -243,12 +242,12 @@ class Z {
243
242
  await this.view.goTo(
244
243
  {
245
244
  position: {
246
- x: c.geometry.coordinates[0],
247
- y: c.geometry.coordinates[1],
245
+ x: n.geometry.coordinates[0],
246
+ y: n.geometry.coordinates[1],
248
247
  z: e.height
249
248
  },
250
- heading: t,
251
- tilt: i
249
+ heading: s,
250
+ tilt: t
252
251
  },
253
252
  { duration: (e.duration || 2) * 1e3 }
254
253
  );
@@ -257,32 +256,32 @@ class Z {
257
256
  async setMapCamera(e) {
258
257
  if (!this.view)
259
258
  return { status: -1, message: "未初始化" };
260
- const { name: i, duration: t = 0 } = e, { camera: a } = this.mapConfig;
259
+ const { name: t, duration: s = 0 } = e, { camera: a } = this.mapConfig;
261
260
  if (!a)
262
261
  return { status: -1, message: "未配置camera" };
263
- const c = a[i];
264
- return c ? (await this.view.goTo(c, { duration: t * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
262
+ const n = a[t];
263
+ return n ? (await this.view.goTo(n, { duration: s * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
265
264
  }
266
265
  /**
267
266
  * 经纬度转像素坐标,在地图移动时回调
268
267
  * */
269
- requestCoordinateTransform(e, i) {
270
- let t = 0;
271
- const c = 1e3 / 30, d = M.watch(
268
+ requestCoordinateTransform(e, t) {
269
+ let s = 0;
270
+ const n = 1e3 / 30, g = k.watch(
272
271
  () => this.view.center,
273
272
  () => {
274
- const n = this.transformPoints(e), m = Date.now();
275
- m - t > c && (i(n), t = m);
273
+ const l = this.transformPoints(e), p = Date.now();
274
+ p - s > n && (t(l), s = p);
276
275
  }
277
276
  );
278
- return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, d), { handle: this.handleIndex, points: this.transformPoints(e) };
277
+ return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, g), { handle: this.handleIndex, points: this.transformPoints(e) };
279
278
  }
280
279
  transformPoints(e) {
281
- return e.map((i) => {
282
- const t = new k({
283
- x: i[0],
284
- y: i[1]
285
- }), a = this.view.toScreen(t);
280
+ return e.map((t) => {
281
+ const s = new T({
282
+ x: t[0],
283
+ y: t[1]
284
+ }), a = this.view.toScreen(s);
286
285
  return [a.x, a.y];
287
286
  });
288
287
  }
@@ -290,18 +289,18 @@ class Z {
290
289
  * 停止坐标转换回调
291
290
  * */
292
291
  cancelCoordinateTransform(e) {
293
- const i = this.watchHandleMap.get(e);
294
- i && (i.remove(), this.watchHandleMap.delete(e));
292
+ const t = this.watchHandleMap.get(e);
293
+ t && (t.remove(), this.watchHandleMap.delete(e));
295
294
  }
296
295
  /**
297
296
  * 设置地图zoom范围
298
297
  * */
299
298
  setMapZoomRange(e) {
300
- const { min: i, max: t } = e;
301
- !i && !t || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = M.watch(
299
+ const { min: t, max: s } = e;
300
+ !t && !s || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = k.watch(
302
301
  () => this.view.zoom,
303
302
  (a) => {
304
- i && a <= i && (this.view.zoom = i), t && a >= t && (this.view.zoom = t);
303
+ t && a <= t && (this.view.zoom = t), s && a >= s && (this.view.zoom = s);
305
304
  }
306
305
  ));
307
306
  }
@@ -248,6 +248,7 @@ export interface IJunctionTableData {
248
248
  factoryCode?: string;
249
249
  }
250
250
  export interface ISignalCountdownProps {
251
+ displayMode: string;
251
252
  crossId: string;
252
253
  roadId: string;
253
254
  mapPoint: number[];
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}.signal-countdown-panel[data-v-93496d9c]{position:absolute;display:flex;flex-direction:row;padding:0;margin:0}.signal-countdown-container[data-v-93496d9c]{margin:0 1px;padding:0;background-color:#000c;border-style:solid;border-color:#40e0d0;border-width:2px;border-radius:5px;color:#fff;width:40px;height:70px;justify-content:center;align-items:center;display:flex;flex-direction:column}.signal-countdown-number[data-v-93496d9c]{font:30px bold}
1
+ .gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}.signal-countdown-panel[data-v-d749c855]{position:absolute;display:flex;flex-direction:row;padding:0;margin:0}.signal-countdown-container[data-v-d749c855]{margin:0 1px;padding:0;background-color:#000c;border-style:solid;border-color:#40e0d0;border-width:2px;border-radius:5px;color:#fff;width:40px;height:70px;justify-content:center;align-items:center;display:flex;flex-direction:column}.signal-countdown-number[data-v-d749c855]{font:30px bold}
@@ -29,6 +29,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
29
29
  queueLength: QueueLength;
30
30
  openDriveRenderer: OpenDriveRenderer;
31
31
  signalControlAreaController: SignalControlAreaController;
32
+ showLogDiv: import("vue").Ref<boolean>;
32
33
  appDataStore: import("pinia").Store<"appData", {
33
34
  mapConfig: {};
34
35
  saveTrackLog: boolean;
@@ -36,6 +37,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
36
37
  countdownPanels: import("../types").ISignalCountdownProps[];
37
38
  }, {}, {}>;
38
39
  countdownPanelInfos: import("vue").Ref<{
40
+ displayMode: string;
39
41
  crossId: string;
40
42
  roadId: string;
41
43
  mapPoint: number[];
@@ -56,7 +58,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
56
58
  rColor?: string | undefined;
57
59
  };
58
60
  }[]>;
59
- showLogDiv: import("vue").Ref<boolean>;
60
61
  mapViewer: import("vue").ComputedRef<MapView | SceneView>;
61
62
  startSaveTrackLog: () => void;
62
63
  downloadTrackLog: () => void;
@@ -123,6 +124,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
123
124
  props: any;
124
125
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
125
126
  SignalCountdownPanel: import("vue").DefineComponent<{
127
+ displayMode: {
128
+ type: StringConstructor;
129
+ required: true;
130
+ };
126
131
  crossId: {
127
132
  type: StringConstructor;
128
133
  required: true;
@@ -175,8 +180,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
175
180
  rNumberStyle: import("vue").ComputedRef<{
176
181
  color: string;
177
182
  }>;
178
- getColorString: (color: string | undefined) => "red" | "yellow" | "lime" | "white";
183
+ getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
179
184
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
185
+ displayMode: {
186
+ type: StringConstructor;
187
+ required: true;
188
+ };
180
189
  crossId: {
181
190
  type: StringConstructor;
182
191
  required: true;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),De=require("pinia"),S=require("./stores/index.js");require("./style/index.css");const Ae=require("./utils/holo-flow/index.js"),be=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ie=require("./utils/map-initializer.js"),k=require("./utils/open-drive-renderer/index.js"),C=require("./utils/overlay.js"),qe=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),Me=require("./utils/signal-control-area-controller/index.js"),_e=require("./utils/traffic-flow.js"),xe={class:"gis-viewer"},Be={style:{position:"absolute",bottom:"10px",left:"10px"}},He=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:D,emit:A}){const p=a.ref(null);let i,u,c,s,r,n,g,t,o;S.registerStore();const h=S.default.useAppDataStore,{countdownPanels:b}=De.storeToRefs(h),f=a.ref(!1);a.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",d=>{d.ctrlKey&&d.key==="i"&&(f.value=!f.value)});const e=a.getCurrentInstance(),{$gisviewerAssetsRoot:m}=e.appContext.config.globalProperties,l=await(await fetch(O.config)).json();l.assetsRoot=O.assetsRoot||m,h.mapConfig=l,u=new Ie.default,i=await u.initialize({container:p.value,markerClickCallback:(d,v,y,Te)=>{w("markerClick",d,v,y,Te)},mapClickCallback:(d,v,y)=>{w("mapClick",d,v,y)}}),r=new Ae.default(i),await r.init(),w("mapLoaded")}),a.onUnmounted(()=>{o==null||o.clearSignalControlArea(),t==null||t.clearOpenDrive(),r==null||r.clearHoloTrace(),r==null||r.clearHoloSignal(),s==null||s.disconnectTrafficFlow()});const I=a.computed(()=>i),q=()=>{const e=S.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{r.downloadTrackLog()},_=async e=>await u.setMapCenter(e),x=async e=>await u.setMapCamera(e),B=async e=>await u.lookAt(e),H=e=>u.setLayerVisibility(e),V=(e,m)=>u.requestCoordinateTransform(e,m),P=e=>{u.cancelCoordinateTransform(e)},N=e=>{u.setMapZoomRange(e)},E=e=>(c||(c=new L.default(i)),c.showLaneNumber(e)),j=()=>{c==null||c.clearLaneNumber()},z=async e=>(c||(c=new L.default(i)),await c.initializeSearch(e)),Q=async()=>c==null?void 0:c.calCrossIndicatorArea(),F=async()=>{},Z=async(e,m)=>{s||(s=new _e.default(i)),s.connectTrafficFlow(e,m)},K=()=>{s==null||s.disconnectTrafficFlow()},U=e=>{r.handleVehicleTraceData(e)},G=()=>{r.clearHoloTrace()},J=e=>{r.setInterpolate(e)},W=async e=>{await r.handleSignalData(e)},X=()=>{r.clearHoloSignal()},Y=e=>{s==null||s.toggleTrafficInfo(e),r.toggleTrafficInfo(e)},R=e=>{r.togglePause(e)},$=e=>{s==null||s.toggleTrafficObject(e),r.toggleTrafficObject(e)},ee=e=>{r.updatePanelContent(e)},te=async e=>(n||(n=new C.default(i)),n.addOverlays(e)),ae=e=>(n||(n=new C.default(i)),n.addMask(e)),ne=()=>{n==null||n.removeMask()},re=e=>n==null?void 0:n.removeOverlaysByType(e),se=e=>n==null?void 0:n.removeOverlaysById(e),oe=()=>n==null?void 0:n.removeAllOverlays(),ie=()=>{n==null||n.showAllOverlays()},ce=e=>{g||(g=new qe.default(i)),g.updateQueueLength(e)},le=()=>{g==null||g.removeQueueLength()},ue=async(e,m)=>(t||(t=new k.default(i)),await t.showOpenDriveFromServer(e,m)),me=async e=>(t||(t=new k.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),de=async()=>await(t==null?void 0:t.clearOpenDrive()),ge=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},pe=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},fe=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Se=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},he=async e=>(o||(o=new Me.default(i)),await o.showSignalControlArea(e)),Oe=()=>{o==null||o.clearSignalControlArea()},ke=async e=>o?await o.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ce=async e=>o?await o.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=()=>o?o.resetHighlight():{status:-1,message:"未加载信号控制区"},O=T,w=A;return D({mapViewer:I,setLayerVisibility:H,setMapCenter:_,lookAt:B,setMapCamera:x,setMapZoomRange:N,requestCoordinateTransform:V,cancelCoordinateTransform:P,addOverlays:te,addMask:ae,removeMask:ne,showAllOverlays:ie,removeOverlaysByType:re,removeOverlaysById:se,removeAllOverlays:oe,showLaneNumber:E,clearLaneNumber:j,initializeAreaTool:z,calCrossIndicatorArea:Q,calRoadIndicatorArea:F,connectCarFlow:Z,disconnectCarFlow:K,handleHoloVehicleTraceData:U,clearHoloTrace:G,handleHoloSignalData:W,clearHoloSignal:X,setInterpolate:J,toggleTrafficInfo:Y,toggleTrafficObject:$,toggleVehicleInfo:ee,togglePause:R,updateQueueLength:ce,removeQueueLength:le,showOpenDriveFromServer:ue,showOpenDriveFromFile:me,clearOpenDrive:de,geometrySearchInOpenDrive:we,findSumoInOpenDrive:ge,selectSumoInOpenDrive:pe,unselectSumoInOpenDrive:fe,getSumoInfo:ve,splitOpenDriveLane:ye,clearSplitOpenDriveLane:Se,showSignalControlArea:he,clearSignalControlArea:Oe,locateSignalControlArea:ke,highlightSignalControlArea:Ce,resetHighlightSignalControlArea:Le}),(e,m)=>(a.openBlock(),a.createElementBlock("div",xe,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[a.withDirectives(a.createElementVNode("div",Be,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 开始记录 "),a.createElementVNode("button",{onClick:M},"下载日志")],512),[[a.vShow,f.value]])],512),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(b),(l,d)=>(a.openBlock(),a.createBlock(be.default,{key:d,"road-id":l.crossId,"cross-id":l.roadId,"map-point":l.mapPoint,"stop-line":l.stopLine,position:l.position,rotation:l.rotation,"lamp-status":l.lampStatus},null,8,["road-id","cross-id","map-point","stop-line","position","rotation","lamp-status"]))),128))]))}});exports.default=He;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),De=require("pinia"),S=require("./stores/index.js");require("./style/index.css");const Ae=require("./utils/holo-flow/index.js"),be=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ie=require("./utils/map-initializer.js"),k=require("./utils/open-drive-renderer/index.js"),C=require("./utils/overlay.js"),qe=require("./utils/queue-length.js"),L=require("./utils/road-config-tool/index.js"),Me=require("./utils/signal-control-area-controller/index.js"),_e=require("./utils/traffic-flow.js"),xe={class:"gis-viewer"},Be={style:{position:"absolute",bottom:"10px",left:"10px"}},He=a.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(T,{expose:D,emit:A}){const g=a.ref(null);let i,u,c,s,r,n,p,t,o;const f=a.ref(!1);S.registerStore();const h=S.default.useAppDataStore,{countdownPanels:b}=De.storeToRefs(h);a.onMounted(async()=>{if(!g.value)return;document.addEventListener("keydown",d=>{d.ctrlKey&&d.key==="i"&&(f.value=!f.value)});const e=a.getCurrentInstance(),{$gisviewerAssetsRoot:m}=e.appContext.config.globalProperties,l=await(await fetch(O.config)).json();l.assetsRoot=O.assetsRoot||m,h.mapConfig=l,u=new Ie.default,i=await u.initialize({container:g.value,mapConfig:l,markerClickCallback:(d,y,v,Te)=>{w("markerClick",d,y,v,Te)},mapClickCallback:(d,y,v)=>{w("mapClick",d,y,v)}}),r=new Ae.default(i),await r.init(),w("mapLoaded")}),a.onUnmounted(()=>{o==null||o.clearSignalControlArea(),t==null||t.clearOpenDrive(),r==null||r.clearHoloTrace(),r==null||r.clearHoloSignal(),s==null||s.disconnectTrafficFlow()});const I=a.computed(()=>i),q=()=>{const e=S.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{r.downloadTrackLog()},_=async e=>await u.setMapCenter(e),x=async e=>await u.setMapCamera(e),B=async e=>await u.lookAt(e),H=e=>u.setLayerVisibility(e),V=(e,m)=>u.requestCoordinateTransform(e,m),P=e=>{u.cancelCoordinateTransform(e)},N=e=>{u.setMapZoomRange(e)},E=e=>(c||(c=new L.default(i)),c.showLaneNumber(e)),j=()=>{c==null||c.clearLaneNumber()},z=async e=>(c||(c=new L.default(i)),await c.initializeSearch(e)),Q=async()=>c==null?void 0:c.calCrossIndicatorArea(),F=async()=>{},Z=async(e,m)=>{s||(s=new _e.default(i)),s.connectTrafficFlow(e,m)},K=()=>{s==null||s.disconnectTrafficFlow()},U=e=>{r.handleVehicleTraceData(e)},G=()=>{r.clearHoloTrace()},J=e=>{r.setInterpolate(e)},W=async e=>{await r.handleSignalData(e)},X=()=>{r.clearHoloSignal()},Y=e=>{s==null||s.toggleTrafficInfo(e),r.toggleTrafficInfo(e)},R=e=>{r.togglePause(e)},$=e=>{s==null||s.toggleTrafficObject(e),r.toggleTrafficObject(e)},ee=e=>{r.updatePanelContent(e)},te=async e=>(n||(n=new C.default(i)),n.addOverlays(e)),ae=e=>(n||(n=new C.default(i)),n.addMask(e)),ne=()=>{n==null||n.removeMask()},re=e=>n==null?void 0:n.removeOverlaysByType(e),se=e=>n==null?void 0:n.removeOverlaysById(e),oe=()=>n==null?void 0:n.removeAllOverlays(),ie=()=>{n==null||n.showAllOverlays()},ce=e=>{p||(p=new qe.default(i)),p.updateQueueLength(e)},le=()=>{p==null||p.removeQueueLength()},ue=async(e,m)=>(t||(t=new k.default(i)),await t.showOpenDriveFromServer(e,m)),me=async e=>(t||(t=new k.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),de=async()=>await(t==null?void 0:t.clearOpenDrive()),pe=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ge=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},fe=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Se=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},he=async e=>(o||(o=new Me.default(i)),await o.showSignalControlArea(e)),Oe=()=>{o==null||o.clearSignalControlArea()},ke=async e=>o?await o.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ce=async e=>o?await o.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=()=>o?o.resetHighlight():{status:-1,message:"未加载信号控制区"},O=T,w=A;return D({mapViewer:I,setLayerVisibility:H,setMapCenter:_,lookAt:B,setMapCamera:x,setMapZoomRange:N,requestCoordinateTransform:V,cancelCoordinateTransform:P,addOverlays:te,addMask:ae,removeMask:ne,showAllOverlays:ie,removeOverlaysByType:re,removeOverlaysById:se,removeAllOverlays:oe,showLaneNumber:E,clearLaneNumber:j,initializeAreaTool:z,calCrossIndicatorArea:Q,calRoadIndicatorArea:F,connectCarFlow:Z,disconnectCarFlow:K,handleHoloVehicleTraceData:U,clearHoloTrace:G,handleHoloSignalData:W,clearHoloSignal:X,setInterpolate:J,toggleTrafficInfo:Y,toggleTrafficObject:$,toggleVehicleInfo:ee,togglePause:R,updateQueueLength:ce,removeQueueLength:le,showOpenDriveFromServer:ue,showOpenDriveFromFile:me,clearOpenDrive:de,geometrySearchInOpenDrive:we,findSumoInOpenDrive:pe,selectSumoInOpenDrive:ge,unselectSumoInOpenDrive:fe,getSumoInfo:ye,splitOpenDriveLane:ve,clearSplitOpenDriveLane:Se,showSignalControlArea:he,clearSignalControlArea:Oe,locateSignalControlArea:ke,highlightSignalControlArea:Ce,resetHighlightSignalControlArea:Le}),(e,m)=>(a.openBlock(),a.createElementBlock("div",xe,[a.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:g},[a.withDirectives(a.createElementVNode("div",Be,[a.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 开始记录 "),a.createElementVNode("button",{onClick:M},"下载日志")],512),[[a.vShow,f.value]])],512),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(b),(l,d)=>(a.openBlock(),a.createBlock(be.default,{key:d,"display-mode":l.displayMode,"road-id":l.crossId,"cross-id":l.roadId,"map-point":l.mapPoint,"stop-line":l.stopLine,position:l.position,rotation:l.rotation,"lamp-status":l.lampStatus},null,8,["display-mode","road-id","cross-id","map-point","stop-line","position","rotation","lamp-status"]))),128))]))}});exports.default=He;
@@ -18,6 +18,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
18
18
  queueLength: import("./utils/queue-length").default;
19
19
  openDriveRenderer: import("./utils/open-drive-renderer").default;
20
20
  signalControlAreaController: import("./utils/signal-control-area-controller").default;
21
+ showLogDiv: import("vue").Ref<boolean>;
21
22
  appDataStore: import("pinia").Store<"appData", {
22
23
  mapConfig: {};
23
24
  saveTrackLog: boolean;
@@ -25,6 +26,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
25
26
  countdownPanels: import("../types").ISignalCountdownProps[];
26
27
  }, {}, {}>;
27
28
  countdownPanelInfos: import("vue").Ref<{
29
+ displayMode: string;
28
30
  crossId: string;
29
31
  roadId: string;
30
32
  mapPoint: number[];
@@ -45,7 +47,6 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
45
47
  rColor?: string | undefined;
46
48
  };
47
49
  }[]>;
48
- showLogDiv: import("vue").Ref<boolean>;
49
50
  mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
50
51
  startSaveTrackLog: () => void;
51
52
  downloadTrackLog: () => void;
@@ -112,6 +113,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
112
113
  props: any;
113
114
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
114
115
  SignalCountdownPanel: import("vue").DefineComponent<{
116
+ displayMode: {
117
+ type: StringConstructor;
118
+ required: true;
119
+ };
115
120
  crossId: {
116
121
  type: StringConstructor;
117
122
  required: true;
@@ -164,8 +169,12 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
164
169
  rNumberStyle: import("vue").ComputedRef<{
165
170
  color: string;
166
171
  }>;
167
- getColorString: (color: string | undefined) => "red" | "yellow" | "lime" | "white";
172
+ getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
168
173
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
174
+ displayMode: {
175
+ type: StringConstructor;
176
+ required: true;
177
+ };
169
178
  crossId: {
170
179
  type: StringConstructor;
171
180
  required: true;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("@turf/length"),A=require("@turf/line-slice-along"),M=require("pako"),h=require("proj4");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const l=y(L),P=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new f.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),u=g(r,t,o,{units:"meters"}),d=o>0?o-180:o+180,O=g(s,t,d,{units:"meters"});return new f.Polyline({paths:[[u.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new f.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new f.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof f.Polyline){const s=r.paths[0],o=s[0],u=s[s.length-1];return[o,u]}return[]}static async getOffsetLine(e,t){const n=P.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return P.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return M.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>h(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return h(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return g(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}static getCenterPointInLine(e){const t=c.lineString(e),n=S(t,{units:"meters"})/2;return A(t,0,n,{units:"meters"}).geometry.coordinates[1]}}exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("@turf/length"),A=require("@turf/line-slice-along"),M=require("pako"),h=require("proj4");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const l=y(L),P=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new f.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),u=g(r,t,o,{units:"meters"}),d=o>0?o-180:o+180,O=g(s,t,d,{units:"meters"});return new f.Polyline({paths:[[u.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new f.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new f.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof f.Polyline){const s=r.paths[0],o=s[0],u=s[s.length-1];return[o,u]}return[]}static async getOffsetLine(e,t){const n=P.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return P.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return M.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>h(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return h(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return g(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}static getCenterPointInLine(e){const t=c.lineString(e),n=S(t,{units:"meters"})/2,r=A(t,0,n,{units:"meters"});return r.geometry.coordinates[r.geometry.coordinates.length-1]}}exports.default=i;
@@ -1,4 +1,8 @@
1
1
  declare const _sfc_main: import("vue").DefineComponent<{
2
+ displayMode: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
2
6
  crossId: {
3
7
  type: StringConstructor;
4
8
  required: true;
@@ -51,8 +55,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
51
55
  rNumberStyle: import("vue").ComputedRef<{
52
56
  color: string;
53
57
  }>;
54
- getColorString: (color: string | undefined) => "red" | "yellow" | "lime" | "white";
58
+ getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
55
59
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
60
+ displayMode: {
61
+ type: StringConstructor;
62
+ required: true;
63
+ };
56
64
  crossId: {
57
65
  type: StringConstructor;
58
66
  required: true;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./signal-countdown-panel.vue2.js");require("./signal-countdown-panel.vue3.js");const t=require("../../../../_virtual/_plugin-vue_export-helper.js"),u=t.default(e.default,[["__scopeId","data-v-93496d9c"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./signal-countdown-panel.vue2.js");require("./signal-countdown-panel.vue3.js");const t=require("../../../../_virtual/_plugin-vue_export-helper.js"),u=t.default(e.default,[["__scopeId","data-v-d749c855"]]);exports.default=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g={key:0,class:"signal-countdown-container"},S=["src"],v={key:1,class:"signal-countdown-container"},y=["src"],N={key:2,class:"signal-countdown-container"},h=["src"],w={key:3,class:"signal-countdown-container"},V=["src"],C=e.defineComponent({__name:"signal-countdown-panel",props:{crossId:{},roadId:{},mapPoint:{},stopLine:{},position:{},rotation:{},lampStatus:{}},setup(n){const t=n,s=e.computed(()=>({top:`${t.position.top}px`,left:`${t.position.left}px`,"transform-origin":"bottom center",transform:`translateX(-50%) translateY(-100%) rotate(${t.rotation}deg)`})),a=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/u-${t.lampStatus.uColor}.png`),r=e.computed(()=>({color:l(t.lampStatus.uColor)})),c=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/l-${t.lampStatus.lColor}.png`),i=e.computed(()=>({color:l(t.lampStatus.lColor)})),m=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/s-${t.lampStatus.sColor}.png`),u=e.computed(()=>({color:l(t.lampStatus.sColor)})),d=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/r-${t.lampStatus.rColor}.png`),p=e.computed(()=>({color:l(t.lampStatus.rColor)})),l=o=>{switch(o){case"red":return"red";case"yellow":return"yellow";case"green":return"lime";default:return"white"}};return(o,E)=>(e.openBlock(),e.createElementBlock("div",{class:"signal-countdown-panel",style:e.normalizeStyle(s.value)},[o.lampStatus.uColor?(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(r.value)},e.toDisplayString(o.lampStatus.uNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:a.value,width:"20px",height:"20px"},null,8,S)])])):e.createCommentVNode("",!0),o.lampStatus.lColor?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(i.value)},e.toDisplayString(o.lampStatus.lNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:c.value,width:"20px",height:"20px"},null,8,y)])])):e.createCommentVNode("",!0),o.lampStatus.sColor?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(u.value)},e.toDisplayString(o.lampStatus.sNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:m.value,width:"20px",height:"20px"},null,8,h)])])):e.createCommentVNode("",!0),o.lampStatus.rColor!==void 0?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(p.value)},e.toDisplayString(o.lampStatus.rNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:d.value,width:"20px",height:"20px"},null,8,V)])])):e.createCommentVNode("",!0)],4))}});exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g={key:0,class:"signal-countdown-container"},S=["src"],v={key:1,class:"signal-countdown-container"},y=["src"],N={key:2,class:"signal-countdown-container"},h=["src"],w={key:3,class:"signal-countdown-container"},V=["src"],C=e.defineComponent({__name:"signal-countdown-panel",props:{displayMode:{},crossId:{},roadId:{},mapPoint:{},stopLine:{},position:{},rotation:{},lampStatus:{}},setup(n){const t=n,s=e.computed(()=>({top:`${t.position.top}px`,left:`${t.position.left}px`,"transform-origin":"bottom center",transform:`translateX(-50%) translateY(-100%) rotate(${t.rotation}deg)`})),a=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/u-${t.lampStatus.uColor}.png`),r=e.computed(()=>({color:l(t.lampStatus.uColor)})),c=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/l-${t.lampStatus.lColor}.png`),i=e.computed(()=>({color:l(t.lampStatus.lColor)})),m=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/s-${t.lampStatus.sColor}.png`),u=e.computed(()=>({color:l(t.lampStatus.sColor)})),d=e.computed(()=>`/GisViewerAssets/Images/SignalLamp/r-${t.lampStatus.rColor}.png`),p=e.computed(()=>({color:l(t.lampStatus.rColor)})),l=o=>{switch(o){case"red":return"red";case"yellow":return"rgb(255, 192, 2)";case"green":return"lime";default:return"white"}};return(o,E)=>(e.openBlock(),e.createElementBlock("div",{class:"signal-countdown-panel",style:e.normalizeStyle(s.value)},[o.lampStatus.uColor?(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(r.value)},e.toDisplayString(o.lampStatus.uNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:a.value,width:"20px",height:"20px"},null,8,S)])])):e.createCommentVNode("",!0),o.lampStatus.lColor?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(i.value)},e.toDisplayString(o.lampStatus.lNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:c.value,width:"20px",height:"20px"},null,8,y)])])):e.createCommentVNode("",!0),o.lampStatus.sColor?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(u.value)},e.toDisplayString(o.lampStatus.sNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:m.value,width:"20px",height:"20px"},null,8,h)])])):e.createCommentVNode("",!0),o.lampStatus.rColor!==void 0?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",{class:"signal-countdown-number",style:e.normalizeStyle(p.value)},e.toDisplayString(o.lampStatus.rNumber),5),e.createElementVNode("div",null,[e.createElementVNode("img",{src:d.value,width:"20px",height:"20px"},null,8,V)])])):e.createCommentVNode("",!0)],4))}});exports.default=C;
@@ -2,6 +2,7 @@ import SignalHoloFlow from './signal-holo-flow';
2
2
  export default class LSRSignalHoloFlow extends SignalHoloFlow {
3
3
  private stopLineLayer;
4
4
  private store;
5
+ private watchHandle;
5
6
  constructor(view: __esri.MapView | __esri.SceneView);
6
7
  private stopLineMap;
7
8
  initializeLayer(): Promise<void>;