From 882f1ea598ab0047954b17a2a1da84ddd061544d Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 12 Jan 2011 16:52:21 +0200 Subject: [PATCH] getBounds --- src/map/Map.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/map/Map.js b/src/map/Map.js index f3c09f38..d7dee288 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -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; },