fnd-customer-geoloc
v1.0.0
Published
The fnd-customer-geoloc Node library provides convenient access to the user list from given source file within passed range.
Downloads
2
Readme
Get customer List by Geolocation
The fnd-customer-geoloc Node library provides convenient access to the user list from given source file within passed range.
###Installation Install the package with:
npm install fnd-customer-geoloc --save
Include and set keys
var geoloclib = require('fnd-customer-geoloc');
var sourcelat='53.339428';
var sourcelong = '-6.257664';
var filename = 'customers.txt';
var range = 100;
var sortBy ='user_id';
geoloclib.setCustomerParams(sourcelat,sourcelong,filename,range,sortBy);
geoloclib.getcustomersInfo().then(result=>{
console.log(result);
});
Sample File Format
{"latitude": "52.986375", "user_id": 12, "name": "Christina McArdle", "longitude": "-6.043701"}
{"latitude": "51.92893", "user_id": 1, "name": "Alice Cahill", "longitude": "-10.27699"}
{"latitude": "51.8856167", "user_id": 2, "name": "Ian McArdle", "longitude": "-10.4240951"}
{"latitude": "52.3191841", "user_id": 3, "name": "Jack Enright", "longitude": "-8.5072391"}
{"latitude": "53.807778", "user_id": 28, "name": "Charlie Halligan", "longitude": "-7.714444"}
{"latitude": "53.4692815", "user_id": 7, "name": "Frank Kehoe", "longitude": "-9.436036"}