Answer the question
In order to leave comments, you need to log in
I have created a map in one function, how can I access it in another function?
When the page starts, I create a map (hidden with coordinates by default), then when a change occurs in the address field, I take the value from the field and look through the geocoder, the point is that this is all happening in another function, how can I access the created instance again and add new label?
Answer the question
In order to leave comments, you need to log in
I solved the problem by declaring a variable outside the function, thereby making it global. And I changed the existing coordinates of the yandex maps using the object.setCenter function
myMap.setCenter([53, 53], 14, {
checkZoomRange: true
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question