Answer the question
In order to leave comments, you need to log in
Text substitution based on city?
There is a code
ymaps.ready()
.then(() => ymaps.geolocation.get({autoReverseGeocode: false})
.then(res => res.geoObjects.get(0).geometry.getCoordinates()))
.then(ll => ($('#latlng').append(`Координаты: ${ll}`), ymaps.geocode(ll)))
.then(res => res.geoObjects.get(0).getLocalities())
.then(city => $('#city').append(`Город: ${city}`))
.catch(err => $('#err').append(`Ошибка: ${err}`))
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