gisviewer-vue3-arcgis 1.0.114 → 1.0.116

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 (61) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +5 -3
  2. package/es/src/gis-map/gis-map.vue.mjs +93 -92
  3. package/es/src/gis-map/index.d.ts +4 -2
  4. package/es/src/gis-map/stores/appData.d.ts +3 -0
  5. package/es/src/gis-map/stores/appData.mjs +7 -4
  6. package/es/src/gis-map/utils/common-utils.d.ts +12 -0
  7. package/es/src/gis-map/utils/common-utils.mjs +81 -43
  8. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +0 -2
  9. package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +42 -118
  10. package/es/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +4 -0
  11. package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +200 -108
  12. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.d.ts +3 -0
  13. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +42 -16
  14. package/es/src/gis-map/utils/open-drive-renderer/draw-bezier.d.ts +17 -0
  15. package/es/src/gis-map/utils/open-drive-renderer/draw-bezier.mjs +49 -0
  16. package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +31 -3
  17. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +274 -44
  18. package/es/src/gis-map/utils/open-drive-renderer/junction.d.ts +50 -0
  19. package/es/src/gis-map/utils/open-drive-renderer/junction.mjs +151 -0
  20. package/es/src/gis-map/utils/open-drive-renderer/lane-section.d.ts +48 -0
  21. package/es/src/gis-map/utils/open-drive-renderer/lane-section.mjs +82 -0
  22. package/es/src/gis-map/utils/open-drive-renderer/lane-utils.d.ts +29 -0
  23. package/es/src/gis-map/utils/open-drive-renderer/lane-utils.mjs +265 -0
  24. package/es/src/gis-map/utils/open-drive-renderer/lane.d.ts +70 -0
  25. package/es/src/gis-map/utils/open-drive-renderer/lane.mjs +93 -0
  26. package/es/src/gis-map/utils/open-drive-renderer/road.d.ts +60 -0
  27. package/es/src/gis-map/utils/open-drive-renderer/road.mjs +113 -0
  28. package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +88 -0
  29. package/es/src/gis-map/utils/open-drive-renderer/wasm-loader.mjs +366 -0
  30. package/es/src/types/index.d.ts +50 -0
  31. package/lib/src/gis-map/gis-map.vue.d.ts +5 -3
  32. package/lib/src/gis-map/gis-map.vue.js +1 -1
  33. package/lib/src/gis-map/index.d.ts +4 -2
  34. package/lib/src/gis-map/stores/appData.d.ts +3 -0
  35. package/lib/src/gis-map/stores/appData.js +1 -1
  36. package/lib/src/gis-map/utils/common-utils.d.ts +12 -0
  37. package/lib/src/gis-map/utils/common-utils.js +1 -1
  38. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +0 -2
  39. package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +2 -2
  40. package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +4 -0
  41. package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -1
  42. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.d.ts +3 -0
  43. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
  44. package/lib/src/gis-map/utils/open-drive-renderer/draw-bezier.d.ts +17 -0
  45. package/lib/src/gis-map/utils/open-drive-renderer/draw-bezier.js +1 -0
  46. package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +31 -3
  47. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  48. package/lib/src/gis-map/utils/open-drive-renderer/junction.d.ts +50 -0
  49. package/lib/src/gis-map/utils/open-drive-renderer/junction.js +1 -0
  50. package/lib/src/gis-map/utils/open-drive-renderer/lane-section.d.ts +48 -0
  51. package/lib/src/gis-map/utils/open-drive-renderer/lane-section.js +1 -0
  52. package/lib/src/gis-map/utils/open-drive-renderer/lane-utils.d.ts +29 -0
  53. package/lib/src/gis-map/utils/open-drive-renderer/lane-utils.js +1 -0
  54. package/lib/src/gis-map/utils/open-drive-renderer/lane.d.ts +70 -0
  55. package/lib/src/gis-map/utils/open-drive-renderer/lane.js +1 -0
  56. package/lib/src/gis-map/utils/open-drive-renderer/road.d.ts +60 -0
  57. package/lib/src/gis-map/utils/open-drive-renderer/road.js +1 -0
  58. package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.d.ts +88 -0
  59. package/lib/src/gis-map/utils/open-drive-renderer/wasm-loader.js +1 -0
  60. package/lib/src/types/index.d.ts +50 -0
  61. package/package.json +4 -1
@@ -0,0 +1,93 @@
1
+ import i from "../common-utils.mjs";
2
+ import r from "./lane-utils.mjs";
3
+ class l {
4
+ constructor(e, t, s) {
5
+ this.isDirEqualReady = !1, this.road = t, this.laneSection = s, this.id = e.id, this.type = e.type, this.predecessor = e.predecessor, this.successor = e.successor;
6
+ const o = i.getStdVecEntries(
7
+ e.inner_border,
8
+ !0
9
+ );
10
+ this.innerBorder = i.transformLineProjection(o);
11
+ const a = i.getStdVecEntries(
12
+ e.outer_border,
13
+ !0
14
+ );
15
+ this.outerBorder = i.transformLineProjection(a);
16
+ const n = this.innerBorder.concat([...this.outerBorder].reverse());
17
+ n.push(n[0]), this.ring = n;
18
+ }
19
+ get isDirEqual() {
20
+ return this.isDirEqualReady || (this._isDirEqual = r.isLaneDirEqualDriveDir(this), this.isDirEqualReady = !0), this._isDirEqual;
21
+ }
22
+ /**
23
+ * 车道代码:道路id_路段id_车道id
24
+ */
25
+ get laneCode() {
26
+ return `${this.road.id}_${this.laneSection.s0}_${this.id}`;
27
+ }
28
+ /**
29
+ * 车道边线采样后的数据
30
+ */
31
+ get sampledLane() {
32
+ return {
33
+ id: this.id,
34
+ type: this.type,
35
+ innerPath: this.innerBorder,
36
+ outerPath: this.outerBorder
37
+ };
38
+ }
39
+ /**
40
+ * 获取路段内同方向最外侧车道
41
+ */
42
+ get outerMostLaneInTheSameDir() {
43
+ const e = this.laneSection.allLaneIds, t = this.id > 0 ? e[e.length - 1] : e[0];
44
+ return this.laneSection.getLane(t);
45
+ }
46
+ /**
47
+ * 车道航向角
48
+ * @returns
49
+ */
50
+ get drivingAngle() {
51
+ if (!this.angle) {
52
+ const e = r.getDriveAngle(this);
53
+ this.angle = e;
54
+ }
55
+ return this.angle;
56
+ }
57
+ /**
58
+ * 获取车道按行车方向的起点、终点,可选择内侧、中间、外侧
59
+ * @param type
60
+ * @returns
61
+ */
62
+ getLaneEndPoints(e = "middle") {
63
+ return r.getLaneEndPoints(this, e);
64
+ }
65
+ /**
66
+ * 获取车道的前驱车道和后继车道
67
+ * @returns
68
+ */
69
+ getLink() {
70
+ return r.getPrevAndNext(this);
71
+ }
72
+ // /**
73
+ // * 获取车道对应的高精地图要素
74
+ // * @returns
75
+ // */
76
+ // public getShpPolygon() {
77
+ // return LaneUtils.getShpLanePolygonOfXodrLane(this);
78
+ // }
79
+ // public getArrowPositions() {
80
+ // return LaneUtils.getArrowPositionsInLane(this);
81
+ // }
82
+ /**
83
+ * 获取车道停止线
84
+ * @returns
85
+ */
86
+ getStopLine() {
87
+ const e = this.getLaneEndPoints("inner"), t = this.getLaneEndPoints("outer");
88
+ return [e[1], t[1]];
89
+ }
90
+ }
91
+ export {
92
+ l as default
93
+ };
@@ -0,0 +1,60 @@
1
+ import { IRoadLink, ISampledRoad } from '../../../types';
2
+ import LaneSection from './lane-section';
3
+ export default class Road {
4
+ id: string;
5
+ name: string;
6
+ length: number;
7
+ junction: string;
8
+ successor: IRoadLink;
9
+ predecessor: IRoadLink;
10
+ /** 道路上下左右的边框 */
11
+ borders: {
12
+ left: number[][];
13
+ right: number[][];
14
+ top: number[][];
15
+ bottom: number[][];
16
+ };
17
+ /** 上下左右边框围成的多边形 */
18
+ polygon: number[][];
19
+ refLine: number[][];
20
+ private sToLaneSection;
21
+ constructor(odrRoad: any);
22
+ /**
23
+ * 获取一个路段
24
+ * @param s0
25
+ * @returns
26
+ */
27
+ getLaneSection(s0: number): LaneSection | undefined;
28
+ /**
29
+ * 获取第一个路段
30
+ * @returns
31
+ */
32
+ getFirstLaneSection(): LaneSection;
33
+ /**
34
+ * 获取最后一个路段
35
+ * @returns
36
+ */
37
+ getLastLaneSection(): LaneSection;
38
+ /**
39
+ * 是否是最后一个路段的里程值
40
+ * @param s
41
+ * @returns
42
+ */
43
+ isLastLaneSection(s: number): boolean;
44
+ /**
45
+ * 获取下一个路段
46
+ * @param s
47
+ */
48
+ getNextLaneSection(s: number): LaneSection | undefined;
49
+ /**
50
+ * 获取上一个路段
51
+ * @param s
52
+ * @returns
53
+ */
54
+ getPrevLaneSection(s: number): LaneSection | undefined;
55
+ /** 获取所有路段 */
56
+ get allLaneSections(): LaneSection[];
57
+ get laneSectionNumber(): number;
58
+ get sampledRoad(): ISampledRoad;
59
+ private getBorderLine;
60
+ }
@@ -0,0 +1,113 @@
1
+ import a from "../common-utils.mjs";
2
+ import h from "./lane-section.mjs";
3
+ class g {
4
+ constructor(e) {
5
+ this.id = e.id, this.name = e.name, this.length = e.length, this.junction = e.junction, this.sToLaneSection = /* @__PURE__ */ new Map();
6
+ const t = a.getStdVecEntries(e.ref_line, !0);
7
+ this.refLine = a.transformLineProjection(t);
8
+ for (const i of [!0, !1]) {
9
+ const o = i ? e.predecessor : e.successor, r = {
10
+ elementId: o.id,
11
+ elementType: o.type,
12
+ contactPoint: o.contact_point
13
+ };
14
+ i ? this.predecessor = r : this.successor = r;
15
+ }
16
+ a.getStdVecEntries(
17
+ e.odr_lanesections,
18
+ !0
19
+ ).forEach((i) => {
20
+ const o = new h(i, this);
21
+ this.sToLaneSection.set(o.s0, o);
22
+ }), this.borders = this.getBorderLine();
23
+ const n = [];
24
+ n.push(...this.borders.right), n.push(...this.borders.top), n.push(...[...this.borders.left].reverse()), n.push(...[...this.borders.bottom].reverse()), n.push(n[0]), this.polygon = n;
25
+ }
26
+ /**
27
+ * 获取一个路段
28
+ * @param s0
29
+ * @returns
30
+ */
31
+ getLaneSection(e) {
32
+ return this.sToLaneSection.get(e);
33
+ }
34
+ /**
35
+ * 获取第一个路段
36
+ * @returns
37
+ */
38
+ getFirstLaneSection() {
39
+ const e = [...this.sToLaneSection.keys()];
40
+ return e.sort((t, s) => t - s), this.sToLaneSection.get(e[0]);
41
+ }
42
+ /**
43
+ * 获取最后一个路段
44
+ * @returns
45
+ */
46
+ getLastLaneSection() {
47
+ const e = [...this.sToLaneSection.keys()];
48
+ return e.sort((t, s) => t - s), this.sToLaneSection.get(e[e.length - 1]);
49
+ }
50
+ /**
51
+ * 是否是最后一个路段的里程值
52
+ * @param s
53
+ * @returns
54
+ */
55
+ isLastLaneSection(e) {
56
+ const t = [...this.sToLaneSection.keys()];
57
+ return t.sort((s, n) => s - n), e === t[t.length - 1];
58
+ }
59
+ /**
60
+ * 获取下一个路段
61
+ * @param s
62
+ */
63
+ getNextLaneSection(e) {
64
+ const t = [...this.sToLaneSection.keys()], s = t.indexOf(e);
65
+ if (s >= 0 && s < t.length - 1)
66
+ return this.sToLaneSection.get(t[s + 1]);
67
+ }
68
+ /**
69
+ * 获取上一个路段
70
+ * @param s
71
+ * @returns
72
+ */
73
+ getPrevLaneSection(e) {
74
+ const t = [...this.sToLaneSection.keys()], s = t.indexOf(e);
75
+ if (s > 0)
76
+ return this.sToLaneSection.get(t[s - 1]);
77
+ }
78
+ /** 获取所有路段 */
79
+ get allLaneSections() {
80
+ return [...this.sToLaneSection.values()];
81
+ }
82
+ get laneSectionNumber() {
83
+ return this.sToLaneSection.size;
84
+ }
85
+ get sampledRoad() {
86
+ return {
87
+ id: this.id,
88
+ name: this.name,
89
+ junction: this.junction,
90
+ refLine: this.refLine,
91
+ laneSections: this.allLaneSections.map(
92
+ (e) => e.sampledLaneSection
93
+ )
94
+ };
95
+ }
96
+ getBorderLine() {
97
+ const e = [], t = [];
98
+ let s = [], n = [];
99
+ const i = [...this.sToLaneSection.keys()];
100
+ return i.forEach((o, r) => {
101
+ const c = this.getLaneSection(o);
102
+ r === 0 ? n = c.borders.bottom : r === i.length - 1 && (s = c.borders.top), e.push(...c.borders.left), t.push(...c.borders.right);
103
+ }), {
104
+ left: e,
105
+ right: t,
106
+ top: s,
107
+ bottom: n
108
+ };
109
+ }
110
+ }
111
+ export {
112
+ g as default
113
+ };
@@ -0,0 +1,88 @@
1
+ import { ILaneInfo, IResult, ISampledRoad } from '../../../types';
2
+ import Junction from './junction';
3
+ import Lane from './lane';
4
+ import Road from './road';
5
+ export default class WasmLoader {
6
+ private static instance;
7
+ static getInstance(): WasmLoader;
8
+ roadList: Map<string, Road>;
9
+ junctionList: Map<string, Junction>;
10
+ private isWasmLoaded;
11
+ private ModuleOpenDrive;
12
+ private ModuleOpenDriveMap;
13
+ private appStore;
14
+ private FsFile;
15
+ /**
16
+ * 载入指定xodr文件并解析
17
+ * @param filePath
18
+ */
19
+ load(file: string): Promise<IResult>;
20
+ clear(): void;
21
+ /**
22
+ * 解析路网
23
+ */
24
+ private getRoadNetwork;
25
+ /**
26
+ * 获取所有道路的采样结果
27
+ */
28
+ get allSampledRoads(): ISampledRoad[];
29
+ /**
30
+ * 获取路网结构
31
+ */
32
+ get roadNetwork(): {
33
+ roadName: string;
34
+ roadId: string;
35
+ roadLength: number;
36
+ sections: {
37
+ sectionId: number;
38
+ laneIds: number[];
39
+ }[];
40
+ }[];
41
+ /**
42
+ * 从车道信息获取车道对象
43
+ * @param laneInfo
44
+ */
45
+ getLane(laneInfo: ILaneInfo): Lane | undefined;
46
+ /**
47
+ * 获取两个车道之间的车道功能
48
+ * 左转、直行、右转、调头
49
+ * @param incoming
50
+ * @param outgoing
51
+ */
52
+ getFunctionFromIncomingToOutgoing(incoming: ILaneInfo, outgoing: ILaneInfo): IResult;
53
+ /**
54
+ * 获取所有路口的轮廓
55
+ * @returns
56
+ */
57
+ getJunctionOutline(junctionId: string): IResult;
58
+ /**
59
+ * 获取车道的前驱车道和后继车道
60
+ * @param laneInfo
61
+ * @returns
62
+ */
63
+ getLaneLink(laneInfo: ILaneInfo): IResult;
64
+ getRoadLink(roadId: string): IResult;
65
+ getConnectionLink(junctionId: string): IResult;
66
+ getLaneAngle(laneInfo: ILaneInfo): IResult;
67
+ getTurnArrow(params: {
68
+ incoming: ILaneInfo;
69
+ outgoing: ILaneInfo;
70
+ }): IResult;
71
+ /**
72
+ * 道路路段车道的轮廓
73
+ * @param roadId
74
+ * @param sectionId
75
+ * @param laneId
76
+ * @returns
77
+ */
78
+ getPolygon(roadId: string, sectionId?: number, laneId?: number): IResult;
79
+ /**
80
+ * 车道长度
81
+ * @param laneInfo
82
+ * @returns
83
+ */
84
+ getLaneLength(laneInfo: ILaneInfo): IResult;
85
+ getRoadStopLine(junctionId: string): IResult;
86
+ getLaneStopLine(laneInfo: ILaneInfo): IResult;
87
+ getLaneCenterLine(laneInfo: ILaneInfo): IResult;
88
+ }