calculate-distance-between-coordinates
Version:
Calculate the distance between coordinates
9 lines (8 loc) • 324 B
TypeScript
export declare type Coordinate = {
lat: number;
lon: number;
};
declare type Unit = 'km' | 'mile';
export declare function getDistanceBetweenTwoPoints(cord1: Coordinate, cord2: Coordinate, unit?: Unit): number;
export declare function getTotalDistance(coordinates: Coordinate[], unit?: Unit): string | 0;
export {};