Answer the question
In order to leave comments, you need to log in
How to reload the Yandex map if the coordinates of the center have changed?
On the site you can choose different cities. When the user selects a city, then the coordinates of the center of this city are stored in localStorage, and then
centerArray = [JSON.parse(localStorage.getItem('town')).lat, JSON.parse(localStorage.getItem('town')).long];
console.log('centerArray', centerArray);
myMap = new ymaps.Map("map", {
center: centerArray,
zoom: 15,
});
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