0

I use Google Map Tiles (lvl 16 to 25). But, I can't reach more than 22 maxZoom level when I use the maptype Roadplan and 20 when I use the maptype satellite.. I would like to increase the maxZoom to 25 but it doesn't work.

<!DOCTYPE html>
<html>
    <head>
        <title>Orthomosaic</title>
        <meta charset="utf-8" />
        <style>
            html, body, #map {
                height: 100%;
                margin: 0px;
                padding: 0px
            }
        </style>

        <script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></script>
        <script type="text/javascript">
            var map;

            function initialize() {
                var options = {
                    zoom: 16,
                    center: new google.maps.LatLng(-21.0758, 55.2724),
                    mapTypeId: google.maps.MapTypeId.SATELLITE,
                    maxZoom: 25,
                };

                map = new google.maps.Map(document.getElementById("map"), options);

                var bounds = {
                    16: [[42829, 42830], [36694, 36694]],
                    17: [[85659, 85660], [73388, 73388]],
                    18: [[171318, 171321], [146776, 146777]],
                    19: [[342637, 342642], [293552, 293555]],
                    20: [[685275, 685284], [587105, 587111]],
                    21: [[1370551, 1370569], [1174211, 1174223]],
                    22: [[2741103, 2741139], [2348423, 2348447]],
                    23: [[5482207, 5482278], [4696847, 4696895]],
                    24: [[10964415, 10964557], [9393695, 9393790]],
                    25: [[21928831, 21929114], [18787391, 18787581]]
                };

                var imageMapType = new google.maps.ImageMapType({
                    getTileUrl: function(coord, zoom) {
                        if (zoom < 16 || zoom > 25 ||
                            bounds[zoom][0][0] > coord.x || coord.x > bounds[zoom][0][1] ||
                            bounds[zoom][1][0] > coord.y || coord.y > bounds[zoom][1][1]) {
                            return null;
                        }

                        return zoom + "/" + coord.x + "/" + coord.y + ".png";
                    },
                    tileSize: new google.maps.Size(256, 256)
                });

                map.overlayMapTypes.push(imageMapType);
            }

            google.maps.event.addDomListener(window, 'load', initialize);
        </script>
    </head>
    <body>
        <div id="map"></div>
    </body>
</html>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.