U
U
unlik2018-04-04 02:30:48
Yandex
unlik, 2018-04-04 02:30:48

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}`))

Which determines the coordinates and the city.
How can I display different text in a block depending on the city?

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