gisviewer-vue3-arcgis 1.0.136 → 1.0.138

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,14 +1,14 @@
1
- import * as P from "@arcgis/core/core/promiseUtils.js";
2
- import * as b from "@arcgis/core/core/reactiveUtils.js";
1
+ import * as M from "@arcgis/core/core/promiseUtils.js";
2
+ import * as P from "@arcgis/core/core/reactiveUtils.js";
3
3
  import v from "@arcgis/core/geometry/SpatialReference";
4
4
  import * as u from "@arcgis/core/views/3d/externalRenderers";
5
- import * as l from "three";
5
+ import * as a from "three";
6
6
  import { GLTFLoader as y } from "three/examples/jsm/loaders/GLTFLoader";
7
7
  import { EVehiclePlateState as m } from "../../../types/index.mjs";
8
8
  import T from "../../stores/index.mjs";
9
- class I {
10
- constructor(i) {
11
- this.cameraHeightThreshold = 1e3, this.roughness = 0.2, this.metalness = 0.8, this.defaultMaterial = new l.MeshPhongMaterial({
9
+ class R {
10
+ constructor(s) {
11
+ this.cameraHeightThreshold = 1e3, this.roughness = 0.2, this.metalness = 0.8, this.defaultMaterial = new a.MeshPhongMaterial({
12
12
  color: 16777215
13
13
  }), this.materialMap = /* @__PURE__ */ new Map([
14
14
  [1, this.createCarMaterial(16777215)],
@@ -45,7 +45,7 @@ class I {
45
45
  ]
46
46
  ], this.assetsRoot = JSON.parse(
47
47
  JSON.stringify(this.appDataStore.mapConfig)
48
- ).assetsRoot, this.view = i, b.watch(
48
+ ).assetsRoot, this.view = s, P.watch(
49
49
  () => this.view.camera.position.z,
50
50
  (e, t) => {
51
51
  (t <= this.cameraHeightThreshold && e > this.cameraHeightThreshold || t > this.cameraHeightThreshold && e <= this.cameraHeightThreshold) && (this.updateModel = !0);
@@ -53,9 +53,9 @@ class I {
53
53
  );
54
54
  }
55
55
  // private readonly vehiclePool = new VehiclePool();
56
- createCarMaterial(i) {
57
- return new l.MeshPhongMaterial({
58
- color: i
56
+ createCarMaterial(s) {
57
+ return new a.MeshPhongMaterial({
58
+ color: s
59
59
  // // emissive: 0xc3c3c3,
60
60
  // roughness: this.roughness,
61
61
  // metalness: this.metalness
@@ -65,31 +65,37 @@ class I {
65
65
  return this.logTable;
66
66
  }
67
67
  async init() {
68
- const i = new y();
69
- await P.eachAlways([
68
+ const s = new y();
69
+ await M.eachAlways([
70
70
  new Promise((e) => {
71
- i.load(`${this.assetsRoot}/3DModels/car.glb`, (t) => {
72
- this.carModel = t.scene, this.carModel.rotation.x = l.MathUtils.degToRad(90), e();
71
+ s.load(`${this.assetsRoot}/3DModels/car.glb`, (t) => {
72
+ const i = t.scene, n = new a.Box3().setFromObject(i).getSize(new a.Vector3());
73
+ this.carModel = new a.Object3D(), this.carModel.rotation.x = a.MathUtils.degToRad(90), this.carModel.add(i), i.position.set(0, 0, n.z / 2), e();
73
74
  });
74
75
  }),
75
76
  new Promise((e) => {
76
- i.load(`${this.assetsRoot}/3DModels/van.glb`, (t) => {
77
- this.vanModel = t.scene, this.vanModel.rotation.x = l.MathUtils.degToRad(90), e();
77
+ s.load(`${this.assetsRoot}/3DModels/van.glb`, (t) => {
78
+ const i = t.scene, n = new a.Box3().setFromObject(i).getSize(new a.Vector3());
79
+ this.vanModel = new a.Object3D(), this.vanModel.rotation.x = a.MathUtils.degToRad(90), this.vanModel.add(i), i.position.set(0, 0, n.z / 2), e();
78
80
  });
79
81
  }),
80
82
  new Promise((e) => {
81
- i.load(`${this.assetsRoot}/3DModels/truck.glb`, (t) => {
82
- this.truckModel = t.scene, this.truckModel.scale.set(1.2, 1, 1.5), this.truckModel.rotation.x = l.MathUtils.degToRad(90), e();
83
+ s.load(`${this.assetsRoot}/3DModels/truck.glb`, (t) => {
84
+ const i = t.scene;
85
+ i.scale.set(1.2, 1, 1.5);
86
+ const n = new a.Box3().setFromObject(i).getSize(new a.Vector3());
87
+ this.truckModel = new a.Object3D(), this.truckModel.rotation.x = a.MathUtils.degToRad(90), this.truckModel.add(i), i.position.set(0, 0, n.z / 2), e();
83
88
  });
84
89
  }),
85
90
  new Promise((e) => {
86
- i.load(`${this.assetsRoot}/3DModels/bus.glb`, (t) => {
87
- this.busModel = t.scene, this.busModel.rotation.x = l.MathUtils.degToRad(90), e();
91
+ s.load(`${this.assetsRoot}/3DModels/bus.glb`, (t) => {
92
+ const i = t.scene, n = new a.Box3().setFromObject(i).getSize(new a.Vector3());
93
+ this.busModel = new a.Object3D(), this.busModel.rotation.x = a.MathUtils.degToRad(90), this.busModel.add(i), i.position.set(0, 0, n.z / 2), e();
88
94
  });
89
95
  }),
90
96
  new Promise((e) => {
91
- i.load(`${this.assetsRoot}/3DModels/bicycle.glb`, (t) => {
92
- this.bicycleModel = t.scene, this.bicycleModel.rotation.x = l.MathUtils.degToRad(90), this.bicycleModel.rotation.y = l.MathUtils.degToRad(180), e();
97
+ s.load(`${this.assetsRoot}/3DModels/bicycle.glb`, (t) => {
98
+ this.bicycleModel = t.scene, this.bicycleModel.rotation.x = a.MathUtils.degToRad(90), this.bicycleModel.rotation.y = a.MathUtils.degToRad(180), e();
93
99
  });
94
100
  }),
95
101
  new Promise((e) => {
@@ -129,12 +135,12 @@ class I {
129
135
  })
130
136
  ]), this.isInitialized = !0;
131
137
  }
132
- setInterpolate(i) {
133
- this.clearVehicles(), this.needInterpolate = i;
138
+ setInterpolate(s) {
139
+ this.clearVehicles(), this.needInterpolate = s;
134
140
  }
135
- async setup(i) {
136
- this.context = i, this.renderer = new l.WebGLRenderer({
137
- context: i.gl,
141
+ async setup(s) {
142
+ this.context = s, this.renderer = new a.WebGLRenderer({
143
+ context: s.gl,
138
144
  premultipliedAlpha: !0,
139
145
  logarithmicDepthBuffer: !0,
140
146
  antialias: !0,
@@ -143,52 +149,52 @@ class I {
143
149
  const e = this.renderer.setRenderTarget.bind(
144
150
  this.renderer
145
151
  );
146
- this.renderer.setRenderTarget = (s) => {
147
- e(s), s == null && i.bindRenderTarget();
148
- }, this.scene = new l.Scene();
149
- const { camera: t } = i;
150
- this.camera = new l.PerspectiveCamera(
152
+ this.renderer.setRenderTarget = (i) => {
153
+ e(i), i == null && s.bindRenderTarget();
154
+ }, this.scene = new a.Scene();
155
+ const { camera: t } = s;
156
+ this.camera = new a.PerspectiveCamera(
151
157
  t.fovY,
152
158
  t.aspect,
153
159
  0.1,
154
160
  1e5
155
- ), this.ambient = new l.AmbientLight(16777215, 2), this.scene.add(this.ambient), this.sun = new l.DirectionalLight(16777215, 2), this.scene.add(this.sun), i.resetWebGLState();
161
+ ), this.ambient = new a.AmbientLight(16777215, 2), this.scene.add(this.ambient), this.sun = new a.DirectionalLight(16777215, 2), this.scene.add(this.sun), s.resetWebGLState();
156
162
  }
157
- async render(i) {
158
- var s;
159
- const e = i.camera;
163
+ async render(s) {
164
+ var i;
165
+ const e = s.camera;
160
166
  if (this.camera.position.set(e.eye[0], e.eye[1], e.eye[2]), this.camera.up.set(e.up[0], e.up[1], e.up[2]), this.camera.lookAt(
161
- new l.Vector3(e.center[0], e.center[1], e.center[2])
167
+ new a.Vector3(e.center[0], e.center[1], e.center[2])
162
168
  ), this.camera.projectionMatrix.fromArray(e.projectionMatrix), !this.isPaused && this.needInterpolate)
163
- for (const a of this.vehicleObjectMap.keys()) {
164
- const n = (s = this.vehicleObjectMap.get(a)) == null ? void 0 : s.model;
169
+ for (const o of this.vehicleObjectMap.keys()) {
170
+ const n = (i = this.vehicleObjectMap.get(o)) == null ? void 0 : i.model;
165
171
  if (!n)
166
172
  continue;
167
- const o = this.computeVehiclePosition(a);
168
- if (o) {
169
- const d = this.toRenderCoordinates(o);
170
- n.position.set(d[0], d[1], d[2]), n.rotation.y = l.MathUtils.degToRad(-o[3]);
173
+ const r = this.computeVehiclePosition(o);
174
+ if (r) {
175
+ const d = this.toRenderCoordinates(r);
176
+ n.position.set(d[0], d[1], d[2]), n.rotation.y = a.MathUtils.degToRad(-r[3]);
171
177
  }
172
178
  }
173
- const t = i.sunLight;
174
- this.sun.position.set(t.direction[0], t.direction[1], t.direction[2]), this.sun.intensity = t.diffuse.intensity, this.sun.color = new l.Color(
179
+ const t = s.sunLight;
180
+ this.sun.position.set(t.direction[0], t.direction[1], t.direction[2]), this.sun.intensity = t.diffuse.intensity, this.sun.color = new a.Color(
175
181
  t.diffuse.color[0],
176
182
  t.diffuse.color[1],
177
183
  t.diffuse.color[2]
178
- ), this.ambient.intensity = t.ambient.intensity, this.ambient.color = new l.Color(
184
+ ), this.ambient.intensity = t.ambient.intensity, this.ambient.color = new a.Color(
179
185
  t.ambient.color[0],
180
186
  t.ambient.color[1],
181
187
  t.ambient.color[2]
182
- ), this.renderer.resetState(), i.bindRenderTarget(), this.renderer.render(this.scene, this.camera), u.requestRender(this.view), i.resetWebGLState();
188
+ ), this.renderer.resetState(), s.bindRenderTarget(), this.renderer.render(this.scene, this.camera), u.requestRender(this.view), s.resetWebGLState();
183
189
  }
184
190
  /**
185
191
  * 新增车辆
186
192
  * */
187
- async addVehicles(i) {
193
+ async addVehicles(s) {
188
194
  if (this.isPaused || !this.isInitialized)
189
195
  return;
190
196
  const e = Date.now();
191
- for (const t of i) {
197
+ for (const t of s) {
192
198
  this.appDataStore.saveTrackLog && this.logTable.push([
193
199
  t.ptcId,
194
200
  t.plateNo,
@@ -209,19 +215,19 @@ class I {
209
215
  0,
210
216
  0
211
217
  ]);
212
- const { vehicleId: s, localTimestamp: a } = t, n = Number(t.x), o = Number(t.y), d = Number(t.heading);
213
- this.historyPositionMap.set(s, [
214
- { pos: [n, o, 0], heading: d, time: a }
218
+ const { vehicleId: i, localTimestamp: o } = t, n = Number(t.x), r = Number(t.y), d = Number(t.heading);
219
+ this.historyPositionMap.set(i, [
220
+ { pos: [n, r, 0], heading: d, time: o }
215
221
  ]);
216
222
  const h = this.getVehicleModel(t);
217
- h.name = s, h.visible = !1;
223
+ h.name = i, h.visible = !1;
218
224
  try {
219
- const r = await this.createPlateSprite(t);
220
- r && (h.add(r), r.position.set(0, 5, -4));
221
- } catch (r) {
222
- console.log("createPlateSprite error:", r);
225
+ const l = await this.createPlateSprite(t);
226
+ l && (h.add(l), l.position.set(0, 5, -4));
227
+ } catch (l) {
228
+ console.log("createPlateSprite error:", l);
223
229
  }
224
- this.scene.add(h), this.vehicleObjectMap.set(s, {
230
+ this.scene.add(h), this.vehicleObjectMap.set(i, {
225
231
  model: h,
226
232
  data: t,
227
233
  waitForDelete: !1,
@@ -232,73 +238,73 @@ class I {
232
238
  /**
233
239
  * 更新车辆
234
240
  * */
235
- async updateVehicles(i) {
241
+ async updateVehicles(s) {
236
242
  if (this.isPaused || !this.isInitialized)
237
243
  return;
238
244
  const e = [], t = Date.now();
239
- for (const s of i) {
240
- const { vehicleId: a, localTimestamp: n } = s, o = Number(s.x), d = Number(s.y);
241
- let h = Number(s.heading);
242
- const r = this.vehicleObjectMap.get(a), p = this.historyPositionMap.get(
243
- a
245
+ for (const i of s) {
246
+ const { vehicleId: o, localTimestamp: n } = i, r = Number(i.x), d = Number(i.y);
247
+ let h = Number(i.heading);
248
+ const l = this.vehicleObjectMap.get(o), p = this.historyPositionMap.get(
249
+ o
244
250
  );
245
- if (!r || !p)
246
- e.push(s);
251
+ if (!l || !p)
252
+ e.push(i);
247
253
  else {
248
254
  if (this.appDataStore.saveTrackLog && this.logTable.push([
249
- s.ptcId,
250
- s.plateNo,
251
- s.timestamp,
252
- s.localTimestamp,
253
- s.speed,
254
- s.x,
255
- s.y,
256
- s.ptcType,
257
- s.vehicleType,
258
- s.vehicleColor,
259
- s.plateColor,
260
- s.heading,
261
- s.fixAngle,
262
- s.roadLayer,
263
- s.step,
255
+ i.ptcId,
256
+ i.plateNo,
257
+ i.timestamp,
258
+ i.localTimestamp,
259
+ i.speed,
260
+ i.x,
261
+ i.y,
262
+ i.ptcType,
263
+ i.vehicleType,
264
+ i.vehicleColor,
265
+ i.plateColor,
266
+ i.heading,
267
+ i.fixAngle,
268
+ i.roadLayer,
269
+ i.step,
264
270
  t,
265
271
  p.length,
266
272
  1
267
- ]), this.updateModel || r.data.vehicleColor !== s.vehicleColor || r.data.vehicleType !== s.vehicleType) {
268
- this.scene.remove(r.model), this.disposeModel(r.model), r.model = this.getVehicleModel(s), r.model.visible = !0;
269
- const c = await this.createPlateSprite(s);
270
- c && (r.model.add(c), c.position.set(0, 5, -4)), this.scene.add(r.model);
273
+ ]), this.updateModel || l.data.vehicleColor !== i.vehicleColor || l.data.vehicleType !== i.vehicleType) {
274
+ this.scene.remove(l.model), this.disposeModel(l.model), l.model = this.getVehicleModel(i), l.model.visible = !0;
275
+ const c = await this.createPlateSprite(i);
276
+ c && (l.model.add(c), c.position.set(0, 5, -4)), this.scene.add(l.model);
271
277
  }
272
- if (r.data.showName !== s.showName || r.data.plateColor !== s.plateColor) {
273
- const c = r.model.getObjectByName("VehiclePlate");
274
- c && (r.model.remove(c), this.disposeModel(c));
275
- const g = await this.createPlateSprite(s);
276
- g && (r.model.add(g), g.position.set(0, 5, -4));
278
+ if (l.data.showName !== i.showName || l.data.plateColor !== i.plateColor) {
279
+ const c = l.model.getObjectByName("VehiclePlate");
280
+ c && (l.model.remove(c), this.disposeModel(c));
281
+ const g = await this.createPlateSprite(i);
282
+ g && (l.model.add(g), g.position.set(0, 5, -4));
277
283
  }
278
- if (r.data = s, this.needInterpolate) {
284
+ if (l.data = i, this.needInterpolate) {
279
285
  const c = p[p.length - 1];
280
286
  Math.abs(h - c.heading) >= 180 && (h > c.heading ? c.heading += 360 : h += 360), p.push({
281
- pos: [o, d, 0],
287
+ pos: [r, d, 0],
282
288
  heading: h,
283
289
  time: n
284
290
  });
285
291
  } else {
286
- this.historyPositionMap.set(a, [
287
- { pos: [o, d, 0], heading: h, time: n }
292
+ this.historyPositionMap.set(o, [
293
+ { pos: [r, d, 0], heading: h, time: n }
288
294
  ]);
289
- const c = this.toRenderCoordinates([o, d, 0]);
290
- r.model.position.set(c[0], c[1], c[2]), r.model.rotation.y = l.MathUtils.degToRad(-h);
295
+ const c = this.toRenderCoordinates([r, d, 0]);
296
+ l.model.position.set(c[0], c[1], c[2]), l.model.rotation.y = a.MathUtils.degToRad(-h);
291
297
  }
292
298
  }
293
299
  }
294
300
  await this.addVehicles(e), this.updateModel = !1, this.needInterpolate || this.render(this.context);
295
301
  }
296
- toRenderCoordinates(i) {
302
+ toRenderCoordinates(s) {
297
303
  const e = [0, 0, 0];
298
304
  return u.toRenderCoordinates(
299
305
  // @ts-ignore
300
306
  this.view,
301
- i,
307
+ s,
302
308
  0,
303
309
  v.WGS84,
304
310
  e,
@@ -309,13 +315,13 @@ class I {
309
315
  /**
310
316
  * 删除车辆
311
317
  * */
312
- deleteVehicles(i) {
318
+ deleteVehicles(s) {
313
319
  if (this.isPaused)
314
320
  return;
315
321
  const e = Date.now();
316
- i.forEach((t) => {
322
+ s.forEach((t) => {
317
323
  if (this.appDataStore.saveTrackLog) {
318
- const a = this.historyPositionMap.get(t);
324
+ const o = this.historyPositionMap.get(t);
319
325
  this.logTable.push([
320
326
  t,
321
327
  "",
@@ -333,33 +339,33 @@ class I {
333
339
  "",
334
340
  "",
335
341
  e,
336
- a ? a.length : 0,
342
+ o ? o.length : 0,
337
343
  2
338
344
  ]);
339
345
  }
340
- const s = this.vehicleObjectMap.get(t);
341
- s && (this.needInterpolate ? s.isMoving ? s.waitForDelete = !0 : this.deleteVehicle(s) : this.deleteVehicle(s));
346
+ const i = this.vehicleObjectMap.get(t);
347
+ i && (this.needInterpolate ? i.isMoving ? i.waitForDelete = !0 : this.deleteVehicle(i) : this.deleteVehicle(i));
342
348
  });
343
349
  }
344
- deleteVehicle(i) {
345
- this.scene.remove(i.model), this.disposeModel(i.model);
346
- const e = i.data.vehicleId;
350
+ deleteVehicle(s) {
351
+ this.scene.remove(s.model), this.disposeModel(s.model);
352
+ const e = s.data.vehicleId;
347
353
  this.vehicleObjectMap.delete(e), this.historyPositionMap.delete(e);
348
354
  }
349
- async toggleTrafficInfo(i) {
350
- i.name === "vehiclePlate" && (i.visible === !0 && this.currentSpriteContent === m.None ? await this.updatePanelContent(m.PlateNumber) : await this.updatePanelContent(
351
- i.visible ? this.currentSpriteContent : m.None
355
+ async toggleTrafficInfo(s) {
356
+ s.name === "vehiclePlate" && (s.visible === !0 && this.currentSpriteContent === m.None ? await this.updatePanelContent(m.PlateNumber) : await this.updatePanelContent(
357
+ s.visible ? this.currentSpriteContent : m.None
352
358
  ));
353
359
  }
354
- togglePause(i) {
355
- this.isPaused = i;
360
+ togglePause(s) {
361
+ this.isPaused = s;
356
362
  }
357
363
  /**
358
364
  * 清除全部车辆
359
365
  * */
360
366
  clearVehicles() {
361
- for (const i of this.vehicleObjectMap.keys()) {
362
- const e = this.vehicleObjectMap.get(i);
367
+ for (const s of this.vehicleObjectMap.keys()) {
368
+ const e = this.vehicleObjectMap.get(s);
363
369
  e && (this.scene.remove(e.model), this.disposeModel(e.model));
364
370
  }
365
371
  this.vehicleObjectMap.clear(), this.historyPositionMap.clear();
@@ -369,81 +375,81 @@ class I {
369
375
  * @param contentType
370
376
  * @returns
371
377
  */
372
- async updatePanelContent(i) {
373
- if (i !== this.currentSpriteContent) {
374
- this.currentSpriteContent = i;
378
+ async updatePanelContent(s) {
379
+ if (s !== this.currentSpriteContent) {
380
+ this.currentSpriteContent = s;
375
381
  for (const e of this.vehicleObjectMap.keys()) {
376
382
  const t = this.vehicleObjectMap.get(e);
377
383
  if (t) {
378
- const s = t.model.getObjectByName("VehiclePlate");
379
- if (s && (t.model.remove(s), this.disposeModel(s)), i !== m.None) {
380
- const a = await this.createPlateSprite(t.data);
381
- a && (t.model.add(a), a.position.set(0, 5, -4));
384
+ const i = t.model.getObjectByName("VehiclePlate");
385
+ if (i && (t.model.remove(i), this.disposeModel(i)), s !== m.None) {
386
+ const o = await this.createPlateSprite(t.data);
387
+ o && (t.model.add(o), o.position.set(0, 5, -4));
382
388
  }
383
389
  }
384
390
  }
385
391
  }
386
392
  }
387
- toggleGroundVehicle(i) {
388
- console.log("toggleGroundVehicle", i), this.showGroundVehicle = i;
393
+ toggleGroundVehicle(s) {
394
+ console.log("toggleGroundVehicle", s), this.showGroundVehicle = s;
389
395
  }
390
- toggleElevatedVehicle(i) {
391
- this.showElevatedVehicle = i;
396
+ toggleElevatedVehicle(s) {
397
+ this.showElevatedVehicle = s;
392
398
  }
393
399
  /**
394
400
  * 释放模型资源
395
401
  * */
396
- disposeModel(i) {
397
- i.traverse((e) => {
398
- e instanceof l.Mesh && (e.geometry.dispose(), e.material.dispose());
402
+ disposeModel(s) {
403
+ s.traverse((e) => {
404
+ e instanceof a.Mesh && (e.geometry.dispose(), e.material.dispose());
399
405
  });
400
406
  }
401
407
  /**
402
408
  * 计算车辆位置
403
409
  * */
404
- computeVehiclePosition(i) {
405
- const e = this.historyPositionMap.get(i), t = this.vehicleObjectMap.get(i);
410
+ computeVehiclePosition(s) {
411
+ const e = this.historyPositionMap.get(s), t = this.vehicleObjectMap.get(s);
406
412
  if (!t || !e || !t.isMoving && e.length <= 2)
407
413
  return;
408
- const s = Date.now();
409
- t.isMoving = !0, t.data.roadLayer === "1" ? t.model.visible = this.showGroundVehicle : t.model.visible = this.showElevatedVehicle, t.segmentStartTime || (t.segmentStartTime = s, t.segmentTotalTime = e[1].time - e[0].time);
410
- const a = s - t.segmentStartTime, n = Math.min(
411
- a / t.segmentTotalTime,
414
+ const i = Date.now();
415
+ t.isMoving = !0, t.data.roadLayer === "1" ? t.model.visible = this.showGroundVehicle : t.model.visible = this.showElevatedVehicle, t.segmentStartTime || (t.segmentStartTime = i, t.segmentTotalTime = e[1].time - e[0].time);
416
+ const o = i - t.segmentStartTime, n = Math.min(
417
+ o / t.segmentTotalTime,
412
418
  1
413
419
  );
414
420
  if (n === 1)
415
421
  if (e.shift(), e.length === 1) {
416
- t.waitForDelete === !0 ? this.deleteVehicle(t) : (t.segmentStartTime = void 0, t.segmentTotalTime = void 0, t.model.visible = !1, t.isMoving = !1, console.log("hide vehicle", i));
422
+ t.waitForDelete === !0 ? this.deleteVehicle(t) : (t.segmentStartTime = void 0, t.segmentTotalTime = void 0, t.model.visible = !1, t.isMoving = !1, console.log("hide vehicle", s));
417
423
  return;
418
424
  } else {
419
425
  t.segmentStartTime = Date.now();
420
- const o = a - t.segmentTotalTime;
421
- return t.segmentTotalTime = e[1].time - e[0].time - o, (e[1].heading >= 270 && e[0].heading <= 90 || e[1].heading <= 90 && e[0].heading >= 270) && (e[1].heading > e[0].heading ? e[0].heading += 360 : e[1].heading += 360), e[0].pos.concat(e[0].heading);
426
+ const r = o - t.segmentTotalTime;
427
+ return t.segmentTotalTime = e[1].time - e[0].time - r, (e[1].heading >= 270 && e[0].heading <= 90 || e[1].heading <= 90 && e[0].heading >= 270) && (e[1].heading > e[0].heading ? e[0].heading += 360 : e[1].heading += 360), e[0].pos.concat(e[0].heading);
422
428
  }
423
429
  else if (e.length >= 2) {
424
- const o = e[0].pos[0] + (e[1].pos[0] - e[0].pos[0]) * n, d = e[0].pos[1] + (e[1].pos[1] - e[0].pos[1]) * n, h = e[0].heading + (e[1].heading - e[0].heading) * n;
425
- return [o, d, 0, h];
430
+ const r = e[0].pos[0] + (e[1].pos[0] - e[0].pos[0]) * n, d = e[0].pos[1] + (e[1].pos[1] - e[0].pos[1]) * n, h = e[0].heading + (e[1].heading - e[0].heading) * n;
431
+ return [r, d, 0, h];
426
432
  } else
427
433
  return;
428
434
  }
429
435
  /**
430
436
  * 根据车辆类型、车身颜色获取模型
431
437
  * */
432
- getVehicleModel(i) {
438
+ getVehicleModel(s) {
433
439
  if (this.view.camera.position.z >= this.cameraHeightThreshold) {
434
- const e = new l.SphereGeometry(5, 32, 32), t = new l.MeshPhysicalMaterial({
440
+ const e = new a.SphereGeometry(5, 32, 32), t = new a.MeshPhysicalMaterial({
435
441
  color: 325253,
436
442
  emissive: 0,
437
443
  roughness: this.roughness,
438
444
  metalness: this.metalness
439
445
  });
440
- return new l.Mesh(e, t);
446
+ return new a.Mesh(e, t);
441
447
  } else {
442
448
  let e;
443
- if (i.ptcType === 2)
449
+ if (s.ptcType === 2)
444
450
  e = this.bicycleModel.clone();
445
451
  else {
446
- switch (i.vehicleType) {
452
+ switch (s.vehicleType) {
447
453
  case 10:
448
454
  e = this.carModel.clone();
449
455
  break;
@@ -460,10 +466,10 @@ class I {
460
466
  e = this.carModel.clone();
461
467
  break;
462
468
  }
463
- const t = this.materialMap.get(i.vehicleColor) || this.defaultMaterial;
464
- let s = !1;
465
- e.traverse((a) => {
466
- !s && a instanceof l.Mesh && (a.material = t, s = !0);
469
+ const t = this.materialMap.get(s.vehicleColor) || this.defaultMaterial;
470
+ let i = !1;
471
+ e.traverse((o) => {
472
+ !i && o instanceof a.Mesh && (o.material = t, i = !0);
467
473
  });
468
474
  }
469
475
  return e;
@@ -472,71 +478,71 @@ class I {
472
478
  /**
473
479
  * 创建号牌canvas
474
480
  * */
475
- createCanvas(i, e, t) {
476
- const s = document.createElement("canvas"), a = i.width, n = i.height;
477
- s.width = a, s.height = n;
478
- const o = s.getContext("2d");
479
- if (!o) {
481
+ createCanvas(s, e, t) {
482
+ const i = document.createElement("canvas"), o = s.width, n = s.height;
483
+ i.width = o, i.height = n;
484
+ const r = i.getContext("2d");
485
+ if (!r) {
480
486
  console.log("canvas创建失败");
481
487
  return;
482
488
  }
483
- return o.fillStyle = "rgba(0,0,0,0.0)", o.fillRect(0, 0, a, n), o.drawImage(i, 0, 0, a, n), o.beginPath(), o.translate(a / 2, n / 2), o.fillStyle = t, o.font = "bold 32px 宋体", o.textBaseline = "middle", o.textAlign = "center", o.fillText(e, 0, 0), s;
489
+ return r.fillStyle = "rgba(0,0,0,0.0)", r.fillRect(0, 0, o, n), r.drawImage(s, 0, 0, o, n), r.beginPath(), r.translate(o / 2, n / 2), r.fillStyle = t, r.font = "bold 32px 宋体", r.textBaseline = "middle", r.textAlign = "center", r.fillText(e, 0, 0), i;
484
490
  }
485
- createPlateSprite(i) {
491
+ createPlateSprite(s) {
486
492
  return new Promise((e, t) => {
487
- var h, r;
488
- const s = !i.plateNo || i.plateNo === "0" || i.plateNo === "000000";
489
- if (this.currentSpriteContent === m.None || this.currentSpriteContent === m.PlateNumber && s) {
493
+ var h, l;
494
+ const i = !s.plateNo || s.plateNo === "0" || s.plateNo === "000000";
495
+ if (this.currentSpriteContent === m.None || this.currentSpriteContent === m.PlateNumber && i) {
490
496
  e(void 0);
491
497
  return;
492
498
  }
493
- let a = new Image(), n = "", o = "";
499
+ let o = new Image(), n = "", r = "";
494
500
  if (this.currentSpriteContent === m.PlateNumber || this.currentSpriteContent === m.Mix)
495
- if (s)
496
- a = this.greyPlateBG, n = i.ptcId, o = "#ffffff";
501
+ if (i)
502
+ o = this.greyPlateBG, n = s.ptcId, r = "#ffffff";
497
503
  else
498
- switch (n = ((h = i.showName) == null ? void 0 : h.substring(0, 2)) + "•" + ((r = i.showName) == null ? void 0 : r.substring(2)), i.plateColor) {
504
+ switch (n = ((h = s.showName) == null ? void 0 : h.substring(0, 2)) + "•" + ((l = s.showName) == null ? void 0 : l.substring(2)), s.plateColor) {
499
505
  case 1:
500
- a = this.bluePlateBG, o = "#ffffff";
506
+ o = this.bluePlateBG, r = "#ffffff";
501
507
  break;
502
508
  case 2:
503
- a = this.yellowPlateBG, o = "#000000";
509
+ o = this.yellowPlateBG, r = "#000000";
504
510
  break;
505
511
  case 3:
506
- a = this.whitePlateBG, o = "#000000";
512
+ o = this.whitePlateBG, r = "#000000";
507
513
  break;
508
514
  case 4:
509
- a = this.blackPlateBG, o = "#ffffff";
515
+ o = this.blackPlateBG, r = "#ffffff";
510
516
  break;
511
517
  case 5:
512
- a = this.neoYellowPlateBG, o = "#000000";
518
+ o = this.neoYellowPlateBG, r = "#000000";
513
519
  break;
514
520
  case 6:
515
- a = this.neoGreenPlateBG, o = "#000000";
521
+ o = this.neoGreenPlateBG, r = "#000000";
516
522
  break;
517
523
  default:
518
- a = this.greyPlateBG, n = i.plateNo, o = "#ffffff";
524
+ o = this.greyPlateBG, n = s.plateNo, r = "#ffffff";
519
525
  break;
520
526
  }
521
527
  else
522
- this.currentSpriteContent === m.Id && (a = this.greyPlateBG, n = i.ptcId, o = "#ffffff");
523
- const d = this.createCanvas(a, n, o);
528
+ this.currentSpriteContent === m.Id && (o = this.greyPlateBG, n = s.ptcId, r = "#ffffff");
529
+ const d = this.createCanvas(o, n, r);
524
530
  if (d) {
525
- const p = new l.CanvasTexture(d), c = new l.SpriteMaterial({
531
+ const p = new a.CanvasTexture(d), c = new a.SpriteMaterial({
526
532
  map: p,
527
533
  transparent: !1
528
- }), g = new l.Sprite(c), f = 0.05, w = d.width * f, M = d.height * f;
529
- g.scale.set(w, M, 1), g.name = "VehiclePlate", e(g);
534
+ }), g = new a.Sprite(c), f = 0.05, w = d.width * f, b = d.height * f;
535
+ g.scale.set(w, b, 1), g.name = "VehiclePlate", e(g);
530
536
  } else {
531
537
  t("canvas创建失败");
532
538
  return;
533
539
  }
534
- a.onerror = (p) => {
535
- console.log(`号牌背景加载失败: ${a.src}`, p), t(p);
540
+ o.onerror = (p) => {
541
+ console.log(`号牌背景加载失败: ${o.src}`, p), t(p);
536
542
  };
537
543
  });
538
544
  }
539
545
  }
540
546
  export {
541
- I as default
547
+ R as default
542
548
  };
@@ -5,6 +5,7 @@ interface ICross {
5
5
  latitude: number;
6
6
  longitude: number;
7
7
  signalId: string;
8
+ isKey: boolean;
8
9
  }
9
10
  export default class DistrictController {
10
11
  id: string;
@@ -16,7 +16,8 @@ class i {
16
16
  parentId: s.parentId,
17
17
  latitude: Number(s.latitude),
18
18
  longitude: Number(s.longitude),
19
- signalId: s.signalId
19
+ signalId: s.signalId,
20
+ isKey: s.isKey === 1
20
21
  };
21
22
  this.crosses.push(o), this.crossCount++;
22
23
  }
@@ -1,10 +1,10 @@
1
- import * as m from "@arcgis/core/core/reactiveUtils.js";
2
- import n from "@arcgis/core/Graphic";
1
+ import * as g from "@arcgis/core/core/reactiveUtils.js";
2
+ import h from "@arcgis/core/Graphic";
3
3
  import a from "@arcgis/core/layers/GraphicsLayer";
4
- import u from "@turf/buffer";
4
+ import m from "@turf/buffer";
5
5
  import d from "@turf/convex";
6
- import * as c from "@turf/helpers";
7
- import p from "./district-controller.mjs";
6
+ import * as l from "@turf/helpers";
7
+ import b from "./district-controller.mjs";
8
8
  class C {
9
9
  constructor(e) {
10
10
  this.crossScale = 3e3, this.view = e, this.view.popup.visibleElements = {
@@ -35,48 +35,51 @@ class C {
35
35
  showSignalControlArea(e) {
36
36
  this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
37
37
  for (const t of e) {
38
- const r = new p(t);
38
+ const r = new b(t);
39
39
  this.drawArea(r, !0);
40
40
  }
41
- return this.watchHandle = m.watch(
41
+ return this.watchHandle = g.watch(
42
42
  () => this.view.scale,
43
43
  (t, r) => {
44
- if (t > this.crossScale && r <= this.crossScale)
45
- this.crossLayer.graphics.forEach((s) => {
46
- s.symbol = {
47
- type: "simple-marker",
48
- color: s.getAttribute("color"),
49
- size: 8,
50
- outline: {
51
- color: "white",
52
- width: 1
53
- }
54
- };
55
- }), this.highlightLayer.graphics.forEach((s) => {
56
- s.getAttribute("type") === "cross" && (s.symbol = {
57
- type: "simple-marker",
58
- color: s.getAttribute("color"),
59
- size: 8,
60
- outline: {
61
- color: "white",
62
- width: 1
63
- }
64
- });
44
+ t > this.crossScale && r <= this.crossScale ? (this.crossLayer.graphics.forEach((i) => {
45
+ i.symbol = {
46
+ type: "simple-marker",
47
+ style: i.getAttribute("isKey") ? "diamond" : "circle",
48
+ color: i.getAttribute("color"),
49
+ size: i.getAttribute("isKey") ? 16 : 8,
50
+ outline: {
51
+ color: i.getAttribute("isKey") ? "red" : "white",
52
+ width: i.getAttribute("isKey") ? 2 : 1
53
+ }
54
+ };
55
+ }), this.highlightLayer.graphics.forEach((i) => {
56
+ i.getAttribute("type") === "cross" && (i.symbol = {
57
+ type: "simple-marker",
58
+ style: i.getAttribute("isKey") ? "diamond" : "circle",
59
+ color: i.getAttribute("color"),
60
+ size: i.getAttribute("isKey") ? 16 : 8,
61
+ outline: {
62
+ color: i.getAttribute("isKey") ? "red" : "white",
63
+ width: i.getAttribute("isKey") ? 2 : 1
64
+ }
65
65
  });
66
- else if (t <= this.crossScale && r > this.crossScale) {
67
- const s = {
66
+ })) : t <= this.crossScale && r > this.crossScale && (this.crossLayer.graphics.forEach((i) => {
67
+ i.symbol = {
68
68
  type: "picture-marker",
69
- url: "/GisViewerAssets/Images/xhj_1.png",
70
- width: "37px",
71
- height: "57px",
72
- yoffset: "25px"
69
+ url: `/GisViewerAssets/Images/xhj_${i.getAttribute("isKey") ? 4 : 1}.png`,
70
+ width: i.getAttribute("isKey") ? "55px" : "37px",
71
+ height: i.getAttribute("isKey") ? "85px" : "57px",
72
+ yoffset: i.getAttribute("isKey") ? "37px" : "25px"
73
73
  };
74
- this.crossLayer.graphics.forEach((i) => {
75
- i.symbol = s;
76
- }), this.highlightLayer.graphics.forEach((i) => {
77
- i.getAttribute("type") === "cross" && (i.symbol = s);
74
+ }), this.highlightLayer.graphics.forEach((i) => {
75
+ i.getAttribute("type") === "cross" && (i.symbol = {
76
+ type: "picture-marker",
77
+ url: `/GisViewerAssets/Images/xhj_${i.getAttribute("isKey") ? 4 : 1}.png`,
78
+ width: i.getAttribute("isKey") ? "55px" : "37px",
79
+ height: i.getAttribute("isKey") ? "85px" : "57px",
80
+ yoffset: i.getAttribute("isKey") ? "37px" : "25px"
78
81
  });
79
- }
82
+ }));
80
83
  }
81
84
  ), { status: 0, message: "ok" };
82
85
  }
@@ -101,13 +104,13 @@ class C {
101
104
  }
102
105
  async highlightSignalControlArea(e) {
103
106
  this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.crossLayer.visible = !1;
104
- const t = this.districtControllerLayer.graphics.filter((i) => i.getAttribute("id") === e.id).toArray().map((i) => i.clone()), r = this.subDistrictControllerLayer.graphics.filter(
105
- (i) => i.getAttribute("id") === e.id || i.getAttribute("parentId") === e.id
106
- ).toArray().map((i) => i.clone()), s = this.crossLayer.graphics.filter(
107
- (i) => i.getAttribute("id") === e.id || i.getAttribute("districtId") === e.id || i.getAttribute("subDistrictId") === e.id
108
- ).toArray().map((i) => i.clone());
109
- return t.length > 0 && this.highlightLayer.addMany(t), r.length > 0 && this.highlightLayer.addMany(r), s.length > 0 && this.highlightLayer.addMany(s), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (t.length > 0 ? await this.view.goTo(t) : r.length > 0 ? await this.view.goTo(r) : s.length > 1 ? await this.view.goTo(s) : await this.view.goTo({
110
- target: s[0].geometry,
107
+ const t = this.districtControllerLayer.graphics.filter((s) => s.getAttribute("id") === e.id).toArray().map((s) => s.clone()), r = this.subDistrictControllerLayer.graphics.filter(
108
+ (s) => s.getAttribute("id") === e.id || s.getAttribute("parentId") === e.id
109
+ ).toArray().map((s) => s.clone()), i = this.crossLayer.graphics.filter(
110
+ (s) => s.getAttribute("id") === e.id || s.getAttribute("districtId") === e.id || s.getAttribute("subDistrictId") === e.id
111
+ ).toArray().map((s) => s.clone());
112
+ return t.length > 0 && this.highlightLayer.addMany(t), r.length > 0 && this.highlightLayer.addMany(r), i.length > 0 && this.highlightLayer.addMany(i), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (t.length > 0 ? await this.view.goTo(t) : r.length > 0 ? await this.view.goTo(r) : i.length > 1 ? await this.view.goTo(i) : await this.view.goTo({
113
+ target: i[0].geometry,
111
114
  scale: 1500
112
115
  }), { status: 0, message: "ok" });
113
116
  }
@@ -135,14 +138,20 @@ class C {
135
138
  */
136
139
  drawArea(e, t) {
137
140
  const r = e.getAllCrossCoordinates();
138
- if (r.length > 2) {
139
- const i = c.featureCollection(
140
- r.map((y) => c.point(y))
141
- ), l = d(i);
142
- if (!l)
141
+ if (r.length >= 2) {
142
+ let s = null;
143
+ if (r.length === 2)
144
+ s = l.lineString(r);
145
+ else if (r.length > 2) {
146
+ const u = l.featureCollection(
147
+ r.map((c) => l.point(c))
148
+ );
149
+ s = d(u);
150
+ }
151
+ if (!s)
143
152
  return;
144
- const g = u(
145
- l.geometry,
153
+ const y = m(
154
+ s.geometry,
146
155
  // 区控面积更大,需要更大的缓冲半径
147
156
  t ? 200 : 30,
148
157
  {
@@ -166,21 +175,17 @@ class C {
166
175
  ] : o = [
167
176
  {
168
177
  fieldName: "parentName",
169
- label: "区控名称"
170
- },
171
- {
172
- fieldName: "id",
173
- label: "子区编号"
178
+ label: "所属区控"
174
179
  },
175
180
  {
176
181
  fieldName: "crossCount",
177
182
  label: "路口数量"
178
183
  }
179
184
  ];
180
- const h = new n({
185
+ const n = new h({
181
186
  geometry: {
182
187
  type: "polygon",
183
- rings: g.geometry.coordinates
188
+ rings: y.geometry.coordinates
184
189
  },
185
190
  symbol: {
186
191
  type: "simple-fill",
@@ -201,7 +206,7 @@ class C {
201
206
  subDistrictCount: e.subDistrictCount
202
207
  },
203
208
  popupTemplate: {
204
- title: e.name,
209
+ title: `${t ? "区控" : "子区"} ${e.name}`,
205
210
  content: [
206
211
  {
207
212
  type: "fields",
@@ -210,38 +215,40 @@ class C {
210
215
  ]
211
216
  }
212
217
  });
213
- t ? this.districtControllerLayer.add(h) : this.subDistrictControllerLayer.add(h);
218
+ t ? this.districtControllerLayer.add(n) : this.subDistrictControllerLayer.add(n);
214
219
  }
215
- for (const i of e.subDistricts)
216
- this.drawArea(i, !1);
217
- const s = e.crosses.map((i) => new n({
220
+ for (const s of e.subDistricts)
221
+ this.drawArea(s, !1);
222
+ const i = e.crosses.map((s) => new h({
218
223
  geometry: {
219
224
  type: "point",
220
- x: i.longitude,
221
- y: i.latitude
225
+ x: s.longitude,
226
+ y: s.latitude
222
227
  },
223
228
  symbol: {
224
229
  type: "simple-marker",
230
+ style: s.isKey ? "diamond" : "circle",
225
231
  color: e.areaColor,
226
- size: 8,
232
+ size: s.isKey ? 16 : 8,
227
233
  outline: {
228
- color: "white",
229
- width: 1
234
+ color: s.isKey ? "red" : "white",
235
+ width: s.isKey ? 2 : 1
230
236
  }
231
237
  },
232
238
  attributes: {
233
239
  type: "cross",
234
- id: i.id,
235
- name: i.name,
240
+ id: s.id,
241
+ name: s.name,
236
242
  color: e.areaColor,
237
- signalId: i.signalId,
243
+ signalId: s.signalId,
238
244
  districtId: t ? e.id : e.parentId,
239
245
  districtName: t ? e.name : e.parentName,
240
246
  subDistrictId: t ? "" : e.id,
241
- subDistrictName: t ? "" : e.name
247
+ subDistrictName: t ? "" : e.name,
248
+ isKey: s.isKey
242
249
  },
243
250
  popupTemplate: {
244
- title: i.name,
251
+ title: s.name,
245
252
  content: [
246
253
  {
247
254
  type: "fields",
@@ -267,7 +274,7 @@ class C {
267
274
  ]
268
275
  }
269
276
  }));
270
- this.crossLayer.addMany(s);
277
+ this.crossLayer.addMany(i);
271
278
  }
272
279
  }
273
280
  export {
@@ -40,7 +40,7 @@ export interface IVehicleTrack {
40
40
  step?: number;
41
41
  }
42
42
  export interface IVehicleRecord {
43
- model: Three.Group | Three.Mesh;
43
+ model: Three.Mesh | Three.Object3D;
44
44
  data: IVehicleTrack;
45
45
  segmentStartTime?: number;
46
46
  segmentTotalTime?: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/core/promiseUtils.js"),y=require("@arcgis/core/core/reactiveUtils.js"),T=require("@arcgis/core/geometry/SpatialReference"),S=require("@arcgis/core/views/3d/externalRenderers"),C=require("three"),G=require("three/examples/jsm/loaders/GLTFLoader"),m=require("../../../types/index.js"),B=require("../../stores/index.js");function f(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const e in u)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(u,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>u[e]})}}return i.default=u,Object.freeze(i)}const R=f(v),I=f(y),M=f(S),l=f(C);class V{constructor(i){this.cameraHeightThreshold=1e3,this.roughness=.2,this.metalness=.8,this.defaultMaterial=new l.MeshPhongMaterial({color:16777215}),this.materialMap=new Map([[1,this.createCarMaterial(16777215)],[2,this.createCarMaterial(7833753)],[3,this.createCarMaterial(16766720)],[4,this.createCarMaterial(16758465)],[5,this.createCarMaterial(14423100)],[6,this.createCarMaterial(3329330)],[7,this.createCarMaterial(2003183)],[8,this.createCarMaterial(16032864)],[9,this.createCarMaterial(2105376)],[10,this.createCarMaterial(9662683)],[99,this.createCarMaterial(6908265)]]),this.isInitialized=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.isPaused=!1,this.currentSpriteContent=m.EVehiclePlateState.None,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.needInterpolate=!0,this.updateModel=!1,this.appDataStore=B.default.useAppDataStore,this.logTable=[["ptcId","plateno","timestamp","localTimestamp","speed","longitude","latitude","ptcType","vehicleType","vehicleColor","plateColor","heading","fixAngle","roadLayer","step","receiveTimestamp","queueLength","status"]],this.assetsRoot=JSON.parse(JSON.stringify(this.appDataStore.mapConfig)).assetsRoot,this.view=i,I.watch(()=>this.view.camera.position.z,(e,t)=>{(t<=this.cameraHeightThreshold&&e>this.cameraHeightThreshold||t>this.cameraHeightThreshold&&e<=this.cameraHeightThreshold)&&(this.updateModel=!0)})}createCarMaterial(i){return new l.MeshPhongMaterial({color:i})}getLog(){return this.logTable}async init(){const i=new G.GLTFLoader;await R.eachAlways([new Promise(e=>{i.load(`${this.assetsRoot}/3DModels/car.glb`,t=>{this.carModel=t.scene,this.carModel.rotation.x=l.MathUtils.degToRad(90),e()})}),new Promise(e=>{i.load(`${this.assetsRoot}/3DModels/van.glb`,t=>{this.vanModel=t.scene,this.vanModel.rotation.x=l.MathUtils.degToRad(90),e()})}),new Promise(e=>{i.load(`${this.assetsRoot}/3DModels/truck.glb`,t=>{this.truckModel=t.scene,this.truckModel.scale.set(1.2,1,1.5),this.truckModel.rotation.x=l.MathUtils.degToRad(90),e()})}),new Promise(e=>{i.load(`${this.assetsRoot}/3DModels/bus.glb`,t=>{this.busModel=t.scene,this.busModel.rotation.x=l.MathUtils.degToRad(90),e()})}),new Promise(e=>{i.load(`${this.assetsRoot}/3DModels/bicycle.glb`,t=>{this.bicycleModel=t.scene,this.bicycleModel.rotation.x=l.MathUtils.degToRad(90),this.bicycleModel.rotation.y=l.MathUtils.degToRad(180),e()})}),new Promise(e=>{this.bluePlateBG=new Image,this.bluePlateBG.src=`${this.assetsRoot}/Images/PlateBG/blue.png`,this.bluePlateBG.onload=()=>{e()}}),new Promise(e=>{this.yellowPlateBG=new Image,this.yellowPlateBG.src=`${this.assetsRoot}/Images/PlateBG/yellow.png`,this.yellowPlateBG.onload=()=>{e()}}),new Promise(e=>{this.whitePlateBG=new Image,this.whitePlateBG.src=`${this.assetsRoot}/Images/PlateBG/white.png`,this.whitePlateBG.onload=()=>{e()}}),new Promise(e=>{this.blackPlateBG=new Image,this.blackPlateBG.src=`${this.assetsRoot}/Images/PlateBG/black.png`,this.blackPlateBG.onload=()=>{e()}}),new Promise(e=>{this.neoYellowPlateBG=new Image,this.neoYellowPlateBG.src=`${this.assetsRoot}/Images/PlateBG/neo_yellow.png`,this.neoYellowPlateBG.onload=()=>{e()}}),new Promise(e=>{this.neoGreenPlateBG=new Image,this.neoGreenPlateBG.src=`${this.assetsRoot}/Images/PlateBG/neo_green.png`,this.neoGreenPlateBG.onload=()=>{e()}}),new Promise(e=>{this.greyPlateBG=new Image,this.greyPlateBG.src=`${this.assetsRoot}/Images/PlateBG/grey.png`,this.greyPlateBG.onload=()=>{e()}})]),this.isInitialized=!0}setInterpolate(i){this.clearVehicles(),this.needInterpolate=i}async setup(i){this.context=i,this.renderer=new l.WebGLRenderer({context:i.gl,premultipliedAlpha:!0,logarithmicDepthBuffer:!0,antialias:!0,powerPreference:"high-performance"}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setViewport(0,0,this.view.width,this.view.height),this.renderer.autoClearDepth=!1,this.renderer.autoClearStencil=!1,this.renderer.autoClearColor=!1;const e=this.renderer.setRenderTarget.bind(this.renderer);this.renderer.setRenderTarget=s=>{e(s),s==null&&i.bindRenderTarget()},this.scene=new l.Scene;const{camera:t}=i;this.camera=new l.PerspectiveCamera(t.fovY,t.aspect,.1,1e5),this.ambient=new l.AmbientLight(16777215,2),this.scene.add(this.ambient),this.sun=new l.DirectionalLight(16777215,2),this.scene.add(this.sun),i.resetWebGLState()}async render(i){var s;const e=i.camera;if(this.camera.position.set(e.eye[0],e.eye[1],e.eye[2]),this.camera.up.set(e.up[0],e.up[1],e.up[2]),this.camera.lookAt(new l.Vector3(e.center[0],e.center[1],e.center[2])),this.camera.projectionMatrix.fromArray(e.projectionMatrix),!this.isPaused&&this.needInterpolate)for(const a of this.vehicleObjectMap.keys()){const n=(s=this.vehicleObjectMap.get(a))==null?void 0:s.model;if(!n)continue;const o=this.computeVehiclePosition(a);if(o){const d=this.toRenderCoordinates(o);n.position.set(d[0],d[1],d[2]),n.rotation.y=l.MathUtils.degToRad(-o[3])}}const t=i.sunLight;this.sun.position.set(t.direction[0],t.direction[1],t.direction[2]),this.sun.intensity=t.diffuse.intensity,this.sun.color=new l.Color(t.diffuse.color[0],t.diffuse.color[1],t.diffuse.color[2]),this.ambient.intensity=t.ambient.intensity,this.ambient.color=new l.Color(t.ambient.color[0],t.ambient.color[1],t.ambient.color[2]),this.renderer.resetState(),i.bindRenderTarget(),this.renderer.render(this.scene,this.camera),M.requestRender(this.view),i.resetWebGLState()}async addVehicles(i){if(this.isPaused||!this.isInitialized)return;const e=Date.now();for(const t of i){this.appDataStore.saveTrackLog&&this.logTable.push([t.ptcId,t.plateNo,t.timestamp,t.localTimestamp,t.speed,t.x,t.y,t.ptcType,t.vehicleType,t.vehicleColor,t.plateColor,t.heading,t.fixAngle,t.roadLayer,t.step,e,0,0]);const{vehicleId:s,localTimestamp:a}=t,n=Number(t.x),o=Number(t.y),d=Number(t.heading);this.historyPositionMap.set(s,[{pos:[n,o,0],heading:d,time:a}]);const h=this.getVehicleModel(t);h.name=s,h.visible=!1;try{const r=await this.createPlateSprite(t);r&&(h.add(r),r.position.set(0,5,-4))}catch(r){console.log("createPlateSprite error:",r)}this.scene.add(h),this.vehicleObjectMap.set(s,{model:h,data:t,waitForDelete:!1,isMoving:!1})}}async updateVehicles(i){if(this.isPaused||!this.isInitialized)return;const e=[],t=Date.now();for(const s of i){const{vehicleId:a,localTimestamp:n}=s,o=Number(s.x),d=Number(s.y);let h=Number(s.heading);const r=this.vehicleObjectMap.get(a),p=this.historyPositionMap.get(a);if(!r||!p)e.push(s);else{if(this.appDataStore.saveTrackLog&&this.logTable.push([s.ptcId,s.plateNo,s.timestamp,s.localTimestamp,s.speed,s.x,s.y,s.ptcType,s.vehicleType,s.vehicleColor,s.plateColor,s.heading,s.fixAngle,s.roadLayer,s.step,t,p.length,1]),this.updateModel||r.data.vehicleColor!==s.vehicleColor||r.data.vehicleType!==s.vehicleType){this.scene.remove(r.model),this.disposeModel(r.model),r.model=this.getVehicleModel(s),r.model.visible=!0;const c=await this.createPlateSprite(s);c&&(r.model.add(c),c.position.set(0,5,-4)),this.scene.add(r.model)}if(r.data.showName!==s.showName||r.data.plateColor!==s.plateColor){const c=r.model.getObjectByName("VehiclePlate");c&&(r.model.remove(c),this.disposeModel(c));const g=await this.createPlateSprite(s);g&&(r.model.add(g),g.position.set(0,5,-4))}if(r.data=s,this.needInterpolate){const c=p[p.length-1];Math.abs(h-c.heading)>=180&&(h>c.heading?c.heading+=360:h+=360),p.push({pos:[o,d,0],heading:h,time:n})}else{this.historyPositionMap.set(a,[{pos:[o,d,0],heading:h,time:n}]);const c=this.toRenderCoordinates([o,d,0]);r.model.position.set(c[0],c[1],c[2]),r.model.rotation.y=l.MathUtils.degToRad(-h)}}}await this.addVehicles(e),this.updateModel=!1,this.needInterpolate||this.render(this.context)}toRenderCoordinates(i){const e=[0,0,0];return M.toRenderCoordinates(this.view,i,0,T.WGS84,e,0,1),e}deleteVehicles(i){if(this.isPaused)return;const e=Date.now();i.forEach(t=>{if(this.appDataStore.saveTrackLog){const a=this.historyPositionMap.get(t);this.logTable.push([t,"","","","","","","","","","","","","","",e,a?a.length:0,2])}const s=this.vehicleObjectMap.get(t);s&&(this.needInterpolate?s.isMoving?s.waitForDelete=!0:this.deleteVehicle(s):this.deleteVehicle(s))})}deleteVehicle(i){this.scene.remove(i.model),this.disposeModel(i.model);const e=i.data.vehicleId;this.vehicleObjectMap.delete(e),this.historyPositionMap.delete(e)}async toggleTrafficInfo(i){i.name==="vehiclePlate"&&(i.visible===!0&&this.currentSpriteContent===m.EVehiclePlateState.None?await this.updatePanelContent(m.EVehiclePlateState.PlateNumber):await this.updatePanelContent(i.visible?this.currentSpriteContent:m.EVehiclePlateState.None))}togglePause(i){this.isPaused=i}clearVehicles(){for(const i of this.vehicleObjectMap.keys()){const e=this.vehicleObjectMap.get(i);e&&(this.scene.remove(e.model),this.disposeModel(e.model))}this.vehicleObjectMap.clear(),this.historyPositionMap.clear()}async updatePanelContent(i){if(i!==this.currentSpriteContent){this.currentSpriteContent=i;for(const e of this.vehicleObjectMap.keys()){const t=this.vehicleObjectMap.get(e);if(t){const s=t.model.getObjectByName("VehiclePlate");if(s&&(t.model.remove(s),this.disposeModel(s)),i!==m.EVehiclePlateState.None){const a=await this.createPlateSprite(t.data);a&&(t.model.add(a),a.position.set(0,5,-4))}}}}}toggleGroundVehicle(i){console.log("toggleGroundVehicle",i),this.showGroundVehicle=i}toggleElevatedVehicle(i){this.showElevatedVehicle=i}disposeModel(i){i.traverse(e=>{e instanceof l.Mesh&&(e.geometry.dispose(),e.material.dispose())})}computeVehiclePosition(i){const e=this.historyPositionMap.get(i),t=this.vehicleObjectMap.get(i);if(!t||!e||!t.isMoving&&e.length<=2)return;const s=Date.now();t.isMoving=!0,t.data.roadLayer==="1"?t.model.visible=this.showGroundVehicle:t.model.visible=this.showElevatedVehicle,t.segmentStartTime||(t.segmentStartTime=s,t.segmentTotalTime=e[1].time-e[0].time);const a=s-t.segmentStartTime,n=Math.min(a/t.segmentTotalTime,1);if(n===1)if(e.shift(),e.length===1){t.waitForDelete===!0?this.deleteVehicle(t):(t.segmentStartTime=void 0,t.segmentTotalTime=void 0,t.model.visible=!1,t.isMoving=!1,console.log("hide vehicle",i));return}else{t.segmentStartTime=Date.now();const o=a-t.segmentTotalTime;return t.segmentTotalTime=e[1].time-e[0].time-o,(e[1].heading>=270&&e[0].heading<=90||e[1].heading<=90&&e[0].heading>=270)&&(e[1].heading>e[0].heading?e[0].heading+=360:e[1].heading+=360),e[0].pos.concat(e[0].heading)}else if(e.length>=2){const o=e[0].pos[0]+(e[1].pos[0]-e[0].pos[0])*n,d=e[0].pos[1]+(e[1].pos[1]-e[0].pos[1])*n,h=e[0].heading+(e[1].heading-e[0].heading)*n;return[o,d,0,h]}else return}getVehicleModel(i){if(this.view.camera.position.z>=this.cameraHeightThreshold){const e=new l.SphereGeometry(5,32,32),t=new l.MeshPhysicalMaterial({color:325253,emissive:0,roughness:this.roughness,metalness:this.metalness});return new l.Mesh(e,t)}else{let e;if(i.ptcType===2)e=this.bicycleModel.clone();else{switch(i.vehicleType){case 10:e=this.carModel.clone();break;case 20:e=this.vanModel.clone();break;case 25:e=this.truckModel.clone();break;case 50:e=this.busModel.clone();break;default:e=this.carModel.clone();break}const t=this.materialMap.get(i.vehicleColor)||this.defaultMaterial;let s=!1;e.traverse(a=>{!s&&a instanceof l.Mesh&&(a.material=t,s=!0)})}return e}}createCanvas(i,e,t){const s=document.createElement("canvas"),a=i.width,n=i.height;s.width=a,s.height=n;const o=s.getContext("2d");if(!o){console.log("canvas创建失败");return}return o.fillStyle="rgba(0,0,0,0.0)",o.fillRect(0,0,a,n),o.drawImage(i,0,0,a,n),o.beginPath(),o.translate(a/2,n/2),o.fillStyle=t,o.font="bold 32px 宋体",o.textBaseline="middle",o.textAlign="center",o.fillText(e,0,0),s}createPlateSprite(i){return new Promise((e,t)=>{var h,r;const s=!i.plateNo||i.plateNo==="0"||i.plateNo==="000000";if(this.currentSpriteContent===m.EVehiclePlateState.None||this.currentSpriteContent===m.EVehiclePlateState.PlateNumber&&s){e(void 0);return}let a=new Image,n="",o="";if(this.currentSpriteContent===m.EVehiclePlateState.PlateNumber||this.currentSpriteContent===m.EVehiclePlateState.Mix)if(s)a=this.greyPlateBG,n=i.ptcId,o="#ffffff";else switch(n=((h=i.showName)==null?void 0:h.substring(0,2))+"•"+((r=i.showName)==null?void 0:r.substring(2)),i.plateColor){case 1:a=this.bluePlateBG,o="#ffffff";break;case 2:a=this.yellowPlateBG,o="#000000";break;case 3:a=this.whitePlateBG,o="#000000";break;case 4:a=this.blackPlateBG,o="#ffffff";break;case 5:a=this.neoYellowPlateBG,o="#000000";break;case 6:a=this.neoGreenPlateBG,o="#000000";break;default:a=this.greyPlateBG,n=i.plateNo,o="#ffffff";break}else this.currentSpriteContent===m.EVehiclePlateState.Id&&(a=this.greyPlateBG,n=i.ptcId,o="#ffffff");const d=this.createCanvas(a,n,o);if(d){const p=new l.CanvasTexture(d),c=new l.SpriteMaterial({map:p,transparent:!1}),g=new l.Sprite(c),P=.05,w=d.width*P,b=d.height*P;g.scale.set(w,b,1),g.name="VehiclePlate",e(g)}else{t("canvas创建失败");return}a.onerror=p=>{console.log(`号牌背景加载失败: ${a.src}`,p),t(p)}})}}exports.default=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/core/promiseUtils.js"),y=require("@arcgis/core/core/reactiveUtils.js"),T=require("@arcgis/core/geometry/SpatialReference"),S=require("@arcgis/core/views/3d/externalRenderers"),C=require("three"),G=require("three/examples/jsm/loaders/GLTFLoader"),m=require("../../../types/index.js"),B=require("../../stores/index.js");function f(u){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const e in u)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(u,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>u[e]})}}return s.default=u,Object.freeze(s)}const x=f(v),V=f(y),w=f(S),o=f(C);class R{constructor(s){this.cameraHeightThreshold=1e3,this.roughness=.2,this.metalness=.8,this.defaultMaterial=new o.MeshPhongMaterial({color:16777215}),this.materialMap=new Map([[1,this.createCarMaterial(16777215)],[2,this.createCarMaterial(7833753)],[3,this.createCarMaterial(16766720)],[4,this.createCarMaterial(16758465)],[5,this.createCarMaterial(14423100)],[6,this.createCarMaterial(3329330)],[7,this.createCarMaterial(2003183)],[8,this.createCarMaterial(16032864)],[9,this.createCarMaterial(2105376)],[10,this.createCarMaterial(9662683)],[99,this.createCarMaterial(6908265)]]),this.isInitialized=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.isPaused=!1,this.currentSpriteContent=m.EVehiclePlateState.None,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.needInterpolate=!0,this.updateModel=!1,this.appDataStore=B.default.useAppDataStore,this.logTable=[["ptcId","plateno","timestamp","localTimestamp","speed","longitude","latitude","ptcType","vehicleType","vehicleColor","plateColor","heading","fixAngle","roadLayer","step","receiveTimestamp","queueLength","status"]],this.assetsRoot=JSON.parse(JSON.stringify(this.appDataStore.mapConfig)).assetsRoot,this.view=s,V.watch(()=>this.view.camera.position.z,(e,t)=>{(t<=this.cameraHeightThreshold&&e>this.cameraHeightThreshold||t>this.cameraHeightThreshold&&e<=this.cameraHeightThreshold)&&(this.updateModel=!0)})}createCarMaterial(s){return new o.MeshPhongMaterial({color:s})}getLog(){return this.logTable}async init(){const s=new G.GLTFLoader;await x.eachAlways([new Promise(e=>{s.load(`${this.assetsRoot}/3DModels/car.glb`,t=>{const i=t.scene,n=new o.Box3().setFromObject(i).getSize(new o.Vector3);this.carModel=new o.Object3D,this.carModel.rotation.x=o.MathUtils.degToRad(90),this.carModel.add(i),i.position.set(0,0,n.z/2),e()})}),new Promise(e=>{s.load(`${this.assetsRoot}/3DModels/van.glb`,t=>{const i=t.scene,n=new o.Box3().setFromObject(i).getSize(new o.Vector3);this.vanModel=new o.Object3D,this.vanModel.rotation.x=o.MathUtils.degToRad(90),this.vanModel.add(i),i.position.set(0,0,n.z/2),e()})}),new Promise(e=>{s.load(`${this.assetsRoot}/3DModels/truck.glb`,t=>{const i=t.scene;i.scale.set(1.2,1,1.5);const n=new o.Box3().setFromObject(i).getSize(new o.Vector3);this.truckModel=new o.Object3D,this.truckModel.rotation.x=o.MathUtils.degToRad(90),this.truckModel.add(i),i.position.set(0,0,n.z/2),e()})}),new Promise(e=>{s.load(`${this.assetsRoot}/3DModels/bus.glb`,t=>{const i=t.scene,n=new o.Box3().setFromObject(i).getSize(new o.Vector3);this.busModel=new o.Object3D,this.busModel.rotation.x=o.MathUtils.degToRad(90),this.busModel.add(i),i.position.set(0,0,n.z/2),e()})}),new Promise(e=>{s.load(`${this.assetsRoot}/3DModels/bicycle.glb`,t=>{this.bicycleModel=t.scene,this.bicycleModel.rotation.x=o.MathUtils.degToRad(90),this.bicycleModel.rotation.y=o.MathUtils.degToRad(180),e()})}),new Promise(e=>{this.bluePlateBG=new Image,this.bluePlateBG.src=`${this.assetsRoot}/Images/PlateBG/blue.png`,this.bluePlateBG.onload=()=>{e()}}),new Promise(e=>{this.yellowPlateBG=new Image,this.yellowPlateBG.src=`${this.assetsRoot}/Images/PlateBG/yellow.png`,this.yellowPlateBG.onload=()=>{e()}}),new Promise(e=>{this.whitePlateBG=new Image,this.whitePlateBG.src=`${this.assetsRoot}/Images/PlateBG/white.png`,this.whitePlateBG.onload=()=>{e()}}),new Promise(e=>{this.blackPlateBG=new Image,this.blackPlateBG.src=`${this.assetsRoot}/Images/PlateBG/black.png`,this.blackPlateBG.onload=()=>{e()}}),new Promise(e=>{this.neoYellowPlateBG=new Image,this.neoYellowPlateBG.src=`${this.assetsRoot}/Images/PlateBG/neo_yellow.png`,this.neoYellowPlateBG.onload=()=>{e()}}),new Promise(e=>{this.neoGreenPlateBG=new Image,this.neoGreenPlateBG.src=`${this.assetsRoot}/Images/PlateBG/neo_green.png`,this.neoGreenPlateBG.onload=()=>{e()}}),new Promise(e=>{this.greyPlateBG=new Image,this.greyPlateBG.src=`${this.assetsRoot}/Images/PlateBG/grey.png`,this.greyPlateBG.onload=()=>{e()}})]),this.isInitialized=!0}setInterpolate(s){this.clearVehicles(),this.needInterpolate=s}async setup(s){this.context=s,this.renderer=new o.WebGLRenderer({context:s.gl,premultipliedAlpha:!0,logarithmicDepthBuffer:!0,antialias:!0,powerPreference:"high-performance"}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setViewport(0,0,this.view.width,this.view.height),this.renderer.autoClearDepth=!1,this.renderer.autoClearStencil=!1,this.renderer.autoClearColor=!1;const e=this.renderer.setRenderTarget.bind(this.renderer);this.renderer.setRenderTarget=i=>{e(i),i==null&&s.bindRenderTarget()},this.scene=new o.Scene;const{camera:t}=s;this.camera=new o.PerspectiveCamera(t.fovY,t.aspect,.1,1e5),this.ambient=new o.AmbientLight(16777215,2),this.scene.add(this.ambient),this.sun=new o.DirectionalLight(16777215,2),this.scene.add(this.sun),s.resetWebGLState()}async render(s){var i;const e=s.camera;if(this.camera.position.set(e.eye[0],e.eye[1],e.eye[2]),this.camera.up.set(e.up[0],e.up[1],e.up[2]),this.camera.lookAt(new o.Vector3(e.center[0],e.center[1],e.center[2])),this.camera.projectionMatrix.fromArray(e.projectionMatrix),!this.isPaused&&this.needInterpolate)for(const a of this.vehicleObjectMap.keys()){const n=(i=this.vehicleObjectMap.get(a))==null?void 0:i.model;if(!n)continue;const r=this.computeVehiclePosition(a);if(r){const d=this.toRenderCoordinates(r);n.position.set(d[0],d[1],d[2]),n.rotation.y=o.MathUtils.degToRad(-r[3])}}const t=s.sunLight;this.sun.position.set(t.direction[0],t.direction[1],t.direction[2]),this.sun.intensity=t.diffuse.intensity,this.sun.color=new o.Color(t.diffuse.color[0],t.diffuse.color[1],t.diffuse.color[2]),this.ambient.intensity=t.ambient.intensity,this.ambient.color=new o.Color(t.ambient.color[0],t.ambient.color[1],t.ambient.color[2]),this.renderer.resetState(),s.bindRenderTarget(),this.renderer.render(this.scene,this.camera),w.requestRender(this.view),s.resetWebGLState()}async addVehicles(s){if(this.isPaused||!this.isInitialized)return;const e=Date.now();for(const t of s){this.appDataStore.saveTrackLog&&this.logTable.push([t.ptcId,t.plateNo,t.timestamp,t.localTimestamp,t.speed,t.x,t.y,t.ptcType,t.vehicleType,t.vehicleColor,t.plateColor,t.heading,t.fixAngle,t.roadLayer,t.step,e,0,0]);const{vehicleId:i,localTimestamp:a}=t,n=Number(t.x),r=Number(t.y),d=Number(t.heading);this.historyPositionMap.set(i,[{pos:[n,r,0],heading:d,time:a}]);const h=this.getVehicleModel(t);h.name=i,h.visible=!1;try{const l=await this.createPlateSprite(t);l&&(h.add(l),l.position.set(0,5,-4))}catch(l){console.log("createPlateSprite error:",l)}this.scene.add(h),this.vehicleObjectMap.set(i,{model:h,data:t,waitForDelete:!1,isMoving:!1})}}async updateVehicles(s){if(this.isPaused||!this.isInitialized)return;const e=[],t=Date.now();for(const i of s){const{vehicleId:a,localTimestamp:n}=i,r=Number(i.x),d=Number(i.y);let h=Number(i.heading);const l=this.vehicleObjectMap.get(a),p=this.historyPositionMap.get(a);if(!l||!p)e.push(i);else{if(this.appDataStore.saveTrackLog&&this.logTable.push([i.ptcId,i.plateNo,i.timestamp,i.localTimestamp,i.speed,i.x,i.y,i.ptcType,i.vehicleType,i.vehicleColor,i.plateColor,i.heading,i.fixAngle,i.roadLayer,i.step,t,p.length,1]),this.updateModel||l.data.vehicleColor!==i.vehicleColor||l.data.vehicleType!==i.vehicleType){this.scene.remove(l.model),this.disposeModel(l.model),l.model=this.getVehicleModel(i),l.model.visible=!0;const c=await this.createPlateSprite(i);c&&(l.model.add(c),c.position.set(0,5,-4)),this.scene.add(l.model)}if(l.data.showName!==i.showName||l.data.plateColor!==i.plateColor){const c=l.model.getObjectByName("VehiclePlate");c&&(l.model.remove(c),this.disposeModel(c));const g=await this.createPlateSprite(i);g&&(l.model.add(g),g.position.set(0,5,-4))}if(l.data=i,this.needInterpolate){const c=p[p.length-1];Math.abs(h-c.heading)>=180&&(h>c.heading?c.heading+=360:h+=360),p.push({pos:[r,d,0],heading:h,time:n})}else{this.historyPositionMap.set(a,[{pos:[r,d,0],heading:h,time:n}]);const c=this.toRenderCoordinates([r,d,0]);l.model.position.set(c[0],c[1],c[2]),l.model.rotation.y=o.MathUtils.degToRad(-h)}}}await this.addVehicles(e),this.updateModel=!1,this.needInterpolate||this.render(this.context)}toRenderCoordinates(s){const e=[0,0,0];return w.toRenderCoordinates(this.view,s,0,T.WGS84,e,0,1),e}deleteVehicles(s){if(this.isPaused)return;const e=Date.now();s.forEach(t=>{if(this.appDataStore.saveTrackLog){const a=this.historyPositionMap.get(t);this.logTable.push([t,"","","","","","","","","","","","","","",e,a?a.length:0,2])}const i=this.vehicleObjectMap.get(t);i&&(this.needInterpolate?i.isMoving?i.waitForDelete=!0:this.deleteVehicle(i):this.deleteVehicle(i))})}deleteVehicle(s){this.scene.remove(s.model),this.disposeModel(s.model);const e=s.data.vehicleId;this.vehicleObjectMap.delete(e),this.historyPositionMap.delete(e)}async toggleTrafficInfo(s){s.name==="vehiclePlate"&&(s.visible===!0&&this.currentSpriteContent===m.EVehiclePlateState.None?await this.updatePanelContent(m.EVehiclePlateState.PlateNumber):await this.updatePanelContent(s.visible?this.currentSpriteContent:m.EVehiclePlateState.None))}togglePause(s){this.isPaused=s}clearVehicles(){for(const s of this.vehicleObjectMap.keys()){const e=this.vehicleObjectMap.get(s);e&&(this.scene.remove(e.model),this.disposeModel(e.model))}this.vehicleObjectMap.clear(),this.historyPositionMap.clear()}async updatePanelContent(s){if(s!==this.currentSpriteContent){this.currentSpriteContent=s;for(const e of this.vehicleObjectMap.keys()){const t=this.vehicleObjectMap.get(e);if(t){const i=t.model.getObjectByName("VehiclePlate");if(i&&(t.model.remove(i),this.disposeModel(i)),s!==m.EVehiclePlateState.None){const a=await this.createPlateSprite(t.data);a&&(t.model.add(a),a.position.set(0,5,-4))}}}}}toggleGroundVehicle(s){console.log("toggleGroundVehicle",s),this.showGroundVehicle=s}toggleElevatedVehicle(s){this.showElevatedVehicle=s}disposeModel(s){s.traverse(e=>{e instanceof o.Mesh&&(e.geometry.dispose(),e.material.dispose())})}computeVehiclePosition(s){const e=this.historyPositionMap.get(s),t=this.vehicleObjectMap.get(s);if(!t||!e||!t.isMoving&&e.length<=2)return;const i=Date.now();t.isMoving=!0,t.data.roadLayer==="1"?t.model.visible=this.showGroundVehicle:t.model.visible=this.showElevatedVehicle,t.segmentStartTime||(t.segmentStartTime=i,t.segmentTotalTime=e[1].time-e[0].time);const a=i-t.segmentStartTime,n=Math.min(a/t.segmentTotalTime,1);if(n===1)if(e.shift(),e.length===1){t.waitForDelete===!0?this.deleteVehicle(t):(t.segmentStartTime=void 0,t.segmentTotalTime=void 0,t.model.visible=!1,t.isMoving=!1,console.log("hide vehicle",s));return}else{t.segmentStartTime=Date.now();const r=a-t.segmentTotalTime;return t.segmentTotalTime=e[1].time-e[0].time-r,(e[1].heading>=270&&e[0].heading<=90||e[1].heading<=90&&e[0].heading>=270)&&(e[1].heading>e[0].heading?e[0].heading+=360:e[1].heading+=360),e[0].pos.concat(e[0].heading)}else if(e.length>=2){const r=e[0].pos[0]+(e[1].pos[0]-e[0].pos[0])*n,d=e[0].pos[1]+(e[1].pos[1]-e[0].pos[1])*n,h=e[0].heading+(e[1].heading-e[0].heading)*n;return[r,d,0,h]}else return}getVehicleModel(s){if(this.view.camera.position.z>=this.cameraHeightThreshold){const e=new o.SphereGeometry(5,32,32),t=new o.MeshPhysicalMaterial({color:325253,emissive:0,roughness:this.roughness,metalness:this.metalness});return new o.Mesh(e,t)}else{let e;if(s.ptcType===2)e=this.bicycleModel.clone();else{switch(s.vehicleType){case 10:e=this.carModel.clone();break;case 20:e=this.vanModel.clone();break;case 25:e=this.truckModel.clone();break;case 50:e=this.busModel.clone();break;default:e=this.carModel.clone();break}const t=this.materialMap.get(s.vehicleColor)||this.defaultMaterial;let i=!1;e.traverse(a=>{!i&&a instanceof o.Mesh&&(a.material=t,i=!0)})}return e}}createCanvas(s,e,t){const i=document.createElement("canvas"),a=s.width,n=s.height;i.width=a,i.height=n;const r=i.getContext("2d");if(!r){console.log("canvas创建失败");return}return r.fillStyle="rgba(0,0,0,0.0)",r.fillRect(0,0,a,n),r.drawImage(s,0,0,a,n),r.beginPath(),r.translate(a/2,n/2),r.fillStyle=t,r.font="bold 32px 宋体",r.textBaseline="middle",r.textAlign="center",r.fillText(e,0,0),i}createPlateSprite(s){return new Promise((e,t)=>{var h,l;const i=!s.plateNo||s.plateNo==="0"||s.plateNo==="000000";if(this.currentSpriteContent===m.EVehiclePlateState.None||this.currentSpriteContent===m.EVehiclePlateState.PlateNumber&&i){e(void 0);return}let a=new Image,n="",r="";if(this.currentSpriteContent===m.EVehiclePlateState.PlateNumber||this.currentSpriteContent===m.EVehiclePlateState.Mix)if(i)a=this.greyPlateBG,n=s.ptcId,r="#ffffff";else switch(n=((h=s.showName)==null?void 0:h.substring(0,2))+"•"+((l=s.showName)==null?void 0:l.substring(2)),s.plateColor){case 1:a=this.bluePlateBG,r="#ffffff";break;case 2:a=this.yellowPlateBG,r="#000000";break;case 3:a=this.whitePlateBG,r="#000000";break;case 4:a=this.blackPlateBG,r="#ffffff";break;case 5:a=this.neoYellowPlateBG,r="#000000";break;case 6:a=this.neoGreenPlateBG,r="#000000";break;default:a=this.greyPlateBG,n=s.plateNo,r="#ffffff";break}else this.currentSpriteContent===m.EVehiclePlateState.Id&&(a=this.greyPlateBG,n=s.ptcId,r="#ffffff");const d=this.createCanvas(a,n,r);if(d){const p=new o.CanvasTexture(d),c=new o.SpriteMaterial({map:p,transparent:!1}),g=new o.Sprite(c),b=.05,M=d.width*b,P=d.height*b;g.scale.set(M,P,1),g.name="VehiclePlate",e(g)}else{t("canvas创建失败");return}a.onerror=p=>{console.log(`号牌背景加载失败: ${a.src}`,p),t(p)}})}}exports.default=R;
@@ -5,6 +5,7 @@ interface ICross {
5
5
  latitude: number;
6
6
  longitude: number;
7
7
  signalId: string;
8
+ isKey: boolean;
8
9
  }
9
10
  export default class DistrictController {
10
11
  id: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class e{constructor(s){this.parentName="",this.crosses=[],this.subDistricts=[],this.areaColor=[Math.floor(Math.random()*255),Math.floor(Math.random()*255),Math.floor(Math.random()*255)],this.crossCount=0,this.subDistrictCount=0,this.id=s.id,this.name=s.name,this.parentId=s.parentId;for(const t of s.children)if(t.children){const o=new e(t);o.parentName=this.name,o.areaColor=this.areaColor,this.subDistricts.push(o),this.subDistrictCount++,this.crossCount+=o.crossCount}else{const o={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId};this.crosses.push(o),this.crossCount++}}getAllCrossCoordinates(){const s=[];for(const t of this.crosses)s.push([t.longitude,t.latitude]);for(const t of this.subDistricts)s.push(...t.getAllCrossCoordinates());return s}}exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class e{constructor(t){this.parentName="",this.crosses=[],this.subDistricts=[],this.areaColor=[Math.floor(Math.random()*255),Math.floor(Math.random()*255),Math.floor(Math.random()*255)],this.crossCount=0,this.subDistrictCount=0,this.id=t.id,this.name=t.name,this.parentId=t.parentId;for(const s of t.children)if(s.children){const o=new e(s);o.parentName=this.name,o.areaColor=this.areaColor,this.subDistricts.push(o),this.subDistrictCount++,this.crossCount+=o.crossCount}else{const o={id:s.id,name:s.name,parentId:s.parentId,latitude:Number(s.latitude),longitude:Number(s.longitude),signalId:s.signalId,isKey:s.isKey===1};this.crosses.push(o),this.crossCount++}}getAllCrossCoordinates(){const t=[];for(const s of this.crosses)t.push([s.longitude,s.latitude]);for(const s of this.subDistricts)t.push(...s.getAllCrossCoordinates());return t}}exports.default=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),o=require("@arcgis/core/layers/GraphicsLayer"),p=require("@turf/buffer"),f=require("@turf/convex"),b=require("@turf/helpers"),L=require("./district-controller.js");function g(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const w=g(m),u=g(b);class v{constructor(e){this.crossScale=3e3,this.view=e,this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!0},this.districtControllerLayer=new o({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new o({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new o({id:"crossLayer",maxScale:0,minScale:36112}),this.highlightLayer=new o({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0;for(const t of e){const r=new L.default(t);this.drawArea(r,!0)}return this.watchHandle=w.watch(()=>this.view.scale,(t,r)=>{if(t>this.crossScale&&r<=this.crossScale)this.crossLayer.graphics.forEach(s=>{s.symbol={type:"simple-marker",color:s.getAttribute("color"),size:8,outline:{color:"white",width:1}}}),this.highlightLayer.graphics.forEach(s=>{s.getAttribute("type")==="cross"&&(s.symbol={type:"simple-marker",color:s.getAttribute("color"),size:8,outline:{color:"white",width:1}})});else if(t<=this.crossScale&&r>this.crossScale){const s={type:"picture-marker",url:"/GisViewerAssets/Images/xhj_1.png",width:"37px",height:"57px",yoffset:"25px"};this.crossLayer.graphics.forEach(i=>{i.symbol=s}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol=s)})}}),{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.watchHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);if(t){t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry);const r=t.geometry.type==="point"?t.geometry:t.geometry.centroid;return this.view.openPopup({features:[t],location:r}),{status:0,message:"ok"}}else return{status:1,message:"未找到"}}async highlightSignalControlArea(e){this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1,this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id).toArray().map(i=>i.clone()),r=this.subDistrictControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("parentId")===e.id).toArray().map(i=>i.clone()),s=this.crossLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("districtId")===e.id||i.getAttribute("subDistrictId")===e.id).toArray().map(i=>i.clone());return t.length>0&&this.highlightLayer.addMany(t),r.length>0&&this.highlightLayer.addMany(r),s.length>0&&this.highlightLayer.addMany(s),this.highlightLayer.graphics.length===0?{status:1,message:"未找到"}:(t.length>0?await this.view.goTo(t):r.length>0?await this.view.goTo(r):s.length>1?await this.view.goTo(s):await this.view.goTo({target:s[0].geometry,scale:1500}),{status:0,message:"ok"})}resetHighlight(){return this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0,this.crossLayer.visible=!0,{status:0,message:"ok"}}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e)),t}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>2){const i=u.featureCollection(r.map(d=>u.point(d))),n=f(i);if(!n)return;const y=p(n.geometry,t?200:30,{units:"meters"});let l;t?l=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:l=[{fieldName:"parentName",label:"区控名称"},{fieldName:"id",label:"子区编号"},{fieldName:"crossCount",label:"路口数量"}];const h=new c({geometry:{type:"polygon",rings:y.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,t?.6:.8],outline:{color:e.areaColor,width:2,style:t?"solid":"long-dash"}},attributes:{type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},popupTemplate:{title:e.name,content:[{type:"fields",fieldInfos:l}]}});t?this.districtControllerLayer.add(h):this.subDistrictControllerLayer.add(h)}for(const i of e.subDistricts)this.drawArea(i,!1);const s=e.crosses.map(i=>new c({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:{type:"simple-marker",color:e.areaColor,size:8,outline:{color:"white",width:1}},attributes:{type:"cross",id:i.id,name:i.name,color:e.areaColor,signalId:i.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name},popupTemplate:{title:i.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}}));this.crossLayer.addMany(s)}}exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/core/reactiveUtils.js"),u=require("@arcgis/core/Graphic"),l=require("@arcgis/core/layers/GraphicsLayer"),b=require("@turf/buffer"),f=require("@turf/convex"),p=require("@turf/helpers"),A=require("./district-controller.js");function c(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const L=c(m),n=c(p);class w{constructor(e){this.crossScale=3e3,this.view=e,this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!0},this.districtControllerLayer=new l({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new l({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new l({id:"crossLayer",maxScale:0,minScale:36112}),this.highlightLayer=new l({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0;for(const t of e){const r=new A.default(t);this.drawArea(r,!0)}return this.watchHandle=L.watch(()=>this.view.scale,(t,r)=>{t>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(i=>{i.symbol={type:"simple-marker",style:i.getAttribute("isKey")?"diamond":"circle",color:i.getAttribute("color"),size:i.getAttribute("isKey")?16:8,outline:{color:i.getAttribute("isKey")?"red":"white",width:i.getAttribute("isKey")?2:1}}}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol={type:"simple-marker",style:i.getAttribute("isKey")?"diamond":"circle",color:i.getAttribute("color"),size:i.getAttribute("isKey")?16:8,outline:{color:i.getAttribute("isKey")?"red":"white",width:i.getAttribute("isKey")?2:1}})})):t<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(i=>{i.symbol={type:"picture-marker",url:`/GisViewerAssets/Images/xhj_${i.getAttribute("isKey")?4:1}.png`,width:i.getAttribute("isKey")?"55px":"37px",height:i.getAttribute("isKey")?"85px":"57px",yoffset:i.getAttribute("isKey")?"37px":"25px"}}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol={type:"picture-marker",url:`/GisViewerAssets/Images/xhj_${i.getAttribute("isKey")?4:1}.png`,width:i.getAttribute("isKey")?"55px":"37px",height:i.getAttribute("isKey")?"85px":"57px",yoffset:i.getAttribute("isKey")?"37px":"25px"})}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.watchHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);if(t){t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry);const r=t.geometry.type==="point"?t.geometry:t.geometry.centroid;return this.view.openPopup({features:[t],location:r}),{status:0,message:"ok"}}else return{status:1,message:"未找到"}}async highlightSignalControlArea(e){this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1,this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>s.clone()),r=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),i=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());return t.length>0&&this.highlightLayer.addMany(t),r.length>0&&this.highlightLayer.addMany(r),i.length>0&&this.highlightLayer.addMany(i),this.highlightLayer.graphics.length===0?{status:1,message:"未找到"}:(t.length>0?await this.view.goTo(t):r.length>0?await this.view.goTo(r):i.length>1?await this.view.goTo(i):await this.view.goTo({target:i[0].geometry,scale:1500}),{status:0,message:"ok"})}resetHighlight(){return this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0,this.crossLayer.visible=!0,{status:0,message:"ok"}}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e)),t}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>=2){let s=null;if(r.length===2)s=n.lineString(r);else if(r.length>2){const g=n.featureCollection(r.map(d=>n.point(d)));s=f(g)}if(!s)return;const y=b(s.geometry,t?200:30,{units:"meters"});let o;t?o=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:o=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const h=new u({geometry:{type:"polygon",rings:y.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,t?.6:.8],outline:{color:e.areaColor,width:2,style:t?"solid":"long-dash"}},attributes:{type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:o}]}});t?this.districtControllerLayer.add(h):this.subDistrictControllerLayer.add(h)}for(const s of e.subDistricts)this.drawArea(s,!1);const i=e.crosses.map(s=>new u({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:{type:"simple-marker",style:s.isKey?"diamond":"circle",color:e.areaColor,size:s.isKey?16:8,outline:{color:s.isKey?"red":"white",width:s.isKey?2:1}},attributes:{type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:s.isKey},popupTemplate:{title:s.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}}));this.crossLayer.addMany(i)}}exports.default=w;
@@ -40,7 +40,7 @@ export interface IVehicleTrack {
40
40
  step?: number;
41
41
  }
42
42
  export interface IVehicleRecord {
43
- model: Three.Group | Three.Mesh;
43
+ model: Three.Mesh | Three.Object3D;
44
44
  data: IVehicleTrack;
45
45
  segmentStartTime?: number;
46
46
  segmentTotalTime?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.136",
3
+ "version": "1.0.138",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [