Get distance between two geographic coordinates
jeyo-distans use the umd implementation to be usable from anywhere (client, server, ...).
Install the module with:
npm install jeyo-distans
Use it with:
jeyoDistans = require( "jeyo-distans" );
The jeyo-distans module exposts an unique function :
jeyoDistans( positionOne, positionTwo )
The two arguments represents geographic coordinates formated as :
Array, where the first member is a
Numberrepresenting the latitude of the position, and the second member is a
Numberrepresenting the longitude Of the position.
Object, where the
latproperty is a
Numberrepresenting the latitude of the position, and the
lngproperty is a
Numberrepresenting the longitude of the position.
Te returns value is a
Number, representing the distance between the two positions, in kilometers (with
3 decimal numbers).
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2014 Leny
Licensed under the MIT license.