gisviewer-vue3-arcgis 1.0.110 → 1.0.112

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.
@@ -1,10 +1,10 @@
1
- import * as u from "@arcgis/core/views/3d/externalRenderers";
2
- import m from "../../stores/index.mjs";
1
+ import * as m from "@arcgis/core/views/3d/externalRenderers";
2
+ import u from "../../stores/index.mjs";
3
3
  import g from "./trace-renderer-external.mjs";
4
4
  import T from "./trace-renderer-layer.mjs";
5
- class v {
6
- constructor(e) {
7
- this.appDataStore = m.useAppDataStore, this.logTable = [
5
+ class L {
6
+ constructor(t) {
7
+ this.appDataStore = u.useAppDataStore, this.logTable = [
8
8
  [
9
9
  "uuid",
10
10
  "ptcId",
@@ -27,78 +27,105 @@ class v {
27
27
  "fixAngle",
28
28
  "roadLayer",
29
29
  "status",
30
- "step"
30
+ "step",
31
+ "receiveTimestamp"
31
32
  ]
32
- ], e.type === "3d" ? (this.traceRenderer = new g(e), u.add(
33
- e,
33
+ ], t.type === "3d" ? (this.traceRenderer = new g(t), m.add(
34
+ t,
34
35
  this.traceRenderer
35
- )) : this.traceRenderer = new T(e);
36
+ )) : this.traceRenderer = new T(t);
36
37
  }
37
38
  async init() {
38
39
  await this.traceRenderer.init();
39
40
  }
40
41
  downloadLog() {
41
- const e = this.logTable.map((c) => c.join(",")).join(`
42
- `).replace(/null/g, ""), a = new Blob([e], { type: "text/csv;charset=utf-8;" }), l = URL.createObjectURL(a), r = document.createElement("a");
43
- r.setAttribute("href", l), r.setAttribute("download", "trace-log.csv"), r.style.visibility = "hidden", document.body.appendChild(r), r.click(), document.body.removeChild(r);
42
+ const t = this.logTable.map((s) => s.join(",")).join(`
43
+ `).replace(/null/g, ""), r = new Blob([t], { type: "text/csv;charset=utf-8;" }), l = URL.createObjectURL(r), a = document.createElement("a");
44
+ a.setAttribute("href", l), a.setAttribute("download", "trace-log.csv"), a.style.visibility = "hidden", document.body.appendChild(a), a.click(), document.body.removeChild(a);
44
45
  }
45
46
  /**
46
47
  * 处理全息流轨迹数据
47
48
  * */
48
- async handleVehicleTraceData(e) {
49
- console.log(this.appDataStore.saveTrackLog);
50
- const { newVehList: a, updateVehList: l, deleteVehList: r, jgsj: c } = e, i = e.crossId || "", n = [], s = [];
51
- if (a && a.length > 0) {
52
- for (const t of a) {
53
- t.localTimestamp || (t.localTimestamp = c || Date.now());
54
- const o = this.buildVehicleTrackData(t, i);
55
- this.logTable.push([
56
- t.uuid,
57
- t.ptcId,
58
- t.plateno,
59
- t.timestamp,
60
- t.localTimestamp,
61
- t.timestamp_str,
62
- t.speed,
63
- t.laneNo,
64
- t.objHeight,
65
- t.objLength,
66
- t.latitude,
67
- t.longitude,
68
- t.ptcType,
69
- t.vehicleType,
70
- t.vehicleColor,
71
- t.plateColor,
72
- t.sbdm,
73
- t.heading,
74
- t.fixAngle,
75
- t.roadLayer,
76
- t.status,
77
- t.step
78
- ]), o && n.push(o);
49
+ async handleVehicleTraceData(t) {
50
+ const { newVehList: r, updateVehList: l, deleteVehList: a, jgsj: s } = t, i = t.crossId || "", c = [], n = [], d = Date.now();
51
+ if (r && r.length > 0) {
52
+ for (const e of r) {
53
+ e.localTimestamp || (e.localTimestamp = s || Date.now()), this.appDataStore.saveTrackLog && this.logTable.push([
54
+ e.uuid,
55
+ e.ptcId,
56
+ e.plateno,
57
+ e.timestamp,
58
+ e.localTimestamp,
59
+ e.timestamp_str,
60
+ e.speed,
61
+ e.laneNo,
62
+ e.objHeight,
63
+ e.objLength,
64
+ e.latitude,
65
+ e.longitude,
66
+ e.ptcType,
67
+ e.vehicleType,
68
+ e.vehicleColor,
69
+ e.plateColor,
70
+ e.sbdm,
71
+ e.heading,
72
+ e.fixAngle,
73
+ e.roadLayer,
74
+ e.status,
75
+ e.step,
76
+ d
77
+ ]);
78
+ const o = this.buildVehicleTrackData(e, i);
79
+ o && c.push(o);
79
80
  }
80
- await this.traceRenderer.addVehicles(n);
81
+ await this.traceRenderer.addVehicles(c);
81
82
  }
82
83
  if (l && l.length > 0) {
83
- for (const t of l) {
84
- const o = this.buildVehicleTrackData(t, i);
85
- o && s.push(o);
84
+ const e = Date.now();
85
+ for (const o of l) {
86
+ this.appDataStore.saveTrackLog && this.logTable.push([
87
+ o.uuid,
88
+ o.ptcId,
89
+ o.plateno,
90
+ o.timestamp,
91
+ o.localTimestamp,
92
+ o.timestamp_str,
93
+ o.speed,
94
+ o.laneNo,
95
+ o.objHeight,
96
+ o.objLength,
97
+ o.latitude,
98
+ o.longitude,
99
+ o.ptcType,
100
+ o.vehicleType,
101
+ o.vehicleColor,
102
+ o.plateColor,
103
+ o.sbdm,
104
+ o.heading,
105
+ o.fixAngle,
106
+ o.roadLayer,
107
+ o.status,
108
+ o.step,
109
+ e
110
+ ]);
111
+ const p = this.buildVehicleTrackData(o, i);
112
+ p && n.push(p);
86
113
  }
87
- await this.traceRenderer.updateVehicles(s);
114
+ await this.traceRenderer.updateVehicles(n);
88
115
  }
89
- if (r && r.length > 0) {
90
- const t = r.map(
116
+ if (a && a.length > 0) {
117
+ const e = a.map(
91
118
  (o) => i + "-" + (o.ptcId || o.vehno || o.vehNo)
92
119
  );
93
- this.traceRenderer.deleteVehicles(t);
120
+ this.traceRenderer.deleteVehicles(e);
94
121
  }
95
122
  }
96
123
  /**
97
124
  * 切换交通信息可见性
98
125
  * @param params
99
126
  */
100
- toggleTrafficInfo(e) {
101
- this.traceRenderer.toggleTrafficInfo(e);
127
+ toggleTrafficInfo(t) {
128
+ this.traceRenderer.toggleTrafficInfo(t);
102
129
  }
103
130
  /**
104
131
  * 清除轨迹流
@@ -109,43 +136,43 @@ class v {
109
136
  /**
110
137
  * 切换暂停
111
138
  * */
112
- togglePause(e) {
113
- this.traceRenderer.togglePause(e);
139
+ togglePause(t) {
140
+ this.traceRenderer.togglePause(t);
114
141
  }
115
- updatePanelContent(e) {
116
- this.traceRenderer.updatePanelContent(e);
142
+ updatePanelContent(t) {
143
+ this.traceRenderer.updatePanelContent(t);
117
144
  }
118
- toggleGroundVehicle(e) {
119
- this.traceRenderer.toggleGroundVehicle(e);
145
+ toggleGroundVehicle(t) {
146
+ this.traceRenderer.toggleGroundVehicle(t);
120
147
  }
121
- toggleElevatedVehicle(e) {
122
- this.traceRenderer.toggleElevatedVehicle(e);
148
+ toggleElevatedVehicle(t) {
149
+ this.traceRenderer.toggleElevatedVehicle(t);
123
150
  }
124
- setInterpolate(e) {
125
- this.traceRenderer.setInterpolate(e);
151
+ setInterpolate(t) {
152
+ this.traceRenderer.setInterpolate(t);
126
153
  }
127
- buildVehicleTrackData(e, a) {
128
- const l = e.longitude, r = e.latitude, c = e.ptcId, i = Number(e.ptcType), n = e.heading, s = Number(e.vehicleType), t = Number(e.vehicleColor), o = e.plateNo || e.plateno, d = Number(e.plateColor), h = e.timestamp, p = e.roadLayer ? String(e.roadLayer) : "1";
154
+ buildVehicleTrackData(t, r) {
155
+ const l = t.longitude, a = t.latitude, s = t.ptcId, i = Number(t.ptcType), c = t.heading, n = Number(t.vehicleType), d = Number(t.vehicleColor), e = t.plateNo || t.plateno, o = Number(t.plateColor), p = t.timestamp, h = t.roadLayer ? String(t.roadLayer) : "1";
129
156
  if (!(i < 0 || i > 8))
130
157
  return {
131
- ptcId: c,
132
- crossId: a,
133
- vehicleId: a + "-" + c,
158
+ ptcId: s,
159
+ crossId: r,
160
+ vehicleId: r + "-" + s,
134
161
  x: l,
135
- y: r,
162
+ y: a,
136
163
  ptcType: i,
137
- vehicleType: s,
138
- heading: i === 2 ? -n : n,
139
- vehicleColor: t,
140
- showName: o && o !== "" && o !== "0" && o !== "000000" ? o : "",
141
- plateNo: o,
142
- plateColor: d,
143
- timestamp: h,
164
+ vehicleType: n,
165
+ heading: i === 2 ? -c : c,
166
+ vehicleColor: d,
167
+ showName: e && e !== "" && e !== "0" && e !== "000000" ? e : "",
168
+ plateNo: e,
169
+ plateColor: o,
170
+ timestamp: p,
144
171
  localTimestamp: Date.now(),
145
- roadLayer: p
172
+ roadLayer: h
146
173
  };
147
174
  }
148
175
  }
149
176
  export {
150
- v as default
177
+ L as default
151
178
  };
@@ -12,6 +12,7 @@ export default class TraceRendererExternal implements ITraceRendererInterface {
12
12
  private readonly metalness;
13
13
  /** 默认车身材质 */
14
14
  private defaultMaterial;
15
+ private readonly vehiclePool;
15
16
  private createCarMaterial;
16
17
  /** 车身颜色材质 */
17
18
  private materialMap;