Posts

Showing posts with the label which-country

Use node which-country

Image
I  need to take the users country based on the geo-codinates provided by the mobile application. whlile doing some reaserch in node which-country , I found that ituseful,but need to pass value wisely.  https://www.npmjs.com/package/which-country  var whichCountry = require('which-country'); // pass it as  [latitudes,logitudes] var userCountry = whichCountry([6.795019389999998,79.88569332999997]); console.log('test userCountry :'+userCountry);  //return null // pass it as [logitudes,latitudes] var userCountry = whichCountry([79.88569332999997,6.795019389999998]); console.log('test userCountry :'+userCountry);  //return LKA I test the application with the given code of me in the test packges given by them. https://github.com/vkurchatkin/which-country/blob/master/package.json AUS -22.000825,132.889122 BLR 52.337547,24.080529 CAN 57.255393,-106.712553 CYP 35.315045,33.681395 DZA 23.184085,7.117638 ITA 39.926747,9.017427 JPN 43.771243,142.764986