Answer the question
In order to leave comments, you need to log in
How to catch the location event through the Yandex maps api?
I add a location button to the map ( controls: ['geolocaontrol' ...
)
It is required to track when the user has determined his location in order to put a mark in the found place.
At the moment, it is clear how to get the location when initializing the map:
....
ymaps.geolocation.get({
provider: 'yandex',
autoReverseGeocode: true
}).then(function(result) {
var text = result.geoObjects.get(0).properties.get('metaDataProperty').GeocoderMetaData.text;
// Вывели точку
console.log(text);
});
....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question