1

Everything is in the title...

I want the zoom of the map limit from 1 to 5 while changing

To generate the map I use

var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
skaffman
  • 398,947
  • 96
  • 818
  • 769
  • Related: [Google Maps v3 - limit viewable area and zoom level](http://stackoverflow.com/q/3818016/55075) – kenorb Nov 30 '15 at 11:52

1 Answers1

1

You could find it in the Google Map API for the listener "zoom_changed"

google.maps.event.addListener(map, "zoom_changed", function() { 
        var Z=map.getZoom();
        if (Z > 5) {map.setZoom(5);}
        else if (Z < 1) {map.setZoom(1);}
});
Valky
  • 1,856
  • 3
  • 20
  • 38