expo-gaode-map-navigation 1.0.1-next.0 → 1.0.1-next.2
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.
- package/README.md +117 -28
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapModule.kt +7 -0
- package/android/src/main/java/expo/modules/gaodemap/map/modules/SDKInitializer.kt +38 -3
- package/build/map/ExpoGaodeMapModule.js +5 -5
- package/ios/map/ExpoGaodeMapModule.swift +22 -6
- package/package.json +13 -6
- package/package.json.backup +0 -47
- package/plugin/README.md +0 -52
- package/plugin/build/withGaodeMap.d.ts +0 -22
- package/plugin/build/withGaodeMap.js +0 -169
- package/plugin/src/withGaodeMap.ts +0 -231
- package/plugin/tsconfig.tsbuildinfo +0 -1
- package/src/ExpoGaodeMapNaviView.tsx +0 -94
- package/src/ExpoGaodeMapNavigation.types.ts +0 -3
- package/src/ExpoGaodeMapNavigationModule.ts +0 -11
- package/src/index.ts +0 -262
- package/src/map/ExpoGaodeMap.types.ts +0 -46
- package/src/map/ExpoGaodeMapModule.ts +0 -315
- package/src/map/ExpoGaodeMapView.tsx +0 -120
- package/src/map/components/overlays/Circle.tsx +0 -20
- package/src/map/components/overlays/Cluster.tsx +0 -26
- package/src/map/components/overlays/HeatMap.tsx +0 -27
- package/src/map/components/overlays/Marker.tsx +0 -88
- package/src/map/components/overlays/MultiPoint.tsx +0 -27
- package/src/map/components/overlays/Polygon.tsx +0 -19
- package/src/map/components/overlays/Polyline.tsx +0 -19
- package/src/map/components/overlays/index.ts +0 -7
- package/src/map/index.ts +0 -37
- package/src/map/types/common.types.ts +0 -126
- package/src/map/types/index.ts +0 -55
- package/src/map/types/location.types.ts +0 -368
- package/src/map/types/map-view.types.ts +0 -281
- package/src/map/types/overlays.types.ts +0 -404
- package/src/map/utils/EventManager.ts +0 -23
- package/src/map/utils/ModuleLoader.ts +0 -115
- package/src/types/coordinates.types.ts +0 -25
- package/src/types/independent.types.ts +0 -288
- package/src/types/index.ts +0 -5
- package/src/types/naviview.types.ts +0 -330
- package/src/types/route.types.ts +0 -305
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { ViewProps, NativeSyntheticEvent } from "react-native";
|
|
2
|
-
|
|
3
|
-
// 导航信息更新事件
|
|
4
|
-
export interface NaviInfoUpdateEvent {
|
|
5
|
-
pathRetainDistance: number;
|
|
6
|
-
pathRetainTime: number;
|
|
7
|
-
currentRoadName: string;
|
|
8
|
-
nextRoadName: string;
|
|
9
|
-
currentSpeed: number;
|
|
10
|
-
iconType: number;
|
|
11
|
-
iconDirection: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// 导航开始事件
|
|
15
|
-
export interface NaviStartEvent {
|
|
16
|
-
type?: number;
|
|
17
|
-
loaded?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 导航结束事件
|
|
21
|
-
export interface NaviEndEvent {
|
|
22
|
-
reason: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 到达目的地事件
|
|
26
|
-
export interface NaviArriveEvent {
|
|
27
|
-
arrived: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 路径规划成功事件
|
|
31
|
-
export interface CalculateRouteSuccessEvent {
|
|
32
|
-
routeIds?: number[];
|
|
33
|
-
success?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// 路径规划失败事件
|
|
37
|
-
export interface CalculateRouteFailureEvent {
|
|
38
|
-
error?: string;
|
|
39
|
-
errorCode?: number;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// 重新规划路径事件
|
|
43
|
-
export interface ReCalculateEvent {
|
|
44
|
-
reason: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 语音播报事件
|
|
48
|
-
export interface PlayVoiceEvent {
|
|
49
|
-
text: string;
|
|
50
|
-
type?: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// GPS信号弱事件
|
|
54
|
-
export interface GpsSignalWeakEvent {
|
|
55
|
-
isWeak: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// 路线重算事件
|
|
59
|
-
export interface RouteRecalculateEvent {
|
|
60
|
-
reason: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 导航视图属性
|
|
65
|
-
*/
|
|
66
|
-
export interface NaviViewProps extends ViewProps {
|
|
67
|
-
/**
|
|
68
|
-
* 导航类型
|
|
69
|
-
* - 0: GPS 导航
|
|
70
|
-
* - 1: 模拟导航
|
|
71
|
-
*/
|
|
72
|
-
naviType?: number;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 是否启用语音播报
|
|
76
|
-
* @default true
|
|
77
|
-
*/
|
|
78
|
-
enableVoice?: boolean;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* 是否显示摄像头
|
|
82
|
-
* @default true
|
|
83
|
-
*/
|
|
84
|
-
showCamera?: boolean;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* 是否自动锁车(非锁车模式7秒后自动切换为锁车模式)
|
|
88
|
-
* @default true
|
|
89
|
-
*/
|
|
90
|
-
autoLockCar?: boolean;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 是否开启自动缩放(锁车模式下自动缩放地图以预见下一导航动作)
|
|
94
|
-
* @default true
|
|
95
|
-
*/
|
|
96
|
-
autoChangeZoom?: boolean;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 是否显示交通路况
|
|
100
|
-
* @default true
|
|
101
|
-
*/
|
|
102
|
-
trafficLayerEnabled?: boolean;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* 是否显示路口放大图
|
|
106
|
-
* @default true
|
|
107
|
-
*/
|
|
108
|
-
realCrossDisplay?: boolean;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 导航视角模式
|
|
112
|
-
* - 0: 车头朝上 (carNorth)
|
|
113
|
-
* - 1: 正北朝上 (mapNorth)
|
|
114
|
-
* @default 0
|
|
115
|
-
*/
|
|
116
|
-
naviMode?: number;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 导航显示模式
|
|
120
|
-
* - 1: 锁车态 (carPositionLocked) - 自车图标锁定在屏幕固定位置
|
|
121
|
-
* - 2: 全览态 (overview) - 整条路线显示在可见区域内
|
|
122
|
-
* - 3: 普通态 (normal) - 地图不动,自车图标移动
|
|
123
|
-
* @default 1
|
|
124
|
-
*/
|
|
125
|
-
showMode?: number;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* 是否开启夜间模式
|
|
129
|
-
* @default false
|
|
130
|
-
*/
|
|
131
|
-
isNightMode?: boolean;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* 是否显示自车和罗盘
|
|
135
|
-
* @platform android
|
|
136
|
-
* @default true
|
|
137
|
-
* @since 6.2.0
|
|
138
|
-
*/
|
|
139
|
-
carOverlayVisible?: boolean;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* 是否显示交通信号灯
|
|
143
|
-
* @platform android
|
|
144
|
-
* @default true
|
|
145
|
-
* @since 7.4.0
|
|
146
|
-
*/
|
|
147
|
-
trafficLightsVisible?: boolean;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* 路线标记点可见性配置
|
|
151
|
-
* @platform android
|
|
152
|
-
* @since 9.0.0
|
|
153
|
-
*/
|
|
154
|
-
routeMarkerVisible?: {
|
|
155
|
-
/** 是否显示起终途点 @default true */
|
|
156
|
-
showStartEndVia?: boolean;
|
|
157
|
-
/** 是否显示步行轮渡扎点 @default true */
|
|
158
|
-
showFootFerry?: boolean;
|
|
159
|
-
/** 是否显示禁行限行封路icon @default true */
|
|
160
|
-
showForbidden?: boolean;
|
|
161
|
-
/** 是否显示路线起点icon @default true @since 9.0.0 */
|
|
162
|
-
showRouteStartIcon?: boolean;
|
|
163
|
-
/** 是否显示路线终点icon @default true @since 9.0.0 */
|
|
164
|
-
showRouteEndIcon?: boolean;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 是否显示路线转向箭头
|
|
169
|
-
* @platform android
|
|
170
|
-
* @default true
|
|
171
|
-
* @since 6.3.0
|
|
172
|
-
*/
|
|
173
|
-
naviArrowVisible?: boolean;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* 是否显示拥堵气泡
|
|
177
|
-
* @platform android
|
|
178
|
-
* @default true
|
|
179
|
-
* @since 10.0.5
|
|
180
|
-
*/
|
|
181
|
-
showDriveCongestion?: boolean;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* 是否显示红绿灯倒计时气泡
|
|
185
|
-
* @platform android
|
|
186
|
-
* @default true
|
|
187
|
-
* @since 10.0.5
|
|
188
|
-
*/
|
|
189
|
-
showTrafficLightView?: boolean;
|
|
190
|
-
|
|
191
|
-
// ========== iOS 特有属性 ==========
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 是否显示路线
|
|
195
|
-
* @platform ios
|
|
196
|
-
* @default true
|
|
197
|
-
*/
|
|
198
|
-
showRoute?: boolean;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 是否显示转向箭头
|
|
202
|
-
* @platform ios
|
|
203
|
-
* @default true
|
|
204
|
-
*/
|
|
205
|
-
showTurnArrow?: boolean;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* 是否显示路况光柱
|
|
209
|
-
* @platform ios
|
|
210
|
-
* @default true
|
|
211
|
-
*/
|
|
212
|
-
showTrafficBar?: boolean;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* 是否显示全览按钮
|
|
216
|
-
* @platform ios
|
|
217
|
-
* @default true
|
|
218
|
-
*/
|
|
219
|
-
showBrowseRouteButton?: boolean;
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* 是否显示更多按钮
|
|
223
|
-
* @platform ios
|
|
224
|
-
* @default true
|
|
225
|
-
*/
|
|
226
|
-
showMoreButton?: boolean;
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* 是否显示实时交通按钮
|
|
230
|
-
* @platform ios
|
|
231
|
-
* @default true
|
|
232
|
-
*/
|
|
233
|
-
showTrafficButton?: boolean;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* 是否显示界面元素(设为false可完全自定义界面)
|
|
237
|
-
* @platform ios
|
|
238
|
-
* @default true
|
|
239
|
-
*/
|
|
240
|
-
showUIElements?: boolean;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* 走过的路线是否置灰
|
|
244
|
-
* @platform ios
|
|
245
|
-
* @default false
|
|
246
|
-
*/
|
|
247
|
-
showGreyAfterPass?: boolean;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* 是否显示牵引线(起点到终点的飞线)
|
|
251
|
-
* @platform ios
|
|
252
|
-
* @default true
|
|
253
|
-
*/
|
|
254
|
-
showVectorline?: boolean;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* 是否显示红绿灯图标
|
|
258
|
-
* @platform ios
|
|
259
|
-
* @default true
|
|
260
|
-
*/
|
|
261
|
-
showTrafficLights?: boolean;
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* 地图样式类型
|
|
265
|
-
* - 0: 白天模式 (day)
|
|
266
|
-
* - 1: 黑夜模式 (night)
|
|
267
|
-
* - 2: 根据日出日落自动切换 (dayNightAuto)
|
|
268
|
-
* - 3: 自定义地图样式 (custom)
|
|
269
|
-
* @platform ios
|
|
270
|
-
* @default 0
|
|
271
|
-
*/
|
|
272
|
-
mapViewModeType?: number;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* 路线polyline的宽度,设置0恢复默认宽度
|
|
276
|
-
* @platform ios
|
|
277
|
-
*/
|
|
278
|
-
lineWidth?: number;
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* 导航信息更新回调
|
|
282
|
-
*/
|
|
283
|
-
onNaviInfoUpdate?: (event: NativeSyntheticEvent<NaviInfoUpdateEvent>) => void;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* 导航开始回调
|
|
287
|
-
*/
|
|
288
|
-
onNaviStart?: (event: NativeSyntheticEvent<NaviStartEvent>) => void;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* 导航结束回调
|
|
292
|
-
*/
|
|
293
|
-
onNaviEnd?: (event: NativeSyntheticEvent<NaviEndEvent>) => void;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* 到达目的地回调
|
|
297
|
-
*/
|
|
298
|
-
onArrive?: (event: NativeSyntheticEvent<NaviArriveEvent>) => void;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* 路径规划成功回调
|
|
302
|
-
*/
|
|
303
|
-
onCalculateRouteSuccess?: (event: NativeSyntheticEvent<CalculateRouteSuccessEvent>) => void;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* 路径规划失败回调
|
|
307
|
-
*/
|
|
308
|
-
onCalculateRouteFailure?: (event: NativeSyntheticEvent<CalculateRouteFailureEvent>) => void;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* 重新规划路径回调
|
|
312
|
-
*/
|
|
313
|
-
onReCalculate?: (event: NativeSyntheticEvent<ReCalculateEvent>) => void;
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* 语音播报回调
|
|
317
|
-
*/
|
|
318
|
-
onPlayVoice?: (event: NativeSyntheticEvent<PlayVoiceEvent>) => void;
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* GPS信号弱回调
|
|
322
|
-
*/
|
|
323
|
-
onGpsSignalWeak?: (event: NativeSyntheticEvent<GpsSignalWeakEvent>) => void;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* 路线重算回调
|
|
327
|
-
*/
|
|
328
|
-
onRouteRecalculate?: (event: NativeSyntheticEvent<RouteRecalculateEvent>) => void;
|
|
329
|
-
}
|
|
330
|
-
|
package/src/types/route.types.ts
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import type { Coordinates } from './coordinates.types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 路径规划类型
|
|
5
|
-
*/
|
|
6
|
-
export enum RouteType {
|
|
7
|
-
/** 驾车路径规划 */
|
|
8
|
-
DRIVE = 'drive',
|
|
9
|
-
/** 步行路径规划 */
|
|
10
|
-
WALK = 'walk',
|
|
11
|
-
/** 骑行路径规划 */
|
|
12
|
-
RIDE = 'ride',
|
|
13
|
-
/** 货车路径规划 */
|
|
14
|
-
TRUCK = 'truck',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 驾车路径规划策略
|
|
19
|
-
*/
|
|
20
|
-
export enum DriveStrategy {
|
|
21
|
-
/** 速度优先(时间最短) */
|
|
22
|
-
FASTEST = 0,
|
|
23
|
-
/** 费用优先(不走收费路段的最快路线) */
|
|
24
|
-
FEE_FIRST = 1,
|
|
25
|
-
/** 距离优先(距离最短) */
|
|
26
|
-
SHORTEST = 2,
|
|
27
|
-
/** 不走快速路(不走快速路的最快路线) */
|
|
28
|
-
NO_EXPRESSWAYS = 3,
|
|
29
|
-
/** 结合实时交通(躲避拥堵) */
|
|
30
|
-
AVOID_CONGESTION = 4,
|
|
31
|
-
/** 不走高速 */
|
|
32
|
-
NO_HIGHWAY = 5,
|
|
33
|
-
/** 不走高速且避免收费 */
|
|
34
|
-
NO_HIGHWAY_AVOID_CONGESTION = 6,
|
|
35
|
-
/** 躲避收费和拥堵 */
|
|
36
|
-
AVOID_COST_CONGESTION = 7,
|
|
37
|
-
/** 不走高速且躲避收费和拥堵 */
|
|
38
|
-
NO_HIGHWAY_AVOID_COST_CONGESTION = 8,
|
|
39
|
-
/** 躲避拥堵和收费 */
|
|
40
|
-
AVOID_CONGESTION_COST = 9,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 步行路径规划策略
|
|
45
|
-
*/
|
|
46
|
-
export enum WalkStrategy {
|
|
47
|
-
/** 推荐路线 */
|
|
48
|
-
DEFAULT = 0,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 骑行路径规划策略
|
|
53
|
-
*/
|
|
54
|
-
export enum RideStrategy {
|
|
55
|
-
/** 推荐路线 */
|
|
56
|
-
DEFAULT = 0,
|
|
57
|
-
/** 速度优先 */
|
|
58
|
-
FASTEST = 1,
|
|
59
|
-
/** 距离优先 */
|
|
60
|
-
SHORTEST = 2,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 货车路径规划大小
|
|
65
|
-
*/
|
|
66
|
-
export enum TruckSize {
|
|
67
|
-
/** 微型货车 */
|
|
68
|
-
MINI = 1,
|
|
69
|
-
/** 轻型货车 */
|
|
70
|
-
LIGHT = 2,
|
|
71
|
-
/** 中型货车 */
|
|
72
|
-
MEDIUM = 3,
|
|
73
|
-
/** 重型货车 */
|
|
74
|
-
HEAVY = 4,
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 步行/骑行 Travel 策略(对齐原生:1000 单路线 / 1001 多路线)
|
|
79
|
-
*/
|
|
80
|
-
export enum TravelStrategy {
|
|
81
|
-
SINGLE = 1000,
|
|
82
|
-
MULTIPLE = 1001,
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* 基础路径规划选项
|
|
87
|
-
*/
|
|
88
|
-
export interface BaseRouteOptions {
|
|
89
|
-
/** 起点坐标 */
|
|
90
|
-
from: Coordinates;
|
|
91
|
-
/** 终点坐标 */
|
|
92
|
-
to: Coordinates;
|
|
93
|
-
/** 途经点列表(可选) */
|
|
94
|
-
waypoints?: Coordinates[];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 驾车路径规划选项
|
|
99
|
-
*/
|
|
100
|
-
export interface DriveRouteOptions extends BaseRouteOptions {
|
|
101
|
-
type: RouteType.DRIVE;
|
|
102
|
-
/** 驾车策略,默认速度优先 */
|
|
103
|
-
strategy?: DriveStrategy;
|
|
104
|
-
/** 车牌号(用于限行策略,可选) */
|
|
105
|
-
carNumber?: string;
|
|
106
|
-
/** 避让区域(可选) */
|
|
107
|
-
avoidPolygons?: Coordinates[][];
|
|
108
|
-
/** 避让道路(道路名称,可选) */
|
|
109
|
-
avoidRoad?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 步行路径规划选项
|
|
114
|
-
*/
|
|
115
|
-
export interface WalkRouteOptions extends BaseRouteOptions {
|
|
116
|
-
type: RouteType.WALK;
|
|
117
|
-
/** 步行策略 */
|
|
118
|
-
strategy?: WalkStrategy;
|
|
119
|
-
/** 出行策略(单路线/多路线),对齐原生 TravelStrategy:1000/1001 */
|
|
120
|
-
travelStrategy?: TravelStrategy;
|
|
121
|
-
/** 是否返回多路线(等价于 travelStrategy=TravelStrategy.MULTIPLE) */
|
|
122
|
-
multiple?: boolean;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* 骑行路径规划选项
|
|
127
|
-
*/
|
|
128
|
-
export interface RideRouteOptions extends BaseRouteOptions {
|
|
129
|
-
type: RouteType.RIDE;
|
|
130
|
-
/** 骑行策略 */
|
|
131
|
-
strategy?: RideStrategy;
|
|
132
|
-
/** 出行策略(单路线/多路线),对齐原生 TravelStrategy:1000/1001 */
|
|
133
|
-
travelStrategy?: TravelStrategy;
|
|
134
|
-
/** 是否返回多路线(等价于 travelStrategy=TravelStrategy.MULTIPLE) */
|
|
135
|
-
multiple?: boolean;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 骑行电动车路径规划选项
|
|
140
|
-
*/
|
|
141
|
-
export interface EBikeRouteOptions extends BaseRouteOptions {
|
|
142
|
-
/** 出行策略(单路线/多路线),对齐原生 TravelStrategy:1000/1001 */
|
|
143
|
-
travelStrategy?: TravelStrategy;
|
|
144
|
-
/** 是否返回多路线(等价于 travelStrategy=TravelStrategy.MULTIPLE) */
|
|
145
|
-
multiple?: boolean;
|
|
146
|
-
/** 强制使用 POI 算路(若提供 name 或 poiId 时会自动使用) */
|
|
147
|
-
usePoi?: boolean;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* 货车路径规划选项
|
|
152
|
-
*/
|
|
153
|
-
export interface TruckRouteOptions extends BaseRouteOptions {
|
|
154
|
-
type: RouteType.TRUCK;
|
|
155
|
-
/** 货车大小 */
|
|
156
|
-
size: TruckSize;
|
|
157
|
-
/** 货车高度(米) */
|
|
158
|
-
height?: number;
|
|
159
|
-
/** 货车宽度(米) */
|
|
160
|
-
width?: number;
|
|
161
|
-
/** 货车载重(吨) */
|
|
162
|
-
load?: number;
|
|
163
|
-
/** 货车重量(吨) */
|
|
164
|
-
weight?: number;
|
|
165
|
-
/** 货车轴数 */
|
|
166
|
-
axis?: number;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* 路径步骤动作类型
|
|
171
|
-
*/
|
|
172
|
-
export enum StepAction {
|
|
173
|
-
/** 直行 */
|
|
174
|
-
STRAIGHT = 0,
|
|
175
|
-
/** 左转 */
|
|
176
|
-
LEFT = 1,
|
|
177
|
-
/** 右转 */
|
|
178
|
-
RIGHT = 2,
|
|
179
|
-
/** 左前方转弯 */
|
|
180
|
-
LEFT_FRONT = 3,
|
|
181
|
-
/** 右前方转弯 */
|
|
182
|
-
RIGHT_FRONT = 4,
|
|
183
|
-
/** 左后方转弯 */
|
|
184
|
-
LEFT_BACK = 5,
|
|
185
|
-
/** 右后方转弯 */
|
|
186
|
-
RIGHT_BACK = 6,
|
|
187
|
-
/** 左转掉头 */
|
|
188
|
-
LEFT_U_TURN = 7,
|
|
189
|
-
/** 到达目的地 */
|
|
190
|
-
ARRIVE = 8,
|
|
191
|
-
/** 进入环岛 */
|
|
192
|
-
ENTER_ROUNDABOUT = 9,
|
|
193
|
-
/** 驶出环岛 */
|
|
194
|
-
EXIT_ROUNDABOUT = 10,
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* 道路类型
|
|
199
|
-
*/
|
|
200
|
-
export enum RoadType {
|
|
201
|
-
/** 高速公路 */
|
|
202
|
-
HIGHWAY = 0,
|
|
203
|
-
/** 国道 */
|
|
204
|
-
NATIONAL_ROAD = 1,
|
|
205
|
-
/** 省道 */
|
|
206
|
-
PROVINCIAL_ROAD = 2,
|
|
207
|
-
/** 县道 */
|
|
208
|
-
COUNTY_ROAD = 3,
|
|
209
|
-
/** 乡镇道路 */
|
|
210
|
-
TOWNSHIP_ROAD = 4,
|
|
211
|
-
/** 城市主干道 */
|
|
212
|
-
MAIN_ROAD = 5,
|
|
213
|
-
/** 城市次干道 */
|
|
214
|
-
SECONDARY_ROAD = 6,
|
|
215
|
-
/** 城市普通道路 */
|
|
216
|
-
NORMAL_ROAD = 7,
|
|
217
|
-
/** 其他道路 */
|
|
218
|
-
OTHER = 8,
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* 路径步骤信息
|
|
223
|
-
*/
|
|
224
|
-
export interface RouteStep {
|
|
225
|
-
/** 步骤说明 */
|
|
226
|
-
instruction: string;
|
|
227
|
-
/** 方向说明 */
|
|
228
|
-
orientation?: string;
|
|
229
|
-
/** 道路名称 */
|
|
230
|
-
road?: string;
|
|
231
|
-
/** 距离(米) */
|
|
232
|
-
distance: number;
|
|
233
|
-
/** 预计时间(秒) */
|
|
234
|
-
duration: number;
|
|
235
|
-
/** 路径坐标点 */
|
|
236
|
-
polyline: Coordinates[];
|
|
237
|
-
/** 动作类型 */
|
|
238
|
-
action?: StepAction;
|
|
239
|
-
/** 辅助动作(可选) */
|
|
240
|
-
assistantAction?: string;
|
|
241
|
-
/** 收费距离(米) */
|
|
242
|
-
tollDistance?: number;
|
|
243
|
-
/** 收费金额(元) */
|
|
244
|
-
tollCost?: number;
|
|
245
|
-
/** 道路类型 */
|
|
246
|
-
roadType?: RoadType;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* 路径规划结果
|
|
251
|
-
*/
|
|
252
|
-
export interface RouteResult {
|
|
253
|
-
/** 路线ID */
|
|
254
|
-
id: number;
|
|
255
|
-
/** 起点坐标 */
|
|
256
|
-
start: Coordinates;
|
|
257
|
-
/** 终点坐标 */
|
|
258
|
-
end: Coordinates;
|
|
259
|
-
/** 总距离(米) */
|
|
260
|
-
distance: number;
|
|
261
|
-
/** 预计时间(秒) */
|
|
262
|
-
duration: number;
|
|
263
|
-
/** 路径步骤 */
|
|
264
|
-
segments?: RouteStep[];
|
|
265
|
-
/** 路径坐标点(所有步骤的完整路径) */
|
|
266
|
-
polyline?: Coordinates[];
|
|
267
|
-
/** 收费距离(米),驾车时有效 */
|
|
268
|
-
tollDistance?: number;
|
|
269
|
-
/** 收费金额(元),驾车时有效 */
|
|
270
|
-
tollCost?: number;
|
|
271
|
-
/** 红绿灯数量,驾车时有效 */
|
|
272
|
-
trafficLightCount?: number;
|
|
273
|
-
/** 限行状态码,驾车时有效 */
|
|
274
|
-
restrictionCode?: number;
|
|
275
|
-
/** 限行状态说明,驾车时有效 */
|
|
276
|
-
restrictionInfo?: string;
|
|
277
|
-
/** 策略值 */
|
|
278
|
-
strategy?: number;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* 驾车路径规划结果(包含多条路线)
|
|
283
|
-
*/
|
|
284
|
-
export interface DriveRouteResult {
|
|
285
|
-
/** 路径数量 */
|
|
286
|
-
count: number;
|
|
287
|
-
/** 主路线索引 */
|
|
288
|
-
mainPathIndex: number;
|
|
289
|
-
/** 路线ID列表 */
|
|
290
|
-
routeIds?: number[];
|
|
291
|
-
/** 路径列表,按策略返回1-3条路线 */
|
|
292
|
-
routes: RouteResult[];
|
|
293
|
-
/** 出租车费用(元) */
|
|
294
|
-
taxiCost?: number;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* 路径规划选项联合类型
|
|
299
|
-
*/
|
|
300
|
-
export type RouteOptions =
|
|
301
|
-
| DriveRouteOptions
|
|
302
|
-
| WalkRouteOptions
|
|
303
|
-
| RideRouteOptions
|
|
304
|
-
| EBikeRouteOptions
|
|
305
|
-
| TruckRouteOptions;
|