1.0.2 • Published 5 years ago

latlng-distance v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

latlng-distance

Calculate distance in-between given coordinates. This uses Haversine formula to perform calculations.

npm

Installation

Since the library is a JS-based solution, to install the latest version of latlng-distance, just hit following:

npm install latlng-distance

Usage

let  latlngDist  =  require('latlng-distance');

/**
 * Galle and Colombo are some cool places in Sri lanka :)
 */
let colombo = {
	lat:6.927079,
	lon:79.861244
};

let galle = {
	lat:6.053519,
	lon:80.220978
};

let  dist  =  latlngDist.distanceDiffInKm(colombo,galle);