gisviewer-vue3-arcgis 1.0.171 → 1.0.173

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,5 +1,5 @@
1
- import SignalHoloFlow from './signal-holo-flow';
2
1
  import { ISignalCountdownProps } from '../../../types';
2
+ import SignalHoloFlow from './signal-holo-flow';
3
3
  export default class LSRSignalHoloFlow extends SignalHoloFlow {
4
4
  private stopLineLayer;
5
5
  private watchHandle;
@@ -1,29 +1,30 @@
1
- import * as d from "@arcgis/core/core/reactiveUtils";
2
- import { Point as h } from "@arcgis/core/geometry";
3
- import w from "@arcgis/core/layers/GraphicsLayer";
4
- import P from "./signal-holo-flow.mjs";
5
- class L extends P {
6
- constructor(n, s) {
7
- super(n), this.stopLineLayer = new w(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = s, this.view.map.add(this.stopLineLayer);
1
+ import * as w from "@arcgis/core/core/reactiveUtils";
2
+ import { Point as f } from "@arcgis/core/geometry";
3
+ import * as d from "@arcgis/core/geometry/support/webMercatorUtils.js";
4
+ import P from "@arcgis/core/layers/GraphicsLayer";
5
+ import g from "./signal-holo-flow.mjs";
6
+ class S extends g {
7
+ constructor(n, a) {
8
+ super(n), this.stopLineLayer = new P(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = a, this.view.map.add(this.stopLineLayer);
8
9
  }
9
10
  async initializeLayer() {
10
- var c, r;
11
+ var p, l;
11
12
  console.time("初始化停止线图层");
12
- let n = (r = (c = this.mapConfig.holoFlow) == null ? void 0 : c.signal) == null ? void 0 : r.stopLineLayer;
13
+ let n = (l = (p = this.mapConfig.holoFlow) == null ? void 0 : p.signal) == null ? void 0 : l.stopLineLayer;
13
14
  if (!n)
14
15
  return;
15
16
  n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
16
- const { roadId: o, nodeId: e, angle: i, destinationPoint: a } = t.properties, { coordinates: l } = t.geometry, f = this.stopLineMap.get(e);
17
- f ? f.set(o, {
18
- coord: l,
19
- panelPoint: a,
20
- angle: i
17
+ const { roadId: o, nodeId: e, angle: s, destinationPoint: i } = t.properties, { coordinates: r } = t.geometry, h = this.stopLineMap.get(e);
18
+ h ? h.set(o, {
19
+ coord: r,
20
+ panelPoint: i,
21
+ angle: s
21
22
  }) : this.stopLineMap.set(
22
23
  e,
23
24
  /* @__PURE__ */ new Map([
24
25
  [
25
26
  o,
26
- { coord: l, panelPoint: a, angle: i }
27
+ { coord: r, panelPoint: i, angle: s }
27
28
  ]
28
29
  ])
29
30
  );
@@ -31,77 +32,84 @@ class L extends P {
31
32
  }
32
33
  getPanelScale() {
33
34
  const n = this.view.scale;
34
- let s = 1;
35
- return n < 1e3 ? s = 1 : n < 2e3 ? s = 0.8 : s = 0.4, s;
35
+ let a = 1;
36
+ return n < 1e3 ? a = 1 : n < 2e3 ? a = 0.8 : a = 0.4, a;
36
37
  }
37
38
  async handleSignalData(n) {
38
- this.watchHandle || (this.watchHandle = d.watch(
39
+ this.watchHandle || (this.watchHandle = w.watch(
39
40
  () => this.view.extent,
40
41
  () => {
42
+ console.log("extent changed");
41
43
  const t = this.getPanelScale();
42
44
  for (const o of this.countdownPanelProps) {
43
45
  t !== this.currentPanelScale && (o.scale = t);
44
- const { mapPoint: e } = o, i = this.view.toScreen({
45
- type: "point",
46
+ const { mapPoint: e } = o;
47
+ let s = new f({
46
48
  x: e[0],
47
49
  y: e[1]
48
50
  });
49
- o.position.left = i.x, o.position.top = i.y;
51
+ this.view.spatialReference.isWebMercator && (s = d.geographicToWebMercator(
52
+ s
53
+ ));
54
+ const i = this.view.toScreen(s);
55
+ if (o.position.left = i.x, o.position.top = i.y, this.view.type === "3d") {
56
+ const r = this.getPanelRotation(o.stopLine);
57
+ o.rotation = r;
58
+ }
50
59
  }
51
60
  this.currentPanelScale = t;
52
61
  }
53
62
  ));
54
- const s = n.crossId, p = this.stopLineMap.get(s);
55
- if (!p) {
56
- console.log(`没有找到路口${s}`);
63
+ const a = n.crossId, c = this.stopLineMap.get(a);
64
+ if (!c)
57
65
  return;
58
- }
59
- const c = n.phaseCountDownList, r = /* @__PURE__ */ new Map();
60
- for (const t of c) {
66
+ const p = n.phaseCountDownList, l = /* @__PURE__ */ new Map();
67
+ for (const t of p) {
61
68
  let o = "";
62
- for (let l of t.roadIdList)
63
- if (l.startsWith("-") && (l = l.slice(1)), p.has(l)) {
64
- o = l;
69
+ for (let r of t.roadIdList)
70
+ if (r.startsWith("-") && (r = r.slice(1)), c.has(r)) {
71
+ o = r;
65
72
  break;
66
73
  }
67
- if (!o) {
68
- console.log(`没有找到对应的进口道${s}--${o}`);
74
+ if (!o)
69
75
  continue;
70
- }
71
- let e = r.get(o);
72
- if (e || (e = {}, r.set(o, e)), !t.direction) {
73
- console.log(`没有找到对应的方向${s}--${JSON.stringify(t)}`);
76
+ let e = l.get(o);
77
+ if (e || (e = {}, l.set(o, e)), !t.direction) {
78
+ console.log(`没有找到对应的方向${a}--${JSON.stringify(t)}`);
74
79
  continue;
75
80
  }
76
- const i = t.direction.toLowerCase(), a = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
77
- i === "u" ? (e.uNumber = t.leftTime, e.uColor = a) : i === "l" ? (e.lNumber = t.leftTime, e.lColor = a) : i === "s" ? (e.sNumber = t.leftTime, e.sColor = a) : i === "r" && (e.rNumber = t.leftTime, e.rColor = a);
81
+ const s = t.direction.toLowerCase(), i = t.color === 1 ? "red" : t.color === 2 ? "yellow" : "green";
82
+ s === "u" ? (e.uNumber = t.leftTime, e.uColor = i) : s === "l" ? (e.lNumber = t.leftTime, e.lColor = i) : s === "s" ? (e.sNumber = t.leftTime, e.sColor = i) : s === "r" && (e.rNumber = t.leftTime, e.rColor = i);
78
83
  }
79
- r.forEach((t, o) => {
80
- const e = p.get(o);
84
+ l.forEach((t, o) => {
85
+ const e = c.get(o);
81
86
  if (!e)
82
87
  return;
83
- const i = this.countdownPanelProps.find(
84
- (a) => a.crossId === s && a.roadId === o
88
+ const s = this.countdownPanelProps.find(
89
+ (i) => i.crossId === a && i.roadId === o
85
90
  );
86
- if (i)
87
- i.lampStatus = t;
91
+ if (s)
92
+ s.lampStatus = t;
88
93
  else {
89
- const a = e.panelPoint, l = this.view.toScreen({
90
- type: "point",
91
- x: a[0],
92
- y: a[1]
93
- }), f = this.getPanelRotation(e.coord);
94
- this.countdownPanelProps.push({
94
+ let i = new f({
95
+ x: e.panelPoint[0],
96
+ y: e.panelPoint[1]
97
+ });
98
+ this.view.spatialReference.isWebMercator && (i = d.geographicToWebMercator(
99
+ i
100
+ ));
101
+ const r = this.view.toScreen(i), h = this.getPanelRotation(e.coord);
102
+ console.log(i.toJSON(), r), this.countdownPanelProps.push({
95
103
  displayMode: "complex",
96
- crossId: s,
104
+ crossId: a,
97
105
  roadId: o,
98
- mapPoint: a,
106
+ mapPoint: e.panelPoint,
99
107
  // 定位点地理坐标
100
108
  stopLine: e.coord,
101
109
  // 关联的停止线坐标
102
- position: { left: l.x, top: l.y },
110
+ position: { left: r.x, top: r.y },
103
111
  // 定位点屏幕坐标
104
- rotation: f,
112
+ rotation: h,
105
113
  // 面板旋转角度
106
114
  scale: this.getPanelScale(),
107
115
  lampStatus: t
@@ -112,7 +120,7 @@ class L extends P {
112
120
  }
113
121
  clearSignal() {
114
122
  var n;
115
- this.stopLineLayer.removeAll(), this.countdownPanelProps = [], (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
123
+ this.stopLineLayer.removeAll(), this.countdownPanelProps.length = 0, (n = this.watchHandle) == null || n.remove(), this.watchHandle = null;
116
124
  }
117
125
  /**
118
126
  * 从停止线坐标计算面板旋转角度
@@ -120,18 +128,26 @@ class L extends P {
120
128
  * @returns
121
129
  */
122
130
  getPanelRotation(n) {
123
- const s = n[0], p = new h({
124
- x: s[0],
125
- y: s[1],
126
- spatialReference: this.view.spatialReference
127
- }), c = this.view.toScreen(p), r = n[n.length - 1], t = new h({
128
- x: r[0],
129
- y: r[1],
130
- spatialReference: this.view.spatialReference
131
- }), o = this.view.toScreen(t), e = o.x - c.x, i = o.y - c.y;
132
- return Math.atan2(i, e) * (180 / Math.PI);
131
+ const a = n[0];
132
+ let c = new f({
133
+ x: a[0],
134
+ y: a[1]
135
+ });
136
+ this.view.spatialReference.isWebMercator && (c = d.geographicToWebMercator(
137
+ c
138
+ ));
139
+ const p = this.view.toScreen(c), l = n[n.length - 1];
140
+ let t = new f({
141
+ x: l[0],
142
+ y: l[1]
143
+ });
144
+ this.view.spatialReference.isWebMercator && (t = d.geographicToWebMercator(
145
+ t
146
+ ));
147
+ const o = this.view.toScreen(t), e = o.x - p.x, s = o.y - p.y;
148
+ return Math.atan2(s, e) * (180 / Math.PI);
133
149
  }
134
150
  }
135
151
  export {
136
- L as default
152
+ S as default
137
153
  };
@@ -186,7 +186,7 @@ class v {
186
186
  drawCountdownText(e, t) {
187
187
  const a = e.getContext("2d");
188
188
  a.clearRect(0, 0, e.width, e.height), a.font = "24px Digital", a.textBaseline = "middle", a.textAlign = "center", a.fillStyle = t.stageRemainingTime <= t.stageAllRedTime ? "red" : t.stageRemainingTime <= t.stageAllRedTime + t.stageYellowTime ? "yellow" : "lime", a.fillText(
189
- `${t.stageID} ${t.stageRemainingTime.toFixed(0)}`,
189
+ `${t.stageRemainingTime.toFixed(0)}`,
190
190
  e.width / 2,
191
191
  e.height / 2
192
192
  );
@@ -22,6 +22,7 @@ export default class TraceRendererExternal implements ITraceRendererInterface {
22
22
  private truckModel;
23
23
  private busModel;
24
24
  private bicycleModel;
25
+ private passengerModel;
25
26
  private bluePlateBG;
26
27
  private yellowPlateBG;
27
28
  private whitePlateBG;