@aibee/crc-bmap 0.0.125 → 0.0.126

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.
@@ -22,6 +22,7 @@ export interface NavigationConfig {
22
22
  startPoi: Partial<PoiOptions>;
23
23
  needStartPoi: boolean;
24
24
  loadRoad: boolean;
25
+ roadNetwork: "RoadNetwork" | "RoadNetwork2";
25
26
  }
26
27
  export declare class Navigation extends Plugin<EventMap> {
27
28
  path: Path | null;
@@ -19,5 +19,6 @@ export * from './ajax';
19
19
  export * from './unique-key';
20
20
  export * from './path';
21
21
  export * from './road';
22
+ export * from './road2';
22
23
  export * from './webworker';
23
24
  export * from './string';
@@ -51,7 +51,7 @@ export declare class RoadNetwork {
51
51
  id: string;
52
52
  cds: [number, number];
53
53
  name: string;
54
- type: "escalator" | "straightLadder" | "normal" | "graph" | "staircase" | "facility";
54
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility";
55
55
  floor: string;
56
56
  locked: boolean;
57
57
  nodeId: string;
@@ -66,7 +66,7 @@ export declare class RoadNetwork {
66
66
  id: string;
67
67
  cds: [number, number];
68
68
  name: string;
69
- type: "escalator" | "straightLadder" | "normal" | "graph" | "staircase" | "facility";
69
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility";
70
70
  floor: string;
71
71
  locked: boolean;
72
72
  nodeId: string;
@@ -80,7 +80,7 @@ export declare class RoadNetwork {
80
80
  id: string;
81
81
  cds: [number, number];
82
82
  name: string;
83
- type: "escalator" | "straightLadder" | "normal" | "graph" | "staircase" | "facility";
83
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility";
84
84
  floor: string;
85
85
  locked: boolean;
86
86
  nodeId: string;
@@ -98,7 +98,7 @@ export declare class RoadNetwork {
98
98
  id: string;
99
99
  cds: [number, number];
100
100
  name: string;
101
- type: "escalator" | "straightLadder" | "normal" | "graph" | "staircase" | "facility";
101
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility";
102
102
  floor: string;
103
103
  locked: boolean;
104
104
  nodeId: string;
@@ -0,0 +1,175 @@
1
+ import Graph from "node-dijkstra";
2
+ export interface RoadData2 {
3
+ floor: string;
4
+ lines: Array<{
5
+ id: string;
6
+ to: string;
7
+ from: string;
8
+ color: string;
9
+ locked: boolean;
10
+ opacity: number;
11
+ visible: boolean;
12
+ userData: Record<string, string>;
13
+ direction: "double" | "single" | "no" | "back";
14
+ }>;
15
+ points: Array<{
16
+ id: string;
17
+ cds: [number, number];
18
+ name: string;
19
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
20
+ floor: string;
21
+ locked: boolean;
22
+ nodeId: string;
23
+ visible: boolean;
24
+ targetId: string;
25
+ userData: Record<string, string>;
26
+ escalatorType: "" | "single" | "double" | "jd";
27
+ escalatorDirection: "" | "up" | "down" | "exit";
28
+ }>;
29
+ }
30
+ export interface Start2 {
31
+ floor: string;
32
+ nodeId?: string;
33
+ coord?: [number, number];
34
+ }
35
+ type FacilityEnd2 = {
36
+ floor?: string;
37
+ facility?: string;
38
+ parkingSpace?: string;
39
+ };
40
+ export type End2 = Start2 & FacilityEnd2;
41
+ export type RouteType2 = "" | "escalator" | "straightLadder" | "forward";
42
+ export type PathData2 = {
43
+ floor: string;
44
+ points: [number, number][];
45
+ endType: string;
46
+ destId: string;
47
+ distance: number;
48
+ }[];
49
+ export declare class RoadNetwork2 {
50
+ private lift_priority;
51
+ roadInfo: RoadData2[];
52
+ pointMap: Map<string, {
53
+ id: string;
54
+ cds: [number, number];
55
+ name: string;
56
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
57
+ floor: string;
58
+ locked: boolean;
59
+ nodeId: string;
60
+ visible: boolean;
61
+ targetId: string;
62
+ userData: Record<string, string>;
63
+ escalatorType: "" | "single" | "double" | "jd";
64
+ escalatorDirection: "" | "up" | "down" | "exit";
65
+ }>;
66
+ nodeMap: Map<string, string>;
67
+ facilityMap: Map<string, {
68
+ id: string;
69
+ cds: [number, number];
70
+ name: string;
71
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
72
+ floor: string;
73
+ locked: boolean;
74
+ nodeId: string;
75
+ visible: boolean;
76
+ targetId: string;
77
+ userData: Record<string, string>;
78
+ escalatorType: "" | "single" | "double" | "jd";
79
+ escalatorDirection: "" | "up" | "down" | "exit";
80
+ }[]>;
81
+ straightLadderMap: Map<string, {
82
+ id: string;
83
+ cds: [number, number];
84
+ name: string;
85
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
86
+ floor: string;
87
+ locked: boolean;
88
+ nodeId: string;
89
+ visible: boolean;
90
+ targetId: string;
91
+ userData: Record<string, string>;
92
+ escalatorType: "" | "single" | "double" | "jd";
93
+ escalatorDirection: "" | "up" | "down" | "exit";
94
+ }[]>;
95
+ escalatorMap: Map<string, {
96
+ start: RoadData2["points"][0];
97
+ end: RoadData2["points"][0];
98
+ }>;
99
+ staircaseMap: Map<string, {
100
+ id: string;
101
+ cds: [number, number];
102
+ name: string;
103
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
104
+ floor: string;
105
+ locked: boolean;
106
+ nodeId: string;
107
+ visible: boolean;
108
+ targetId: string;
109
+ userData: Record<string, string>;
110
+ escalatorType: "" | "single" | "double" | "jd";
111
+ escalatorDirection: "" | "up" | "down" | "exit";
112
+ }[]>;
113
+ parkingMap: Map<string, {
114
+ id: string;
115
+ cds: [number, number];
116
+ name: string;
117
+ type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
118
+ floor: string;
119
+ locked: boolean;
120
+ nodeId: string;
121
+ visible: boolean;
122
+ targetId: string;
123
+ userData: Record<string, string>;
124
+ escalatorType: "" | "single" | "double" | "jd";
125
+ escalatorDirection: "" | "up" | "down" | "exit";
126
+ }>;
127
+ lineMap: Map<string, Map<string, number>>;
128
+ baseRoute: Graph;
129
+ escalatorRoute: Graph;
130
+ straightLadderRoute: Graph;
131
+ forwardLineMap: Map<string, Map<string, number>>;
132
+ forwardRoute: Graph;
133
+ constructor(lift_priority?: number);
134
+ initRoute(roadInfo: RoadData2[]): void;
135
+ addLineItem(start: string, end: string, distance: number, lineMap?: Map<string, Map<string, number>>): void;
136
+ /**
137
+ * 把设施添加的路网图中
138
+ * @param escalatorPriority 扶梯权重
139
+ * @param straightLadderPriority 直梯权重
140
+ * @param staircasePriority 步行梯权重
141
+ * @param lineMap 路网
142
+ */
143
+ addFacilityToLineMap(escalatorPriority: number, straightLadderPriority: number, staircasePriority: number, lineMap: Map<string, Map<string, number>>): void;
144
+ initBaseRoute(): void;
145
+ initEscalatorRoute(): void;
146
+ initStraightLadderRoute(): void;
147
+ initForwardRoute(): void;
148
+ checkStart(start: Start2): boolean;
149
+ checkEnd(end: End2): boolean;
150
+ transformStart(start: Start2): {
151
+ floor: string;
152
+ id: string;
153
+ } | null;
154
+ transformEnd(end: End2): {
155
+ floor: string;
156
+ id: string;
157
+ } | {
158
+ facility: string;
159
+ } | null;
160
+ /**
161
+ *
162
+ * @param start 起点
163
+ * @param end 终点
164
+ * @param type '' 最短路径 escalator 扶梯优先 straightLadder 直梯优先
165
+ * @returns
166
+ */
167
+ getPath(start: Start2, end: End2, type?: RouteType2): "start-error" | "end-error" | "no-start" | "no-end" | PathData2 | null | undefined;
168
+ private getRoutePath;
169
+ private getBasePath;
170
+ private getEscalatorPath;
171
+ private getStraightLadderPath;
172
+ private getForwardPath;
173
+ clear(): void;
174
+ }
175
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.125",
3
+ "version": "0.0.126",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.js",