Skip to content

Commit

Permalink
type(types): Modify driving search method issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 31, 2022
1 parent 0f7bfc1 commit 849629f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/types/src/driving.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
/// <reference path="./core.d.ts" />

declare namespace AMap {
interface DrivingSearch {
/**
* 根据起点、终点和途经点(可选)坐标或名称,实现驾车路线规划,途经点通过opts设定
* @param points 终点经纬度points为起点、终点和途经点(可选)名称及对应城市的数组,例如: [{keyword:‘北京南站’,city:‘北京市’},{keyword:‘广东大厦’,city:’北京市’},{ keyword:‘北京西站’,city:‘北京市’}] 系统取数组第一个元素和最后一个元素作为起点和终点,中间元素为途经点;
* @param callback status为complete时,result为DrivingResult;当status为error时,result为错误信息info;当status为no_data时,代表检索返回0结果。
*/
(points: Array<{keyword: string;city: string}>, callback: (result: DrivingCallback) => void): void;
/** 根据起点、终点和途经点(可选)坐标或名称,实现驾车路线规划,途经点通过opts设定 */
(origin: LngLat, destination: LngLat, opts: { waypoints: Array<LngLat>; }, callback: (result: DrivingCallback) => void): void;
}
/**
* 驾车路线规划服务,提供起、终点坐标的驾车导航路线[查询功能](https://a.amap.com/jsapi/static/doc/index.html#drivingresult)。
* AMap.Driving 构造函数的参数为 DrivingOptions 对象。
Expand All @@ -12,14 +22,7 @@ declare namespace AMap {
constructor(opts: DrivingOptions);
/** 清除搜索结果 */
clear(): void;
/**
* 根据起点、终点和途经点(可选)坐标或名称,实现驾车路线规划,途经点通过opts设定
* @param points 终点经纬度points为起点、终点和途经点(可选)名称及对应城市的数组,例如: [{keyword:‘北京南站’,city:‘北京市’},{keyword:‘广东大厦’,city:’北京市’},{ keyword:‘北京西站’,city:‘北京市’}] 系统取数组第一个元素和最后一个元素作为起点和终点,中间元素为途经点;
* @param callback status为complete时,result为DrivingResult;当status为error时,result为错误信息info;当status为no_data时,代表检索返回0结果。
*/
search(points: Array<{keyword: string;city: string}>, callback: (result: DrivingCallback) => void);
/** 根据起点、终点和途经点(可选)坐标或名称,实现驾车路线规划,途经点通过opts设定 */
search(origin: LngLat, destination: LngLat, opts: { waypoints: Array<LngLat>; }, callback: (result: DrivingCallback) => void);
search: DrivingSearch;
/** 设置避让区域,最大支持三个避让区域,参数为LngLat的二维数组 */
setAvoidPolygons(areas: Array<Array<LngLatLike>>): void;
/** 清除避让区域 */
Expand Down

1 comment on commit 849629f

@vercel
Copy link

@vercel vercel bot commented on 849629f May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-amap – ./

react-amap-git-master-398188662.vercel.app
react-amap-one.vercel.app
react-amap-398188662.vercel.app

Please sign in to comment.