/country-geolocalizer

This module takes a latitude and longitude and determine the country where it is contained.

Primary LanguageJavaScriptISC LicenseISC

⚠️ DEPRECATION WARNING!

Version no longer supported.


country-geolocalizer

This module takes a latitude and longitude and determine the country where it is contained.

Install

npm install --save country-geolocalizer

Testing the library

npm run test

Examples

Get country from the following latitude/longitude (Madrid):

const result = getCountry(40.4167047, -3.7035825);

console.log(result);
// {
//     ADMIN: 'Spain',
//      ISO_A3: 'ESP'
// }

Get null from a latitude/longitude in the middle of the sea:

const result = getCountry(0.0, 0.0);

console.log(result);
// null

Acknowledgment