You need top add an event handler for the map with the title of boundschange
Here is some simplae sample code:
<script>
var myMap;
ymaps.ready(init);
function init () {
myMap = new ymaps.Map('map', {
center: [55.76, 37.64], // Moscow
zoom: 10
});
//add an event handler for detecting any change to the boudnaries of the map
myMap.events.add('boundschange', onBoundsChange);
//a callback function to do something with the new boundaries
function onBoundsChange(e){
console.log(e.originalEvent.newBounds);
}
}
</script>
And the most basic HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Detecting boundary changes of a Yandex Map</title>
<script src="https://api-maps.yandex.ru/2.1/?lang=en_RU&apikey=<your API-key>" type="text/javascript"></script>
<style>
body, html {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
#map {
width: 100%;
height: 90%;
}
</style>
</head>
<body>
<div id="map"></div>
</body>
</html>