Skip to content

Commit

Permalink
fix: Lnglat.distance in base.d.ts (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoshinoSuzumi committed Apr 5, 2024
1 parent 42aa76c commit 3e1fb25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/types/src/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ declare namespace AMap {
* @returns 格式如'lng值,lat值'的字符串
*/
toArray?(): string;
distanceTo?(another: LngLat): number;
/**
* 计算当前经纬度距离另一个经纬度或者经纬度数组组成的路径的距离 [相关示例](https://lbs.amap.com/api/javascript-api/example/calcutation/calculate-distance-between-two-markers/)
* @returns 距离值,单位为米
*/
distance?(): number;
distance?(another: LngLat): number;
}
type Vector = number[];
type LngLatLike = LngLat | [number, number];
Expand Down Expand Up @@ -294,4 +295,4 @@ declare namespace AMap {
/** 触摸结束时触发事件,仅适用移动设备 */
onTouchEnd?(event: MapsEvent): void;
}
}
}

0 comments on commit 3e1fb25

Please sign in to comment.