1.0.1 • Published 5 years ago
within-distance v1.0.1
#Within Distance The library expoted as Node.js Module which can get location points within the given distance.
##Installaion
$ npm i within-distance
##Use
const { findUserWithinDis } = require('within-distance');
//This function accepts fours argumets
//1 file path
//2 distance within which you want location from file
//3 Latitude of the point from which you want to calculate distance
//4 Longitude of the point from which you want to calculate distance
findUserWithinDis('inputjson.txt', 100, 53.339428, -6.257664).then(users => {
console.log(users);
}).catch(e => {
console.log(e);
});
##File type
The you are passing must be a text file containg a json data in every line like this
{"latitude": "52.986375", "user_id": 12, "longitude": "-6.043701"} {"latitude": "51.92893", "user_id": 1, "longitude": "-10.27699"}
must caontain latitude and longitude.