getBounds

This commit is contained in:
Mourner 2011-01-12 16:52:21 +02:00
parent 48558ffa6d
commit 882f1ea598

View File

@ -153,6 +153,13 @@ L.Map = L.Class.extend({
return this._zoom;
},
getBounds: function() {
var bounds = this.getPixelBounds(),
sw = this.unproject(new L.Point(bounds.min.x, bounds.max.y)),
ne = this.unproject(new L.Point(bounds.max.x, bounds.min.y));
return new L.LatLngBounds(sw, ne);
},
getMinZoom: function() {
return isNaN(this.options.minZoom) ? this._layersMinZoom || 0 : this.options.minZoom;
},