Answer the question
In order to leave comments, you need to log in
How to limit the display area on the map using the Yandex.Map API?
The essence of the task: It is necessary to display a map of the city on the site and limit movement on it to the area of this city. I found a special parameter restrictMapArea
in the API description , but for some reason it is ignored when the map is initialized:
function inc() {
var map = new ymaps.Map("map", {
center: [56.3177, 38.1368],
restrictMapArea:,
zoom: 15
});
}
Answer the question
In order to leave comments, you need to log in
You are trying to pass map options as the second parameter instead of the third.
https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/ref...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question