R
R
Ruslan Saifullin2016-04-20 21:43:47
JavaScript
Ruslan Saifullin, 2016-04-20 21:43:47

Yandex map Api how to get coordinates from an address and extract them from an object?

There is a working code:

var myGeocoder = ymaps.geocode("Петрозаводск");
res = myGeocoder.then(
function (result) {
    var coordinates = result.geoObjects.get(0).geometry.getCoordinates();
    console.log(coordinates);
},
function (err) {
    alert('Ошибка');
}
);

I watch the result of console.log(coordinates);
ff1bd12faef74c9e832aa6e3210dfa57.png
How can I extract the latitude and longitude from this object separately?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question