Examples | RasterJS API | Urbi Documentation

Work with map bounds

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.

<!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.822, 82.4304],
                        [55.1372, 83.3505],
                    ],
                    minZoom: 10,
                    maxZoom: 15,
                });
            });
        </script>
    </body>
</html>