adding getMaxExtent and getMaxRes
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user