gisviewer-vue3-arcgis 1.0.165 → 1.0.167

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/src/gis-map/gis-map.vue.d.ts +120 -0
  3. package/es/src/gis-map/gis-map.vue.mjs +142 -128
  4. package/es/src/gis-map/index.d.ts +120 -0
  5. package/es/src/gis-map/stores/appData.d.ts +2 -0
  6. package/es/src/gis-map/stores/appData.mjs +4 -2
  7. package/es/src/gis-map/utils/common-utils.mjs +5 -5
  8. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
  9. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +7 -0
  10. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +121 -0
  11. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.mjs +4 -0
  12. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
  13. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +123 -33
  14. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +102 -99
  15. package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
  16. package/es/src/gis-map/utils/map-initializer.mjs +135 -127
  17. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +10 -10
  18. package/es/src/gis-map/utils/traffic-flow.mjs +5 -4
  19. package/es/src/types/index.d.ts +22 -0
  20. package/es/style.css +1 -1
  21. package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
  22. package/lib/src/gis-map/gis-map.vue.d.ts +120 -0
  23. package/lib/src/gis-map/gis-map.vue.js +1 -1
  24. package/lib/src/gis-map/index.d.ts +120 -0
  25. package/lib/src/gis-map/stores/appData.d.ts +2 -0
  26. package/lib/src/gis-map/stores/appData.js +1 -1
  27. package/lib/src/gis-map/utils/common-utils.js +1 -1
  28. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
  29. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -0
  30. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -0
  31. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +1 -0
  32. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
  33. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  34. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
  35. package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
  36. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  37. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  38. package/lib/src/gis-map/utils/traffic-flow.js +1 -1
  39. package/lib/src/types/index.d.ts +22 -0
  40. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ declare const _sfc_main: import("vue").DefineComponent<{
2
+ displayMode: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ crossId: {
7
+ type: StringConstructor;
8
+ required: true;
9
+ };
10
+ roadId: {
11
+ type: StringConstructor;
12
+ required: true;
13
+ };
14
+ mapPoint: {
15
+ type: ArrayConstructor;
16
+ required: true;
17
+ };
18
+ stopLine: {
19
+ type: ArrayConstructor;
20
+ required: true;
21
+ };
22
+ position: {
23
+ type: ObjectConstructor;
24
+ required: true;
25
+ };
26
+ rotation: {
27
+ type: NumberConstructor;
28
+ required: true;
29
+ };
30
+ lampStatus: {
31
+ type: ObjectConstructor;
32
+ required: true;
33
+ };
34
+ }, {
35
+ props: any;
36
+ panelStyle: import("vue").ComputedRef<{
37
+ top: string;
38
+ left: string;
39
+ 'transform-origin': string;
40
+ transform: string;
41
+ }>;
42
+ uImage: import("vue").ComputedRef<string>;
43
+ uNumberStyle: import("vue").ComputedRef<{
44
+ color: string;
45
+ }>;
46
+ lImage: import("vue").ComputedRef<string>;
47
+ lNumberStyle: import("vue").ComputedRef<{
48
+ color: string;
49
+ }>;
50
+ sImage: import("vue").ComputedRef<string>;
51
+ sNumberStyle: import("vue").ComputedRef<{
52
+ color: string;
53
+ }>;
54
+ rImage: import("vue").ComputedRef<string>;
55
+ rNumberStyle: import("vue").ComputedRef<{
56
+ color: string;
57
+ }>;
58
+ getColorString: (color: string | undefined) => "red" | "rgb(255, 192, 2)" | "lime" | "white";
59
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
60
+ displayMode: {
61
+ type: StringConstructor;
62
+ required: true;
63
+ };
64
+ crossId: {
65
+ type: StringConstructor;
66
+ required: true;
67
+ };
68
+ roadId: {
69
+ type: StringConstructor;
70
+ required: true;
71
+ };
72
+ mapPoint: {
73
+ type: ArrayConstructor;
74
+ required: true;
75
+ };
76
+ stopLine: {
77
+ type: ArrayConstructor;
78
+ required: true;
79
+ };
80
+ position: {
81
+ type: ObjectConstructor;
82
+ required: true;
83
+ };
84
+ rotation: {
85
+ type: NumberConstructor;
86
+ required: true;
87
+ };
88
+ lampStatus: {
89
+ type: ObjectConstructor;
90
+ required: true;
91
+ };
92
+ }>>, {}, {}>;
93
+ export default _sfc_main;
@@ -0,0 +1,7 @@
1
+ import o from "./signal-countdown-panel.vue2.mjs";
2
+ import "./signal-countdown-panel.vue3.mjs";
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const n = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d749c855"]]);
5
+ export {
6
+ n as default
7
+ };
@@ -0,0 +1,121 @@
1
+ import { defineComponent as C, computed as o, openBlock as l, createElementBlock as n, normalizeStyle as a, createElementVNode as t, toDisplayString as i, createCommentVNode as u } from "vue";
2
+ const b = {
3
+ key: 0,
4
+ class: "signal-countdown-container"
5
+ }, _ = ["src"], I = {
6
+ key: 1,
7
+ class: "signal-countdown-container"
8
+ }, N = ["src"], f = {
9
+ key: 2,
10
+ class: "signal-countdown-container"
11
+ }, $ = ["src"], k = {
12
+ key: 3,
13
+ class: "signal-countdown-container"
14
+ }, V = ["src"], A = /* @__PURE__ */ C({
15
+ __name: "signal-countdown-panel",
16
+ props: {
17
+ displayMode: {},
18
+ crossId: {},
19
+ roadId: {},
20
+ mapPoint: {},
21
+ stopLine: {},
22
+ position: {},
23
+ rotation: {},
24
+ lampStatus: {}
25
+ },
26
+ setup(c) {
27
+ const s = c, m = o(() => ({
28
+ top: `${s.position.top}px`,
29
+ left: `${s.position.left}px`,
30
+ "transform-origin": "bottom center",
31
+ transform: `translateX(-50%) translateY(-100%) rotate(${s.rotation}deg)`
32
+ })), p = o(
33
+ () => `/GisViewerAssets/Images/SignalLamp/u-${s.lampStatus.uColor}.png`
34
+ ), d = o(() => ({
35
+ color: r(s.lampStatus.uColor)
36
+ })), g = o(
37
+ () => `/GisViewerAssets/Images/SignalLamp/l-${s.lampStatus.lColor}.png`
38
+ ), S = o(() => ({
39
+ color: r(s.lampStatus.lColor)
40
+ })), h = o(
41
+ () => `/GisViewerAssets/Images/SignalLamp/s-${s.lampStatus.sColor}.png`
42
+ ), v = o(() => ({
43
+ color: r(s.lampStatus.sColor)
44
+ })), w = o(
45
+ () => `/GisViewerAssets/Images/SignalLamp/r-${s.lampStatus.rColor}.png`
46
+ ), y = o(() => ({
47
+ color: r(s.lampStatus.rColor)
48
+ })), r = (e) => {
49
+ switch (e) {
50
+ case "red":
51
+ return "red";
52
+ case "yellow":
53
+ return "rgb(255, 192, 2)";
54
+ case "green":
55
+ return "lime";
56
+ default:
57
+ return "white";
58
+ }
59
+ };
60
+ return (e, L) => (l(), n("div", {
61
+ class: "signal-countdown-panel",
62
+ style: a(m.value)
63
+ }, [
64
+ e.lampStatus.uColor ? (l(), n("div", b, [
65
+ t("div", {
66
+ class: "signal-countdown-number",
67
+ style: a(d.value)
68
+ }, i(e.lampStatus.uNumber), 5),
69
+ t("div", null, [
70
+ t("img", {
71
+ src: p.value,
72
+ width: "20px",
73
+ height: "20px"
74
+ }, null, 8, _)
75
+ ])
76
+ ])) : u("", !0),
77
+ e.lampStatus.lColor ? (l(), n("div", I, [
78
+ t("div", {
79
+ class: "signal-countdown-number",
80
+ style: a(S.value)
81
+ }, i(e.lampStatus.lNumber), 5),
82
+ t("div", null, [
83
+ t("img", {
84
+ src: g.value,
85
+ width: "20px",
86
+ height: "20px"
87
+ }, null, 8, N)
88
+ ])
89
+ ])) : u("", !0),
90
+ e.lampStatus.sColor ? (l(), n("div", f, [
91
+ t("div", {
92
+ class: "signal-countdown-number",
93
+ style: a(v.value)
94
+ }, i(e.lampStatus.sNumber), 5),
95
+ t("div", null, [
96
+ t("img", {
97
+ src: h.value,
98
+ width: "20px",
99
+ height: "20px"
100
+ }, null, 8, $)
101
+ ])
102
+ ])) : u("", !0),
103
+ e.lampStatus.rColor !== void 0 ? (l(), n("div", k, [
104
+ t("div", {
105
+ class: "signal-countdown-number",
106
+ style: a(y.value)
107
+ }, i(e.lampStatus.rNumber), 5),
108
+ t("div", null, [
109
+ t("img", {
110
+ src: w.value,
111
+ width: "20px",
112
+ height: "20px"
113
+ }, null, 8, V)
114
+ ])
115
+ ])) : u("", !0)
116
+ ], 4));
117
+ }
118
+ });
119
+ export {
120
+ A as default
121
+ };
@@ -0,0 +1,4 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
@@ -1,9 +1,23 @@
1
1
  import SignalHoloFlow from './signal-holo-flow';
2
2
  export default class LSRSignalHoloFlow extends SignalHoloFlow {
3
3
  private stopLineLayer;
4
+ private store;
5
+ private watchHandle;
4
6
  constructor(view: __esri.MapView | __esri.SceneView);
5
7
  private stopLineMap;
6
8
  initializeLayer(): Promise<void>;
7
9
  handleSignalData(data: any): Promise<void>;
8
10
  clearSignal(): void;
11
+ /**
12
+ * 从停止线坐标计算面板位置
13
+ * @param coordinates
14
+ * @returns
15
+ */
16
+ private getPanelPoint;
17
+ /**
18
+ * 从停止线坐标计算面板旋转角度
19
+ * @param coordinates
20
+ * @returns
21
+ */
22
+ private getPanelRotation;
9
23
  }
@@ -1,48 +1,138 @@
1
- import c from "@arcgis/core/Graphic";
2
- import m from "@arcgis/core/layers/GraphicsLayer";
3
- import h from "../common-utils.mjs";
4
- import y from "./signal-holo-flow.mjs";
5
- class M extends y {
6
- constructor(e) {
7
- super(e), this.stopLineLayer = new m(), this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
1
+ import * as u from "@arcgis/core/core/reactiveUtils";
2
+ import { Point as d } from "@arcgis/core/geometry";
3
+ import P from "@arcgis/core/layers/GraphicsLayer";
4
+ import y from "@turf/bearing";
5
+ import L from "@turf/destination";
6
+ import * as w from "@turf/helpers";
7
+ import S from "../../stores/index.mjs";
8
+ import R from "../common-utils.mjs";
9
+ import v from "./signal-holo-flow.mjs";
10
+ class b extends v {
11
+ constructor(t) {
12
+ super(t), this.stopLineLayer = new P(), this.store = S.useAppDataStore, this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
8
13
  }
9
14
  async initializeLayer() {
10
- var t, n;
15
+ var p, h;
11
16
  console.time("初始化停止线图层");
12
- let e = (n = (t = this.mapConfig.holoFlow) == null ? void 0 : t.signal) == null ? void 0 : n.stopLineLayer;
13
- if (!e)
17
+ let t = (h = (p = this.mapConfig.holoFlow) == null ? void 0 : p.signal) == null ? void 0 : h.stopLineLayer;
18
+ if (!t)
14
19
  return;
15
- e = this.mapConfig.assetsRoot + "/" + e, (await (await fetch(e)).json()).features.forEach((o) => {
16
- const { roadId: s, nodeId: r } = o.properties, { coordinates: p } = o.geometry, l = this.stopLineMap.get(r);
17
- l ? l.set(s, p) : this.stopLineMap.set(r, /* @__PURE__ */ new Map([[s, p]]));
20
+ t = this.mapConfig.assetsRoot + "/" + t, (await (await fetch(t)).json()).features.forEach((a) => {
21
+ const { roadId: o, nodeId: n } = a.properties, { coordinates: r } = a.geometry, e = this.stopLineMap.get(n);
22
+ e ? e.set(o, r) : this.stopLineMap.set(n, /* @__PURE__ */ new Map([[o, r]]));
18
23
  }), console.timeEnd("初始化停止线图层");
19
24
  }
20
- async handleSignalData(e) {
21
- const { crossId: a } = e, i = this.stopLineMap.get(a);
22
- i && i.forEach((t, n) => {
23
- const o = h.getCenterPointInLine(t);
24
- console.log("centerPoint", o);
25
- const s = new c({
26
- geometry: {
27
- type: "point",
28
- x: o[0],
29
- y: o[1],
30
- spatialReference: this.view.spatialReference
31
- },
32
- symbol: {
33
- type: "simple-marker",
34
- style: "circle",
35
- color: [0, 0, 255],
36
- size: 5
25
+ async handleSignalData(t) {
26
+ this.watchHandle || (this.watchHandle = u.watch(
27
+ () => this.view.extent,
28
+ () => {
29
+ for (const o of this.store.countdownPanels) {
30
+ const { mapPoint: n } = o, r = this.view.toScreen({
31
+ type: "point",
32
+ x: n[0],
33
+ y: n[1]
34
+ });
35
+ o.position.left = r.x, o.position.top = r.y;
37
36
  }
37
+ }
38
+ ));
39
+ const s = t.crossId, i = t.rtStage, p = t.nonCurStageRemainingTime, h = t.allStageFlows;
40
+ console.log(s, i, p, h);
41
+ const a = /* @__PURE__ */ new Map();
42
+ h.forEach((o) => {
43
+ const { stageId: n, stageFlows: r } = o;
44
+ let e = "green", m = i.stageRemainingTime;
45
+ if (n === i.stageId)
46
+ m <= i.stageAllRedTime ? e = "red" : i.stageYellowTime !== 0 && m <= i.stageYellowTime + i.stageAllRedTime && (e = "yellow");
47
+ else {
48
+ e = "red";
49
+ const l = p.find(
50
+ (g) => g.stageId === n
51
+ );
52
+ m = l ? l.stageNextRunRemainingTime : 0;
53
+ }
54
+ r.forEach((l) => {
55
+ let { fromRoadId: g } = l;
56
+ g.startsWith("-") && (g = g.slice(1));
57
+ const f = l.direction.toLowerCase();
58
+ let c = a.get(g);
59
+ c || (c = {}, a.set(g, c)), f === "u" ? (c.uNumber = m, c.uColor = e) : f === "l" ? (c.lNumber = m, c.lColor = e) : f === "s" ? (c.sNumber = m, c.sColor = e) : f === "r" && (c.rNumber = m, c.rColor = e === "yellow" ? "red" : e);
38
60
  });
39
- this.stopLineLayer.add(s);
61
+ }), a.forEach((o, n) => {
62
+ console.log(n, o);
63
+ const r = this.stopLineMap.get(s);
64
+ if (!r) {
65
+ console.error(`路口${s}没有找到对应的停止线`);
66
+ return;
67
+ }
68
+ const e = r.get(n);
69
+ if (!e) {
70
+ console.error(`路口${s}的进口道${n}没有找到对应的停止线`);
71
+ return;
72
+ }
73
+ const m = this.store.countdownPanels.find(
74
+ (l) => l.crossId === s && l.roadId === n
75
+ );
76
+ if (m)
77
+ m.lampStatus = o;
78
+ else {
79
+ const l = this.getPanelPoint(e), g = this.view.toScreen({
80
+ type: "point",
81
+ x: l[0],
82
+ y: l[1]
83
+ }), f = this.getPanelRotation(e);
84
+ this.store.countdownPanels.push({
85
+ displayMode: "complete",
86
+ crossId: s,
87
+ roadId: n,
88
+ mapPoint: l,
89
+ // 定位点地理坐标
90
+ stopLine: e,
91
+ // 关联的停止线坐标
92
+ position: { left: g.x, top: g.y },
93
+ // 定位点屏幕坐标
94
+ rotation: f,
95
+ // 面板旋转角度
96
+ lampStatus: o
97
+ // 灯组状态
98
+ });
99
+ }
40
100
  });
41
101
  }
42
102
  clearSignal() {
43
- this.stopLineLayer.removeAll();
103
+ var t;
104
+ this.stopLineLayer.removeAll(), this.store.countdownPanels = [], (t = this.watchHandle) == null || t.remove(), this.watchHandle = null;
105
+ }
106
+ /**
107
+ * 从停止线坐标计算面板位置
108
+ * @param coordinates
109
+ * @returns
110
+ */
111
+ getPanelPoint(t) {
112
+ const s = R.getCenterPointInLine(t), i = t[0], p = t[t.length - 1];
113
+ let a = y(w.point(i), w.point(p)) - 90;
114
+ return a < -180 && (a += 360), L(w.point(s), 1, a, {
115
+ units: "meters"
116
+ }).geometry.coordinates;
117
+ }
118
+ /**
119
+ * 从停止线坐标计算面板旋转角度
120
+ * @param coordinates
121
+ * @returns
122
+ */
123
+ getPanelRotation(t) {
124
+ const s = t[0], i = new d({
125
+ x: s[0],
126
+ y: s[1],
127
+ spatialReference: this.view.spatialReference
128
+ }), p = this.view.toScreen(i), h = t[t.length - 1], a = new d({
129
+ x: h[0],
130
+ y: h[1],
131
+ spatialReference: this.view.spatialReference
132
+ }), o = this.view.toScreen(a), n = o.x - p.x, r = o.y - p.y;
133
+ return Math.atan2(r, n) * (180 / Math.PI);
44
134
  }
45
135
  }
46
136
  export {
47
- M as default
137
+ b as default
48
138
  };