adding getMaxExtent and getMaxRes

This commit is contained in:
Mike Adair
2012-06-20 02:58:23 -04:00
committed by Mike Adair
parent 4fcc00e39c
commit 2c7e308960
3 changed files with 150 additions and 4 deletions

View File

@@ -128,6 +128,24 @@ ol.Map.prototype.getLayers = function() {
};
/**
* @return {ol.Bounds} the maxExtent for the map
*/
ol.Map.prototype.getMaxExtent = function() {
if (goog.isDefAndNotNull(this.maxExtent_)) {
return this.maxExtent_;
} else {
var extent = this.projection.getMaxExtent();
if (goog.isDefAndNotNull(extent)) {
return extent;
} else {
throw('maxExtent must be defined either in the map or the projection');
}
}
};
/**
* @param {ol.Loc} center Center.
* @return {ol.Map} This.
@@ -195,6 +213,15 @@ ol.Map.prototype.setLayers = function(layers) {
return this;
};
/**
* @param {ol.Bounds} extent the maxExtent for the map
* @return {ol.Map} This.
*/
ol.Map.prototype.setMaxExtent = function(extent) {
this.maxExtent_ = extent;
return this;
};
/**
*/
ol.Map.prototype.destroy = function() {