gisviewer-vue3-arcgis 1.0.165 → 1.0.166

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 (38) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/src/gis-map/gis-map.vue.d.ts +111 -0
  3. package/es/src/gis-map/gis-map.vue.mjs +135 -124
  4. package/es/src/gis-map/index.d.ts +111 -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 +6 -6
  8. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +85 -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 +120 -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 +13 -0
  13. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +95 -35
  14. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +102 -99
  15. package/es/src/gis-map/utils/map-initializer.mjs +54 -45
  16. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +10 -10
  17. package/es/src/gis-map/utils/traffic-flow.mjs +5 -4
  18. package/es/src/types/index.d.ts +21 -0
  19. package/es/style.css +1 -1
  20. package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
  21. package/lib/src/gis-map/gis-map.vue.d.ts +111 -0
  22. package/lib/src/gis-map/gis-map.vue.js +1 -1
  23. package/lib/src/gis-map/index.d.ts +111 -0
  24. package/lib/src/gis-map/stores/appData.d.ts +2 -0
  25. package/lib/src/gis-map/stores/appData.js +1 -1
  26. package/lib/src/gis-map/utils/common-utils.js +1 -1
  27. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +85 -0
  28. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -0
  29. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -0
  30. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +1 -0
  31. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +13 -0
  32. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  33. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
  34. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  35. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  36. package/lib/src/gis-map/utils/traffic-flow.js +1 -1
  37. package/lib/src/types/index.d.ts +21 -0
  38. package/package.json +1 -1
@@ -0,0 +1,85 @@
1
+ declare const _sfc_main: import("vue").DefineComponent<{
2
+ crossId: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ roadId: {
7
+ type: StringConstructor;
8
+ required: true;
9
+ };
10
+ mapPoint: {
11
+ type: ArrayConstructor;
12
+ required: true;
13
+ };
14
+ stopLine: {
15
+ type: ArrayConstructor;
16
+ required: true;
17
+ };
18
+ position: {
19
+ type: ObjectConstructor;
20
+ required: true;
21
+ };
22
+ rotation: {
23
+ type: NumberConstructor;
24
+ required: true;
25
+ };
26
+ lampStatus: {
27
+ type: ObjectConstructor;
28
+ required: true;
29
+ };
30
+ }, {
31
+ props: any;
32
+ panelStyle: import("vue").ComputedRef<{
33
+ top: string;
34
+ left: string;
35
+ 'transform-origin': string;
36
+ transform: string;
37
+ }>;
38
+ uImage: import("vue").ComputedRef<string>;
39
+ uNumberStyle: import("vue").ComputedRef<{
40
+ color: string;
41
+ }>;
42
+ lImage: import("vue").ComputedRef<string>;
43
+ lNumberStyle: import("vue").ComputedRef<{
44
+ color: string;
45
+ }>;
46
+ sImage: import("vue").ComputedRef<string>;
47
+ sNumberStyle: import("vue").ComputedRef<{
48
+ color: string;
49
+ }>;
50
+ rImage: import("vue").ComputedRef<string>;
51
+ rNumberStyle: import("vue").ComputedRef<{
52
+ color: string;
53
+ }>;
54
+ getColorString: (color: string | undefined) => "red" | "yellow" | "lime" | "white";
55
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
+ crossId: {
57
+ type: StringConstructor;
58
+ required: true;
59
+ };
60
+ roadId: {
61
+ type: StringConstructor;
62
+ required: true;
63
+ };
64
+ mapPoint: {
65
+ type: ArrayConstructor;
66
+ required: true;
67
+ };
68
+ stopLine: {
69
+ type: ArrayConstructor;
70
+ required: true;
71
+ };
72
+ position: {
73
+ type: ObjectConstructor;
74
+ required: true;
75
+ };
76
+ rotation: {
77
+ type: NumberConstructor;
78
+ required: true;
79
+ };
80
+ lampStatus: {
81
+ type: ObjectConstructor;
82
+ required: true;
83
+ };
84
+ }>>, {}, {}>;
85
+ 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-93496d9c"]]);
5
+ export {
6
+ n as default
7
+ };
@@ -0,0 +1,120 @@
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 _ = {
3
+ key: 0,
4
+ class: "signal-countdown-container"
5
+ }, b = ["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
+ crossId: {},
18
+ roadId: {},
19
+ mapPoint: {},
20
+ stopLine: {},
21
+ position: {},
22
+ rotation: {},
23
+ lampStatus: {}
24
+ },
25
+ setup(c) {
26
+ const s = c, m = o(() => ({
27
+ top: `${s.position.top}px`,
28
+ left: `${s.position.left}px`,
29
+ "transform-origin": "bottom center",
30
+ transform: `translateX(-50%) translateY(-100%) rotate(${s.rotation}deg)`
31
+ })), p = o(
32
+ () => `/GisViewerAssets/Images/SignalLamp/u-${s.lampStatus.uColor}.png`
33
+ ), d = o(() => ({
34
+ color: r(s.lampStatus.uColor)
35
+ })), g = o(
36
+ () => `/GisViewerAssets/Images/SignalLamp/l-${s.lampStatus.lColor}.png`
37
+ ), S = o(() => ({
38
+ color: r(s.lampStatus.lColor)
39
+ })), h = o(
40
+ () => `/GisViewerAssets/Images/SignalLamp/s-${s.lampStatus.sColor}.png`
41
+ ), v = o(() => ({
42
+ color: r(s.lampStatus.sColor)
43
+ })), w = o(
44
+ () => `/GisViewerAssets/Images/SignalLamp/r-${s.lampStatus.rColor}.png`
45
+ ), y = o(() => ({
46
+ color: r(s.lampStatus.rColor)
47
+ })), r = (e) => {
48
+ switch (e) {
49
+ case "red":
50
+ return "red";
51
+ case "yellow":
52
+ return "yellow";
53
+ case "green":
54
+ return "lime";
55
+ default:
56
+ return "white";
57
+ }
58
+ };
59
+ return (e, L) => (l(), n("div", {
60
+ class: "signal-countdown-panel",
61
+ style: a(m.value)
62
+ }, [
63
+ e.lampStatus.uColor ? (l(), n("div", _, [
64
+ t("div", {
65
+ class: "signal-countdown-number",
66
+ style: a(d.value)
67
+ }, i(e.lampStatus.uNumber), 5),
68
+ t("div", null, [
69
+ t("img", {
70
+ src: p.value,
71
+ width: "20px",
72
+ height: "20px"
73
+ }, null, 8, b)
74
+ ])
75
+ ])) : u("", !0),
76
+ e.lampStatus.lColor ? (l(), n("div", I, [
77
+ t("div", {
78
+ class: "signal-countdown-number",
79
+ style: a(S.value)
80
+ }, i(e.lampStatus.lNumber), 5),
81
+ t("div", null, [
82
+ t("img", {
83
+ src: g.value,
84
+ width: "20px",
85
+ height: "20px"
86
+ }, null, 8, N)
87
+ ])
88
+ ])) : u("", !0),
89
+ e.lampStatus.sColor ? (l(), n("div", f, [
90
+ t("div", {
91
+ class: "signal-countdown-number",
92
+ style: a(v.value)
93
+ }, i(e.lampStatus.sNumber), 5),
94
+ t("div", null, [
95
+ t("img", {
96
+ src: h.value,
97
+ width: "20px",
98
+ height: "20px"
99
+ }, null, 8, $)
100
+ ])
101
+ ])) : u("", !0),
102
+ e.lampStatus.rColor !== void 0 ? (l(), n("div", k, [
103
+ t("div", {
104
+ class: "signal-countdown-number",
105
+ style: a(y.value)
106
+ }, i(e.lampStatus.rNumber), 5),
107
+ t("div", null, [
108
+ t("img", {
109
+ src: w.value,
110
+ width: "20px",
111
+ height: "20px"
112
+ }, null, 8, V)
113
+ ])
114
+ ])) : u("", !0)
115
+ ], 4));
116
+ }
117
+ });
118
+ export {
119
+ A as default
120
+ };
@@ -0,0 +1,4 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
@@ -1,9 +1,22 @@
1
1
  import SignalHoloFlow from './signal-holo-flow';
2
2
  export default class LSRSignalHoloFlow extends SignalHoloFlow {
3
3
  private stopLineLayer;
4
+ private store;
4
5
  constructor(view: __esri.MapView | __esri.SceneView);
5
6
  private stopLineMap;
6
7
  initializeLayer(): Promise<void>;
7
8
  handleSignalData(data: any): Promise<void>;
8
9
  clearSignal(): void;
10
+ /**
11
+ * 从停止线坐标计算面板位置
12
+ * @param coordinates
13
+ * @returns
14
+ */
15
+ private getPanelPoint;
16
+ /**
17
+ * 从停止线坐标计算面板旋转角度
18
+ * @param coordinates
19
+ * @returns
20
+ */
21
+ private getPanelRotation;
9
22
  }
@@ -1,48 +1,108 @@
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 m from "@arcgis/core/core/reactiveUtils";
2
+ import { Point as h } from "@arcgis/core/geometry";
3
+ import f from "@arcgis/core/layers/GraphicsLayer";
4
+ import P from "@turf/bearing";
5
+ import g from "@turf/destination";
6
+ import * as c from "@turf/helpers";
7
+ import d from "../../stores/index.mjs";
8
+ import y from "../common-utils.mjs";
9
+ import w from "./signal-holo-flow.mjs";
10
+ class F extends w {
11
+ constructor(o) {
12
+ super(o), this.stopLineLayer = new f(), this.store = d.useAppDataStore, this.stopLineMap = /* @__PURE__ */ new Map(), this.view.map.add(this.stopLineLayer);
8
13
  }
9
14
  async initializeLayer() {
10
- var t, n;
15
+ var i, r;
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 o = (r = (i = this.mapConfig.holoFlow) == null ? void 0 : i.signal) == null ? void 0 : r.stopLineLayer;
18
+ if (!o)
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]]));
18
- }), console.timeEnd("初始化停止线图层");
19
- }
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
20
+ o = this.mapConfig.assetsRoot + "/" + o, (await (await fetch(o)).json()).features.forEach((t) => {
21
+ const { roadId: n, nodeId: e } = t.properties, { coordinates: s } = t.geometry, l = this.stopLineMap.get(e);
22
+ l ? l.set(n, s) : this.stopLineMap.set(e, /* @__PURE__ */ new Map([[n, s]]));
23
+ }), console.timeEnd("初始化停止线图层"), m.watch(
24
+ () => this.view.extent,
25
+ () => {
26
+ for (const t of this.store.countdownPanels) {
27
+ const { mapPoint: n, stopLine: e } = t, s = this.view.toScreen({
28
+ type: "point",
29
+ x: n[0],
30
+ y: n[1]
31
+ });
32
+ t.position.left = s.x, t.position.top = s.y;
33
+ const l = this.getPanelRotation(e);
34
+ t.rotation = l;
37
35
  }
36
+ }
37
+ );
38
+ }
39
+ async handleSignalData(o) {
40
+ const { crossId: a, roadId: p, lampStatus: i } = o, r = this.stopLineMap.get(a);
41
+ if (!r)
42
+ return;
43
+ const t = r.get(p);
44
+ if (!t)
45
+ return;
46
+ const n = this.store.countdownPanels.find(
47
+ (e) => e.crossId === a && e.roadId === p
48
+ );
49
+ if (n)
50
+ n.lampStatus = i;
51
+ else {
52
+ const e = this.getPanelPoint(t), s = this.view.toScreen({
53
+ type: "point",
54
+ x: e[0],
55
+ y: e[1]
56
+ }), l = this.getPanelRotation(t);
57
+ this.store.countdownPanels.push({
58
+ crossId: a,
59
+ roadId: p,
60
+ mapPoint: e,
61
+ // 定位点地理坐标
62
+ stopLine: t,
63
+ // 关联的停止线坐标
64
+ position: { left: s.x, top: s.y },
65
+ // 定位点屏幕坐标
66
+ rotation: l,
67
+ // 面板旋转角度
68
+ lampStatus: i
69
+ // 灯组状态
38
70
  });
39
- this.stopLineLayer.add(s);
40
- });
71
+ }
41
72
  }
42
73
  clearSignal() {
43
74
  this.stopLineLayer.removeAll();
44
75
  }
76
+ /**
77
+ * 从停止线坐标计算面板位置
78
+ * @param coordinates
79
+ * @returns
80
+ */
81
+ getPanelPoint(o) {
82
+ const a = y.getCenterPointInLine(o), p = o[0], i = o[o.length - 1];
83
+ let t = P(c.point(p), c.point(i)) - 90;
84
+ return t < -180 && (t += 360), g(c.point(a), 1, t, {
85
+ units: "meters"
86
+ }).geometry.coordinates;
87
+ }
88
+ /**
89
+ * 从停止线坐标计算面板旋转角度
90
+ * @param coordinates
91
+ * @returns
92
+ */
93
+ getPanelRotation(o) {
94
+ const a = o[0], p = new h({
95
+ x: a[0],
96
+ y: a[1],
97
+ spatialReference: this.view.spatialReference
98
+ }), i = this.view.toScreen(p), r = o[o.length - 1], t = new h({
99
+ x: r[0],
100
+ y: r[1],
101
+ spatialReference: this.view.spatialReference
102
+ }), n = this.view.toScreen(t), e = n.x - i.x, s = n.y - i.y;
103
+ return Math.atan2(s, e) * (180 / Math.PI);
104
+ }
45
105
  }
46
106
  export {
47
- M as default
107
+ F as default
48
108
  };