borders.load

Static function.

Provides access to the geometry of various regions and countries. If you are using a content security policy, then you need to add the 'connect-src' rule for the following hosts: https://api-maps.yandex.ru https://suggest-maps.yandex.ru https://*.maps.yandex.net https://yandex.ru

Returns Promise object.

{ vow.Promise } borders.load(region[, options])

Parameters:

Parameter Default value Description
region *

Type: String

The ISO_3166-1 country code (RU, UA, BY, KZ, TR) for loading the regional area, '001' for loading the geometry of country borders, or AQ for loading the geometry of Antarctic.

options

Type: Object

Display options.

options.disputedBorders

Type: String

Two-letter code of the country to use as the official reference for determining the administrative subordination of disputed territories. Accepted values: 'RU', 'UA', 'UN'. By default, it coincides with the country code that is specified when loading the API. Unsupported country codes are reset to RU. For the region '001' (borders of countries), the code 'UN' is supported — world borders according to the United Nations.

options.lang

Type: String

Language (ru, en, uk, be, kk, tr).

options.quality 1

Type: Number

Quality level. Available values:
  • 0 - minimal quality
  • 1 - standard quality
  • 2 - improved quality
  • 3 - high quality
The quality level affects how accurately curves are represented, as well as the volume of the data file.

* Mandatory parameter/option.

Examples:

1.

// Show objects on the map using ObjectManager
ymaps.borders.load('RU', {
    lang: 'en'
}).then(function (geojson) {
    var features = geojson.features.map(function (feature) {
        feature.id = feature.properties.iso3166;
        return feature;
    });
    var objectManager = new ymaps.ObjectManager();
    objectManager.add(features);
    myMap.geoObjects.add(objectManager);
});

2.

// Show objects on the map using GeoObject
ymaps.borders.load('RU', {
    lang: 'en'
}).then(function (geojson) {
    for (var i = 0; i < geojson.features.length; i++) {
        var geoObject = new ymaps.GeoObject(geojson.features[i]);
        myMap.geoObjects.add(geoObject);
    }
});