Z
Z
zlodiak2019-01-14 13:54:50
JavaScript
zlodiak, 2019-01-14 13:54:50

How comes the border set?

In the training example of Yandex maps, an example of drawing the boundaries of areas is shown. The incomprehensible moment is that these areas are requested in some strange way:

ymaps.borders.load('RU', {
    lang: 'ru',
    quality: 2
}).then(function (result) {
    //
    //
    console.log(result)
    //
    //
});

At the same time, the network tab shows that the request has gone like this:
https://api-maps.yandex.ru/services/regions/v2?lan...

Why is this, is this some kind of service endpoint for Yandex?
If this is the case, then it is still not clear why the console in the above code does not output the data structure that is visible through the network / preview tab
Please tell me how the data is obtained, which is eventually displayed in console.log

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2019-01-14
@zlodiak

The data for the maps is taken from OSM, they have something like an agreement. And there are certain problems with rights, so there is an opinion that because of this, the regions receive their own data. It is better to ask this question in the Yandex help blog, where they will answer from a corporate account.
Well, in general, answering the question of how - converting to JSON format.
In general, these cards are hemorrhoids, just recently we encountered them on the same project. They themselves chose the approach, on the whole it justified itself, but shamanism... Well, probably it was worth it. If interested, I can throw a link to how we implemented it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question