add maxZoom to Map fitBounds options, close #2101

This commit is contained in:
Vladimir Agafonkin 2013-10-17 00:17:31 +03:00
parent 394f913434
commit c3734e5a91

View File

@ -103,6 +103,8 @@ L.Map = L.Class.extend({
nePoint = this.project(bounds.getNorthEast(), zoom),
center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);
zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom;
return this.setView(center, zoom, options);
},