A
A
Andrey2015-09-05 18:01:47
JavaScript
Andrey, 2015-09-05 18:01:47

How to get coordinates of several addresses and place balloons in Yandex Maps?

Hello!
There are data of companies (name, address):

var data = [
            {
                'company': {
                    'name': 'Автомир',
                    'address': 'Москва, Мира, 10'
                }
            },
            {
                'company': {
                    'name': 'Ягуар',
                    'address': 'Москва, Ленина, 15'
                }
            },
            ...
        ];

You need to place balloons on the map, at the addresses of companies.
I have never worked with Yandex maps.
As I understand it, you first need to get the coordinates of all addresses, and then place the dots. Tell me, is it possible to get coordinates for all addresses with one request to the Yandex API, or will it be necessary to make a request to the geocoder for each address?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-09-09
@healqq

As far as I know, objects will have to be processed one at a time. The algorithm is simple - we send an asynchronous request (returns a Promise) -\u003e we add a label with data on Promis resolution.
In general, the Yandex maps api has very good documentation and examples. Here is the one you need: Yandex Sandbox

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question