Home > @magiclane/maps-sdk > MapDetails > getCountryCode

MapDetails.getCountryCode() method

Returns the ISO 3166-1 alpha-3 country code for the supplied WGS84 coordinates.

The method returns an empty string when the coordinates do not fall within any recognised country.

Signature:

static getCountryCode(coords: Coordinates): string;

Parameters

Parameter

Type

Description

coords

Coordinates

WGS84 coordinates

Returns:

string

ISO 3166-1 alpha-3 country code, or an empty string