Reputation: 737
I'm using Leaflet v0.7 and there seem to be no setters for min/maxZoom on the map or tileLayer.
Is there any way to set these values dynamically?
Upvotes: 13
Views: 20705
Reputation: 1230
Another way to do the same after map initialisation:
var map = L.map('map').setView([51.505, -0.09], 13);
map.setMinZoom(12);
map.setMaxZoom(14);
Upvotes: 1
Reputation: 3195
If you have your map initialized
var map = L.map('map').setView([51.505, -0.09], 13);
then you can simply do:
map.options.minZoom = 12;
map.options.maxZoom = 14;
Upvotes: 38