nwhite89 / js.geo-distance

Compares a geographical longitude / latitude too Km, Miles etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status devDependency Status Coverage Status

#js.geo-distance

Install

bower install js.geo-distance

Then adding to your web page

<script type="text/javascript" src="src/distance.js"></script>

About JS Geo Distance

This plugin was build based on Chris Veness' JavaScript plugin found www.movable-type.co.uk/scripts/latlong.html

Using

var to = [
    {
        lat: -22.853840,
        lng: 19.882812
    },
    {
        lat: 44.514772,
        lng: 20.058594
    }
];
var from = {
    lat: 58.114637,
    lng: -4.375000
};


geoDistance.init(from, to, 'asc', 'feet', 2);

About

Compares a geographical longitude / latitude too Km, Miles etc.

License:MIT License


Languages

Language:JavaScript 100.0%