Work with map bounds

Description

The following are examples of limitations of map boundaries and zoom levels. For more information about the work with the map, see the Map documentation section.

Limit of boundaries and scale

The restriction of the viewable area by boundaries of Novosibirsk, as well as zoom levels ranging from 10 to 15:

<!DOCTYPE html>
<html>
    <head>
        <title>Limitation of boarders and scale</title>
        <script src="https://maps.api.2gis.ru/2.0/loader.js"></script>
    </head>
    <body>
        <div id="map" style="width: 100%; height: 400px;"></div>
        <script>
            DG.then(function() {
                DG.map('map', {
                    center: [54.98, 82.89],
                    zoom: 10,
                    maxBounds: [
                        [54.8220, 82.4304],
                        [55.1372, 83.3505]
                    ],
                    minZoom: 10,
                    maxZoom: 15
                });
            });
        </script>
    </body>
</html>