geo_decoder

Easily manipulate time and distance

Usage no npm install needed!

<script type="module">
  import geoDecoder from 'https://cdn.skypack.dev/geo_decoder';
</script>

README

Geo_decoder

synopsis for getting address

var geo = require('geo_decoder');

geo.getAddress(latitude, longitude, function(err, result) {
    if (err) {
        console.log(err);
    } else {

        console.log(result);
}
// response
{ address: 'A-4, NH 64, Green Enclave, Lohgarh, Zirakpur, Punjab 140603, India',
  postal_code: '140603',
  country_code: 'PB',
  country: 'Punjab' }

synopsis for getting longitude and latitude

var geo = require('geo_decoder');
geo.getLatLong("Enter Your Address Here",function(err,result){
    // console.log('err===',err,result);
    if(err){
        console.log(err);
    }else{

console.log(result);

    }
});
// response
{ latitude: 30.7112416, longitude: 76.7927981 }

synopsis for getting distance between longitude and latitude

var geo = require('geo_decoder');
var latitude = {
    x: 1,
    y: 1
};
var longitude = {
    x: 4,
    y: 5
};
var distace = geo.distance(p1, p2);
console.log("Distance between: ", p1, " and ", p2, " is:", distace);