get-distance-between-points

1.2.0 • Public • Published

get-distance-between-points

Distance between two points of coordinates in Google Maps - Earth

This module has no dependencies ;)

Build Status

Installation

$ npm install get-distance-between-points --save

Usage

var getDistanceBetweenPoints = require('get-distance-between-points');
var distanceInMeters = getDistanceBetweenPoints.getDistanceBetweenPoints(
    -12.119012, -77.029235, // Lat, Long of point A
    -12.102870, -77.026983 // Lat, Long of point B
);
 
// Outputs: Distance in Meters:  1813.5586276614192
console.log("Distance in Meters: ", distanceInMeters);
 
// Outputs: Distance in Kilometers:  1.8135586276614193
console.log("Distance in Kilometers: ", (distanceInMeters * 0.001));

Package Sidebar

Install

npm i get-distance-between-points

Weekly Downloads

15

Version

1.2.0

License

MIT

Unpacked Size

5.19 kB

Total Files

7

Last publish

Collaborators

  • wilzonmb