expo-gaode-map-web-api 1.0.1-next.0
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 +632 -0
- package/build/index.d.ts +91 -0
- package/build/index.js +186 -0
- package/build/services/GeocodeService.d.ts +97 -0
- package/build/services/GeocodeService.js +133 -0
- package/build/services/InputTipsService.d.ts +103 -0
- package/build/services/InputTipsService.js +127 -0
- package/build/services/POIService.d.ts +133 -0
- package/build/services/POIService.js +174 -0
- package/build/services/RouteService.d.ts +149 -0
- package/build/services/RouteService.js +203 -0
- package/build/types/geocode.types.d.ts +326 -0
- package/build/types/geocode.types.js +5 -0
- package/build/types/inputtips.types.d.ts +69 -0
- package/build/types/inputtips.types.js +6 -0
- package/build/types/poi.types.d.ts +319 -0
- package/build/types/poi.types.js +7 -0
- package/build/types/route.types.d.ts +636 -0
- package/build/types/route.types.js +71 -0
- package/build/utils/client.d.ts +78 -0
- package/build/utils/client.js +144 -0
- package/build/utils/errorCodes.d.ts +35 -0
- package/build/utils/errorCodes.js +396 -0
- package/package.json +39 -0
- package/package.json.backup +40 -0
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图路径规划 API 类型定义
|
|
3
|
+
* 文档:https://lbs.amap.com/api/webservice/guide/api/newroute
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 坐标类型
|
|
7
|
+
*/
|
|
8
|
+
export type Coordinate = string | {
|
|
9
|
+
longitude: number;
|
|
10
|
+
latitude: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 通用路径规划请求参数基类
|
|
14
|
+
*/
|
|
15
|
+
export interface BaseRouteParams {
|
|
16
|
+
/**
|
|
17
|
+
* 数字签名
|
|
18
|
+
* 若用户申请的key为签名校验型key,则需要传递此参数
|
|
19
|
+
*/
|
|
20
|
+
sig?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 返回数据格式类型
|
|
23
|
+
* 可选值:JSON、XML
|
|
24
|
+
* @default 'JSON'
|
|
25
|
+
*/
|
|
26
|
+
output?: 'JSON' | 'XML';
|
|
27
|
+
/**
|
|
28
|
+
* 回调函数
|
|
29
|
+
* callback值是用户定义的函数名称,此参数只在output参数设置为JSON时有效
|
|
30
|
+
*/
|
|
31
|
+
callback?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 驾车路径规划策略(新版 V5 API)
|
|
35
|
+
*/
|
|
36
|
+
export declare enum DrivingStrategy {
|
|
37
|
+
/** 速度优先(只返回一条路线,此路线不一定距离最短) */
|
|
38
|
+
SPEED_FIRST = 0,
|
|
39
|
+
/** 费用优先(只返回一条路线,不走收费路段,且耗时最少) */
|
|
40
|
+
COST_FIRST = 1,
|
|
41
|
+
/** 常规最快(只返回一条路线,综合距离/耗时规划结果) */
|
|
42
|
+
REGULAR_FASTEST = 2,
|
|
43
|
+
/** 默认,高德推荐,同高德地图APP默认 */
|
|
44
|
+
DEFAULT = 32,
|
|
45
|
+
/** 躲避拥堵 */
|
|
46
|
+
AVOID_JAM = 33,
|
|
47
|
+
/** 高速优先 */
|
|
48
|
+
HIGHWAY_FIRST = 34,
|
|
49
|
+
/** 不走高速 */
|
|
50
|
+
NO_HIGHWAY = 35,
|
|
51
|
+
/** 少收费 */
|
|
52
|
+
LESS_TOLL = 36,
|
|
53
|
+
/** 大路优先 */
|
|
54
|
+
MAIN_ROAD_FIRST = 37,
|
|
55
|
+
/** 速度最快 */
|
|
56
|
+
FASTEST = 38,
|
|
57
|
+
/** 躲避拥堵 + 高速优先 */
|
|
58
|
+
AVOID_JAM_HIGHWAY_FIRST = 39,
|
|
59
|
+
/** 躲避拥堵 + 不走高速 */
|
|
60
|
+
AVOID_JAM_NO_HIGHWAY = 40,
|
|
61
|
+
/** 躲避拥堵 + 少收费 */
|
|
62
|
+
AVOID_JAM_LESS_TOLL = 41,
|
|
63
|
+
/** 少收费 + 不走高速 */
|
|
64
|
+
LESS_TOLL_NO_HIGHWAY = 42,
|
|
65
|
+
/** 躲避拥堵 + 少收费 + 不走高速 */
|
|
66
|
+
AVOID_JAM_LESS_TOLL_NO_HIGHWAY = 43,
|
|
67
|
+
/** 躲避拥堵 + 大路优先 */
|
|
68
|
+
AVOID_JAM_MAIN_ROAD = 44,
|
|
69
|
+
/** 躲避拥堵 + 速度最快 */
|
|
70
|
+
AVOID_JAM_FASTEST = 45
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 驾车路径规划请求参数(新版 V5 API)
|
|
74
|
+
*/
|
|
75
|
+
export interface DrivingRouteParams extends BaseRouteParams {
|
|
76
|
+
/** 出发点坐标,格式:"经度,纬度" 或 {longitude, latitude} */
|
|
77
|
+
origin: Coordinate;
|
|
78
|
+
/** 目的地坐标,格式:"经度,纬度" 或 {longitude, latitude} */
|
|
79
|
+
destination: Coordinate;
|
|
80
|
+
/**
|
|
81
|
+
* 终点的 POI 类别
|
|
82
|
+
* 当用户知道终点 POI 的类别时候,建议填充此值
|
|
83
|
+
*/
|
|
84
|
+
destination_type?: string;
|
|
85
|
+
/**
|
|
86
|
+
* 起点 POI ID
|
|
87
|
+
* 起点为 POI 时,建议填充此值,可提升路线规划准确性
|
|
88
|
+
*/
|
|
89
|
+
origin_id?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 目的地 POI ID
|
|
92
|
+
* 目的地为 POI 时,建议填充此值,可提升路径规划准确性
|
|
93
|
+
*/
|
|
94
|
+
destination_id?: string;
|
|
95
|
+
/**
|
|
96
|
+
* 驾车选择策略
|
|
97
|
+
* @default DrivingStrategy.DEFAULT (32)
|
|
98
|
+
*/
|
|
99
|
+
strategy?: DrivingStrategy;
|
|
100
|
+
/**
|
|
101
|
+
* 途经点坐标
|
|
102
|
+
* 默认支持1个有序途径点,最大支持16个途经点
|
|
103
|
+
* 格式:"经度1,纬度1;经度2,纬度2;..." 或数组
|
|
104
|
+
*/
|
|
105
|
+
waypoints?: Coordinate | Coordinate[];
|
|
106
|
+
/**
|
|
107
|
+
* 避让区域
|
|
108
|
+
* 默认支持1个避让区域,每个区域最多可有16个顶点
|
|
109
|
+
* 多个区域坐标用"|"分隔,最大支持32个避让区域
|
|
110
|
+
* 每个避让区域不能超过81平方公里
|
|
111
|
+
* 格式:"经度1,纬度1;经度2,纬度2|经度3,纬度3;经度4,纬度4"
|
|
112
|
+
*/
|
|
113
|
+
avoidpolygons?: string;
|
|
114
|
+
/**
|
|
115
|
+
* 车牌号
|
|
116
|
+
* 如:京AHA322,支持6位传统车牌和7位新能源车牌
|
|
117
|
+
* 用于判断限行相关
|
|
118
|
+
*/
|
|
119
|
+
plate?: string;
|
|
120
|
+
/**
|
|
121
|
+
* 车辆类型
|
|
122
|
+
* 0:普通燃油汽车(默认)
|
|
123
|
+
* 1:纯电动汽车
|
|
124
|
+
* 2:插电式混动汽车
|
|
125
|
+
* @default 0
|
|
126
|
+
*/
|
|
127
|
+
cartype?: 0 | 1 | 2;
|
|
128
|
+
/**
|
|
129
|
+
* 是否使用轮渡
|
|
130
|
+
* 0:使用渡轮(默认)
|
|
131
|
+
* 1:不使用渡轮
|
|
132
|
+
* @default 0
|
|
133
|
+
*/
|
|
134
|
+
ferry?: 0 | 1;
|
|
135
|
+
/**
|
|
136
|
+
* 返回结果控制
|
|
137
|
+
* 用来筛选 response 结果中可选字段
|
|
138
|
+
* 多个字段间采用","进行分割
|
|
139
|
+
* 可选值:cost, tmcs, navi, cities, polyline
|
|
140
|
+
* 未设置时,只返回基础信息
|
|
141
|
+
*/
|
|
142
|
+
show_fields?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 步行路径规划请求参数(新版 V5 API)
|
|
146
|
+
*/
|
|
147
|
+
export interface WalkingRouteParams extends BaseRouteParams {
|
|
148
|
+
/** 起点信息,经度在前,纬度在后 */
|
|
149
|
+
origin: Coordinate;
|
|
150
|
+
/** 目的地信息,经度在前,纬度在后 */
|
|
151
|
+
destination: Coordinate;
|
|
152
|
+
/**
|
|
153
|
+
* 起点 POI ID
|
|
154
|
+
* 起点为 POI 时,建议填充此值,可提升路线规划准确性
|
|
155
|
+
*/
|
|
156
|
+
origin_id?: string;
|
|
157
|
+
/**
|
|
158
|
+
* 目的地 POI ID
|
|
159
|
+
* 目的地为 POI 时,建议填充此值,可提升路线规划准确性
|
|
160
|
+
*/
|
|
161
|
+
destination_id?: string;
|
|
162
|
+
/**
|
|
163
|
+
* 返回路线条数
|
|
164
|
+
* 1:多备选路线中第一条路线
|
|
165
|
+
* 2:多备选路线中前两条路线
|
|
166
|
+
* 3:多备选路线中三条路线
|
|
167
|
+
* 不传则默认返回一条路线方案
|
|
168
|
+
*/
|
|
169
|
+
alternative_route?: 1 | 2 | 3;
|
|
170
|
+
/**
|
|
171
|
+
* 返回结果控制
|
|
172
|
+
* 用来筛选 response 结果中可选字段
|
|
173
|
+
* 多个字段间采用","进行分割
|
|
174
|
+
* 可选值:cost, navi, polyline
|
|
175
|
+
* 未设置时,只返回基础信息
|
|
176
|
+
*/
|
|
177
|
+
show_fields?: string;
|
|
178
|
+
/**
|
|
179
|
+
* 是否需要室内算路
|
|
180
|
+
* 0:不需要(默认)
|
|
181
|
+
* 1:需要
|
|
182
|
+
* @default 0
|
|
183
|
+
*/
|
|
184
|
+
isindoor?: 0 | 1;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 骑行路径规划请求参数
|
|
188
|
+
*/
|
|
189
|
+
export interface BicyclingRouteParams extends BaseRouteParams {
|
|
190
|
+
/** 起点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
191
|
+
origin: Coordinate;
|
|
192
|
+
/** 终点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
193
|
+
destination: Coordinate;
|
|
194
|
+
/**
|
|
195
|
+
* 返回结果控制
|
|
196
|
+
* 可选值:cost(成本信息), navi(导航信息), polyline(坐标点串)
|
|
197
|
+
* 多个字段用英文逗号分隔,如:"cost,navi,polyline"
|
|
198
|
+
* 未设置时,只返回基础信息
|
|
199
|
+
*/
|
|
200
|
+
show_fields?: string;
|
|
201
|
+
/**
|
|
202
|
+
* 返回方案条数
|
|
203
|
+
* 1:返回第一条路线
|
|
204
|
+
* 2:返回前两条路线
|
|
205
|
+
* 3:返回三条路线
|
|
206
|
+
* 不传则默认返回一条路线方案
|
|
207
|
+
*/
|
|
208
|
+
alternative_route?: 1 | 2 | 3;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* 电动车路径规划参数
|
|
212
|
+
*/
|
|
213
|
+
export interface ElectricBikeRouteParams extends BaseRouteParams {
|
|
214
|
+
/** 起点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
215
|
+
origin: Coordinate;
|
|
216
|
+
/** 终点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
217
|
+
destination: Coordinate;
|
|
218
|
+
/**
|
|
219
|
+
* 返回结果控制
|
|
220
|
+
* 可选值:cost(成本信息), navi(导航信息), polyline(坐标点串)
|
|
221
|
+
* 多个字段用英文逗号分隔,如:"cost,navi,polyline"
|
|
222
|
+
* 未设置时,只返回基础信息
|
|
223
|
+
*/
|
|
224
|
+
show_fields?: string;
|
|
225
|
+
/**
|
|
226
|
+
* 返回方案条数
|
|
227
|
+
* 1:返回第一条路线
|
|
228
|
+
* 2:返回前两条路线
|
|
229
|
+
* 3:返回三条路线
|
|
230
|
+
* 不传则默认返回一条路线方案
|
|
231
|
+
*/
|
|
232
|
+
alternative_route?: 1 | 2 | 3;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* 公交换乘策略(新版 V5 API)
|
|
236
|
+
*/
|
|
237
|
+
export declare enum TransitStrategy {
|
|
238
|
+
/** 推荐模式,综合权重,同高德APP默认 */
|
|
239
|
+
RECOMMENDED = 0,
|
|
240
|
+
/** 最经济模式,票价最低 */
|
|
241
|
+
CHEAPEST = 1,
|
|
242
|
+
/** 最少换乘模式,换乘次数少 */
|
|
243
|
+
LEAST_TRANSFER = 2,
|
|
244
|
+
/** 最少步行模式,尽可能减少步行距离 */
|
|
245
|
+
LEAST_WALK = 3,
|
|
246
|
+
/** 最舒适模式,尽可能乘坐空调车 */
|
|
247
|
+
MOST_COMFORTABLE = 4,
|
|
248
|
+
/** 不乘地铁模式,不乘坐地铁路线 */
|
|
249
|
+
NO_SUBWAY = 5,
|
|
250
|
+
/** 地铁图模式,起终点都是地铁站(此模式下 originpoi 及 destinationpoi 为必填项) */
|
|
251
|
+
SUBWAY_MAP = 6,
|
|
252
|
+
/** 地铁优先模式,步行距离不超过4KM */
|
|
253
|
+
SUBWAY_FIRST = 7,
|
|
254
|
+
/** 时间短模式,方案花费总时间最少 */
|
|
255
|
+
TIME_FIRST = 8
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* 公交路径规划请求参数(新版 V5 API)
|
|
259
|
+
*/
|
|
260
|
+
export interface TransitRouteParams extends BaseRouteParams {
|
|
261
|
+
/** 起点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
262
|
+
origin: Coordinate;
|
|
263
|
+
/** 终点经纬度,格式:"经度,纬度" 或 { longitude, latitude } */
|
|
264
|
+
destination: Coordinate;
|
|
265
|
+
/**
|
|
266
|
+
* 起点 POI ID
|
|
267
|
+
* 1、起点 POI ID 与起点经纬度均填写时,服务使用起点 POI ID
|
|
268
|
+
* 2、该字段必须和目的地 POI ID 成组使用
|
|
269
|
+
* 3、地铁图模式(strategy=6)下此参数为必填项
|
|
270
|
+
*/
|
|
271
|
+
originpoi?: string;
|
|
272
|
+
/**
|
|
273
|
+
* 目的地 POI ID
|
|
274
|
+
* 1、目的地 POI ID 与目的地经纬度均填写时,服务使用目的地 POI ID
|
|
275
|
+
* 2、该字段必须和起点 POI ID 成组使用
|
|
276
|
+
* 3、地铁图模式(strategy=6)下此参数为必填项
|
|
277
|
+
*/
|
|
278
|
+
destinationpoi?: string;
|
|
279
|
+
/**
|
|
280
|
+
* 起点所在行政区域编码
|
|
281
|
+
* 仅支持 adcode
|
|
282
|
+
*/
|
|
283
|
+
ad1?: string;
|
|
284
|
+
/**
|
|
285
|
+
* 终点所在行政区域编码
|
|
286
|
+
* 仅支持 adcode
|
|
287
|
+
*/
|
|
288
|
+
ad2?: string;
|
|
289
|
+
/**
|
|
290
|
+
* 起点所在城市(必填)
|
|
291
|
+
* 仅支持 citycode,相同时代表同城,不同时代表跨城
|
|
292
|
+
*/
|
|
293
|
+
city1: string;
|
|
294
|
+
/**
|
|
295
|
+
* 目的地所在城市(必填)
|
|
296
|
+
* 仅支持 citycode,相同时代表同城,不同时代表跨城
|
|
297
|
+
*/
|
|
298
|
+
city2: string;
|
|
299
|
+
/**
|
|
300
|
+
* 公交换乘策略
|
|
301
|
+
* @default TransitStrategy.RECOMMENDED (0)
|
|
302
|
+
*/
|
|
303
|
+
strategy?: TransitStrategy;
|
|
304
|
+
/**
|
|
305
|
+
* 返回方案条数
|
|
306
|
+
* 可传入1-10的阿拉伯数字,代表返回的不同条数
|
|
307
|
+
* @default 5
|
|
308
|
+
*/
|
|
309
|
+
AlternativeRoute?: number;
|
|
310
|
+
/**
|
|
311
|
+
* 地铁出入口数量
|
|
312
|
+
* 0:只返回一个地铁出入口
|
|
313
|
+
* 1:返回全部地铁出入口
|
|
314
|
+
* @default 0
|
|
315
|
+
*/
|
|
316
|
+
multiexport?: 0 | 1;
|
|
317
|
+
/**
|
|
318
|
+
* 考虑夜班车
|
|
319
|
+
* 0:不考虑夜班车
|
|
320
|
+
* 1:考虑夜班车
|
|
321
|
+
* @default 0
|
|
322
|
+
*/
|
|
323
|
+
nightflag?: 0 | 1;
|
|
324
|
+
/**
|
|
325
|
+
* 请求日期
|
|
326
|
+
* 格式:YYYY-MM-DD,例如:2013-10-28
|
|
327
|
+
*/
|
|
328
|
+
date?: string;
|
|
329
|
+
/**
|
|
330
|
+
* 请求时间
|
|
331
|
+
* 格式:HH:MM 或 H-MM,例如:9:54 或 9-54
|
|
332
|
+
*/
|
|
333
|
+
time?: string;
|
|
334
|
+
/**
|
|
335
|
+
* 返回结果控制
|
|
336
|
+
* 用来筛选 response 结果中可选字段
|
|
337
|
+
* 多个字段间采用","进行分割
|
|
338
|
+
* 可选值:cost, navi, polyline
|
|
339
|
+
* 未设置时,只返回基础信息
|
|
340
|
+
*/
|
|
341
|
+
show_fields?: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 路径规划步骤(基础信息)
|
|
345
|
+
*/
|
|
346
|
+
export interface Step {
|
|
347
|
+
/** 行驶/步行指示 */
|
|
348
|
+
instruction: string;
|
|
349
|
+
/** 进入道路方向 */
|
|
350
|
+
orientation?: string;
|
|
351
|
+
/** 分段道路名称 */
|
|
352
|
+
road_name?: string;
|
|
353
|
+
/** 分段距离信息,单位:米 */
|
|
354
|
+
step_distance: string;
|
|
355
|
+
/** 以下字段需要通过 show_fields 参数设置才返回 */
|
|
356
|
+
/** 导航主要动作指令(需要 show_fields=navi) */
|
|
357
|
+
action?: string;
|
|
358
|
+
/** 导航辅助动作指令(需要 show_fields=navi) */
|
|
359
|
+
assistant_action?: string;
|
|
360
|
+
/**
|
|
361
|
+
* 道路类型(步行路径特有,需要 show_fields=navi)
|
|
362
|
+
* 0-普通道路, 1-人行横道, 3-地下通道, 4-过街天桥,
|
|
363
|
+
* 5-地铁通道, 6-公园, 7-广场, 8-扶梯, 9-直梯,
|
|
364
|
+
* 10-索道, 11-空中通道, 12-建筑物穿越通道,
|
|
365
|
+
* 13-行人通道, 14-游船路线, 15-观光车路线, 16-滑道,
|
|
366
|
+
* 18-扩路, 19-道路附属连接线, 20-阶梯, 21-斜坡,
|
|
367
|
+
* 22-桥, 23-隧道, 30-轮渡
|
|
368
|
+
*/
|
|
369
|
+
walk_type?: string;
|
|
370
|
+
/** 分路段坐标点串,两点间用";"分隔(需要 show_fields=polyline) */
|
|
371
|
+
polyline?: string;
|
|
372
|
+
/** 路况信息(驾车路径特有,需要 show_fields=tmcs) */
|
|
373
|
+
tmcs?: Array<{
|
|
374
|
+
/** 路况信息:未知、畅通、缓行、拥堵、严重拥堵 */
|
|
375
|
+
tmc_status: string;
|
|
376
|
+
/** 从当前坐标点开始 step 中路况相同的距离,单位:米 */
|
|
377
|
+
tmc_distance: string;
|
|
378
|
+
/** 此段路况涉及的道路坐标点串,点间用","分隔 */
|
|
379
|
+
tmc_polyline: string;
|
|
380
|
+
}>;
|
|
381
|
+
/** 途径城市信息(驾车路径特有,需要 show_fields=cities) */
|
|
382
|
+
cities?: Array<{
|
|
383
|
+
/** 途径区域编码 */
|
|
384
|
+
adcode: string;
|
|
385
|
+
/** 途径城市编码 */
|
|
386
|
+
citycode: string;
|
|
387
|
+
/** 途径城市名称 */
|
|
388
|
+
city: string;
|
|
389
|
+
/** 途径区县信息 */
|
|
390
|
+
district?: Array<{
|
|
391
|
+
/** 途径区县名称 */
|
|
392
|
+
name: string;
|
|
393
|
+
/** 途径区县 adcode */
|
|
394
|
+
adcode: string;
|
|
395
|
+
}>;
|
|
396
|
+
}>;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* 路径成本信息(需要 show_fields=cost)
|
|
400
|
+
*/
|
|
401
|
+
export interface PathCost {
|
|
402
|
+
/** 线路耗时,单位:秒 */
|
|
403
|
+
duration?: string;
|
|
404
|
+
/** 此路线道路收费,单位:元(仅驾车) */
|
|
405
|
+
tolls?: string;
|
|
406
|
+
/** 收费路段里程,单位:米(仅驾车) */
|
|
407
|
+
toll_distance?: string;
|
|
408
|
+
/** 主要收费道路(仅驾车) */
|
|
409
|
+
toll_road?: string;
|
|
410
|
+
/** 方案中红绿灯个数,单位:个(仅驾车) */
|
|
411
|
+
traffic_lights?: string;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* 路径信息
|
|
415
|
+
*/
|
|
416
|
+
export interface Path {
|
|
417
|
+
/** 方案距离,单位:米 */
|
|
418
|
+
distance: string;
|
|
419
|
+
/** 限行结果:0-限行已规避或未限行,1-限行无法规避(仅驾车) */
|
|
420
|
+
restriction?: string;
|
|
421
|
+
/** 路线分段 */
|
|
422
|
+
steps: Step[];
|
|
423
|
+
/** 以下字段需要通过 show_fields 参数设置才返回 */
|
|
424
|
+
/** 成本信息(需要 show_fields=cost)- 作为对象返回 */
|
|
425
|
+
cost?: PathCost;
|
|
426
|
+
/** 预估打车费用,单位:元(仅步行路径,且方案级别才有,steps 中不返回) */
|
|
427
|
+
taxi?: string;
|
|
428
|
+
/** 以下字段为向后兼容保留,实际 API 返回在 cost 对象中 */
|
|
429
|
+
/** @deprecated 使用 cost.duration 代替 */
|
|
430
|
+
duration?: string;
|
|
431
|
+
/** @deprecated 使用 cost.tolls 代替 */
|
|
432
|
+
tolls?: string;
|
|
433
|
+
/** @deprecated 使用 cost.toll_distance 代替 */
|
|
434
|
+
toll_distance?: string;
|
|
435
|
+
/** @deprecated 使用 cost.toll_road 代替 */
|
|
436
|
+
toll_road?: string;
|
|
437
|
+
/** @deprecated 使用 cost.traffic_lights 代替 */
|
|
438
|
+
traffic_lights?: string;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* 路线规划结果
|
|
442
|
+
*/
|
|
443
|
+
export interface Route {
|
|
444
|
+
/** 起点坐标 */
|
|
445
|
+
origin: string;
|
|
446
|
+
/** 终点坐标 */
|
|
447
|
+
destination: string;
|
|
448
|
+
/** 出租车费用,单位:元 */
|
|
449
|
+
taxi_cost?: string;
|
|
450
|
+
/** 路径规划方案列表 */
|
|
451
|
+
paths: Path[];
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* 驾车路径规划响应
|
|
455
|
+
*/
|
|
456
|
+
export interface DrivingRouteResponse {
|
|
457
|
+
/** 状态码:1-成功,0-失败 */
|
|
458
|
+
status: string;
|
|
459
|
+
/** 状态说明 */
|
|
460
|
+
info: string;
|
|
461
|
+
/** 状态码说明 */
|
|
462
|
+
infocode: string;
|
|
463
|
+
/** 路线规划结果数量 */
|
|
464
|
+
count: string;
|
|
465
|
+
/** 路线规划方案 */
|
|
466
|
+
route: Route;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* 步行路径规划响应
|
|
470
|
+
*/
|
|
471
|
+
export interface WalkingRouteResponse {
|
|
472
|
+
/** 状态码:1-成功,0-失败 */
|
|
473
|
+
status: string;
|
|
474
|
+
/** 状态说明 */
|
|
475
|
+
info: string;
|
|
476
|
+
/** 状态码说明 */
|
|
477
|
+
infocode: string;
|
|
478
|
+
/** 路线规划结果数量 */
|
|
479
|
+
count: string;
|
|
480
|
+
/** 路线规划方案 */
|
|
481
|
+
route: Route;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* 骑行路径规划响应
|
|
485
|
+
*/
|
|
486
|
+
export interface BicyclingRouteResponse {
|
|
487
|
+
/** 状态码:1-成功,0-失败 */
|
|
488
|
+
status: string;
|
|
489
|
+
/** 状态说明 */
|
|
490
|
+
info: string;
|
|
491
|
+
/** 状态码说明 */
|
|
492
|
+
infocode: string;
|
|
493
|
+
/** 路线规划结果数量 */
|
|
494
|
+
count: string;
|
|
495
|
+
/** 路线规划方案 */
|
|
496
|
+
route: Route;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* 电动车路径规划响应
|
|
500
|
+
*/
|
|
501
|
+
export interface ElectricBikeRouteResponse {
|
|
502
|
+
/** 状态码:1-成功,0-失败 */
|
|
503
|
+
status: string;
|
|
504
|
+
/** 状态说明 */
|
|
505
|
+
info: string;
|
|
506
|
+
/** 状态码说明 */
|
|
507
|
+
infocode: string;
|
|
508
|
+
/** 路线规划结果数量 */
|
|
509
|
+
count: string;
|
|
510
|
+
/** 路线规划方案 */
|
|
511
|
+
route: Route;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* 公交线路
|
|
515
|
+
*/
|
|
516
|
+
export interface BusLine {
|
|
517
|
+
/** 公交线路名称 */
|
|
518
|
+
name: string;
|
|
519
|
+
/** 公交线路ID */
|
|
520
|
+
id: string;
|
|
521
|
+
/** 公交类型 */
|
|
522
|
+
type: string;
|
|
523
|
+
/** 上车站 */
|
|
524
|
+
departure_stop: {
|
|
525
|
+
/** 站点名称 */
|
|
526
|
+
name: string;
|
|
527
|
+
/** 站点坐标 */
|
|
528
|
+
location: string;
|
|
529
|
+
};
|
|
530
|
+
/** 下车站 */
|
|
531
|
+
arrival_stop: {
|
|
532
|
+
/** 站点名称 */
|
|
533
|
+
name: string;
|
|
534
|
+
/** 站点坐标 */
|
|
535
|
+
location: string;
|
|
536
|
+
};
|
|
537
|
+
/** 途经站数 */
|
|
538
|
+
via_num: string;
|
|
539
|
+
/** 票价,单位:元 */
|
|
540
|
+
cost: string;
|
|
541
|
+
/** 乘坐距离,单位:米 */
|
|
542
|
+
distance: string;
|
|
543
|
+
/** 预计时间,单位:秒 */
|
|
544
|
+
duration: string;
|
|
545
|
+
/** 路径坐标点串 */
|
|
546
|
+
polyline: string;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* 公交换乘段
|
|
550
|
+
*/
|
|
551
|
+
export interface TransitSegment {
|
|
552
|
+
/** 步行 */
|
|
553
|
+
walking?: {
|
|
554
|
+
/** 起点坐标 */
|
|
555
|
+
origin: string;
|
|
556
|
+
/** 终点坐标 */
|
|
557
|
+
destination: string;
|
|
558
|
+
/** 步行距离,单位:米 */
|
|
559
|
+
distance: string;
|
|
560
|
+
/** 步行时间,单位:秒 */
|
|
561
|
+
duration: string;
|
|
562
|
+
/** 步行路径坐标 */
|
|
563
|
+
steps: Step[];
|
|
564
|
+
};
|
|
565
|
+
/** 公交 */
|
|
566
|
+
bus?: {
|
|
567
|
+
/** 公交线路列表 */
|
|
568
|
+
buslines: BusLine[];
|
|
569
|
+
};
|
|
570
|
+
/** 地铁 */
|
|
571
|
+
railway?: {
|
|
572
|
+
/** 地铁线路列表 */
|
|
573
|
+
buslines: BusLine[];
|
|
574
|
+
};
|
|
575
|
+
/** 出租车 */
|
|
576
|
+
taxi?: {
|
|
577
|
+
/** 起点坐标 */
|
|
578
|
+
origin: string;
|
|
579
|
+
/** 终点坐标 */
|
|
580
|
+
destination: string;
|
|
581
|
+
/** 行驶距离,单位:米 */
|
|
582
|
+
distance: string;
|
|
583
|
+
/** 预计时间,单位:秒 */
|
|
584
|
+
duration: string;
|
|
585
|
+
/** 出租车费用,单位:元 */
|
|
586
|
+
sname: string;
|
|
587
|
+
/** 目的地名称 */
|
|
588
|
+
tname: string;
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* 公交换乘成本信息
|
|
593
|
+
*/
|
|
594
|
+
export interface TransitCost {
|
|
595
|
+
/** 线路耗时,单位:秒 */
|
|
596
|
+
duration?: string;
|
|
597
|
+
/** 公交费用,单位:元 */
|
|
598
|
+
transit_fee?: string;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* 公交换乘方案
|
|
602
|
+
*/
|
|
603
|
+
export interface Transit {
|
|
604
|
+
/** 换乘距离,单位:米 */
|
|
605
|
+
distance: string;
|
|
606
|
+
/** 换乘成本信息(包含时间和费用) */
|
|
607
|
+
cost: TransitCost;
|
|
608
|
+
/** 是否夜班车 */
|
|
609
|
+
nightflag: string;
|
|
610
|
+
/** 步行距离,单位:米 */
|
|
611
|
+
walking_distance: string;
|
|
612
|
+
/** 换乘路段列表 */
|
|
613
|
+
segments: TransitSegment[];
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* 公交路径规划响应
|
|
617
|
+
*/
|
|
618
|
+
export interface TransitRouteResponse {
|
|
619
|
+
/** 状态码:1-成功,0-失败 */
|
|
620
|
+
status: string;
|
|
621
|
+
/** 状态说明 */
|
|
622
|
+
info: string;
|
|
623
|
+
/** 状态码说明 */
|
|
624
|
+
infocode: string;
|
|
625
|
+
/** 路线规划结果数量 */
|
|
626
|
+
count: string;
|
|
627
|
+
/** 路线规划方案 */
|
|
628
|
+
route: {
|
|
629
|
+
/** 起点坐标 */
|
|
630
|
+
origin: string;
|
|
631
|
+
/** 终点坐标 */
|
|
632
|
+
destination: string;
|
|
633
|
+
/** 公交换乘方案列表 */
|
|
634
|
+
transits: Transit[];
|
|
635
|
+
};
|
|
636
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 高德地图路径规划 API 类型定义
|
|
4
|
+
* 文档:https://lbs.amap.com/api/webservice/guide/api/newroute
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TransitStrategy = exports.DrivingStrategy = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* 驾车路径规划策略(新版 V5 API)
|
|
10
|
+
*/
|
|
11
|
+
var DrivingStrategy;
|
|
12
|
+
(function (DrivingStrategy) {
|
|
13
|
+
/** 速度优先(只返回一条路线,此路线不一定距离最短) */
|
|
14
|
+
DrivingStrategy[DrivingStrategy["SPEED_FIRST"] = 0] = "SPEED_FIRST";
|
|
15
|
+
/** 费用优先(只返回一条路线,不走收费路段,且耗时最少) */
|
|
16
|
+
DrivingStrategy[DrivingStrategy["COST_FIRST"] = 1] = "COST_FIRST";
|
|
17
|
+
/** 常规最快(只返回一条路线,综合距离/耗时规划结果) */
|
|
18
|
+
DrivingStrategy[DrivingStrategy["REGULAR_FASTEST"] = 2] = "REGULAR_FASTEST";
|
|
19
|
+
/** 默认,高德推荐,同高德地图APP默认 */
|
|
20
|
+
DrivingStrategy[DrivingStrategy["DEFAULT"] = 32] = "DEFAULT";
|
|
21
|
+
/** 躲避拥堵 */
|
|
22
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM"] = 33] = "AVOID_JAM";
|
|
23
|
+
/** 高速优先 */
|
|
24
|
+
DrivingStrategy[DrivingStrategy["HIGHWAY_FIRST"] = 34] = "HIGHWAY_FIRST";
|
|
25
|
+
/** 不走高速 */
|
|
26
|
+
DrivingStrategy[DrivingStrategy["NO_HIGHWAY"] = 35] = "NO_HIGHWAY";
|
|
27
|
+
/** 少收费 */
|
|
28
|
+
DrivingStrategy[DrivingStrategy["LESS_TOLL"] = 36] = "LESS_TOLL";
|
|
29
|
+
/** 大路优先 */
|
|
30
|
+
DrivingStrategy[DrivingStrategy["MAIN_ROAD_FIRST"] = 37] = "MAIN_ROAD_FIRST";
|
|
31
|
+
/** 速度最快 */
|
|
32
|
+
DrivingStrategy[DrivingStrategy["FASTEST"] = 38] = "FASTEST";
|
|
33
|
+
/** 躲避拥堵 + 高速优先 */
|
|
34
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_HIGHWAY_FIRST"] = 39] = "AVOID_JAM_HIGHWAY_FIRST";
|
|
35
|
+
/** 躲避拥堵 + 不走高速 */
|
|
36
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_NO_HIGHWAY"] = 40] = "AVOID_JAM_NO_HIGHWAY";
|
|
37
|
+
/** 躲避拥堵 + 少收费 */
|
|
38
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_LESS_TOLL"] = 41] = "AVOID_JAM_LESS_TOLL";
|
|
39
|
+
/** 少收费 + 不走高速 */
|
|
40
|
+
DrivingStrategy[DrivingStrategy["LESS_TOLL_NO_HIGHWAY"] = 42] = "LESS_TOLL_NO_HIGHWAY";
|
|
41
|
+
/** 躲避拥堵 + 少收费 + 不走高速 */
|
|
42
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_LESS_TOLL_NO_HIGHWAY"] = 43] = "AVOID_JAM_LESS_TOLL_NO_HIGHWAY";
|
|
43
|
+
/** 躲避拥堵 + 大路优先 */
|
|
44
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_MAIN_ROAD"] = 44] = "AVOID_JAM_MAIN_ROAD";
|
|
45
|
+
/** 躲避拥堵 + 速度最快 */
|
|
46
|
+
DrivingStrategy[DrivingStrategy["AVOID_JAM_FASTEST"] = 45] = "AVOID_JAM_FASTEST";
|
|
47
|
+
})(DrivingStrategy || (exports.DrivingStrategy = DrivingStrategy = {}));
|
|
48
|
+
/**
|
|
49
|
+
* 公交换乘策略(新版 V5 API)
|
|
50
|
+
*/
|
|
51
|
+
var TransitStrategy;
|
|
52
|
+
(function (TransitStrategy) {
|
|
53
|
+
/** 推荐模式,综合权重,同高德APP默认 */
|
|
54
|
+
TransitStrategy[TransitStrategy["RECOMMENDED"] = 0] = "RECOMMENDED";
|
|
55
|
+
/** 最经济模式,票价最低 */
|
|
56
|
+
TransitStrategy[TransitStrategy["CHEAPEST"] = 1] = "CHEAPEST";
|
|
57
|
+
/** 最少换乘模式,换乘次数少 */
|
|
58
|
+
TransitStrategy[TransitStrategy["LEAST_TRANSFER"] = 2] = "LEAST_TRANSFER";
|
|
59
|
+
/** 最少步行模式,尽可能减少步行距离 */
|
|
60
|
+
TransitStrategy[TransitStrategy["LEAST_WALK"] = 3] = "LEAST_WALK";
|
|
61
|
+
/** 最舒适模式,尽可能乘坐空调车 */
|
|
62
|
+
TransitStrategy[TransitStrategy["MOST_COMFORTABLE"] = 4] = "MOST_COMFORTABLE";
|
|
63
|
+
/** 不乘地铁模式,不乘坐地铁路线 */
|
|
64
|
+
TransitStrategy[TransitStrategy["NO_SUBWAY"] = 5] = "NO_SUBWAY";
|
|
65
|
+
/** 地铁图模式,起终点都是地铁站(此模式下 originpoi 及 destinationpoi 为必填项) */
|
|
66
|
+
TransitStrategy[TransitStrategy["SUBWAY_MAP"] = 6] = "SUBWAY_MAP";
|
|
67
|
+
/** 地铁优先模式,步行距离不超过4KM */
|
|
68
|
+
TransitStrategy[TransitStrategy["SUBWAY_FIRST"] = 7] = "SUBWAY_FIRST";
|
|
69
|
+
/** 时间短模式,方案花费总时间最少 */
|
|
70
|
+
TransitStrategy[TransitStrategy["TIME_FIRST"] = 8] = "TIME_FIRST";
|
|
71
|
+
})(TransitStrategy || (exports.TransitStrategy = TransitStrategy = {}));
|