nearest-loc-finder
v1.1.2
Published
This will return data points within provided distance.
Downloads
8
Readme
/* This code will require the geo npm module then call getNearestCustomers Method from library. */
npm install nearest-loc-finder
const GeoLocation = require("nearest-loc-finder"); //Import Geo Module
let distance = 100; //In KM
let customers = GeoLocation.getNearestRecords(28.5355, 77.3910, distance, "KM") //With 100 KM to Dublin
let sortedCustomers = GeoLocation.sortRecords(customers, "asc"); // Sorting of customers
console.log("list of customers in", distance, "KM: ", sortedCustomers);