Add view.getMaxZoom() and view.getMinZoom()

This commit is contained in:
Tim Schaub
2017-02-19 17:09:41 -07:00
parent 719fa6e004
commit b383e0ecb2
2 changed files with 52 additions and 0 deletions

View File

@@ -528,6 +528,26 @@ ol.View.prototype.getMinResolution = function() {
};
/**
* Get the maximum zoom level for the view.
* @return {number} The maximum zoom level.
* @api
*/
ol.View.prototype.getMaxZoom = function() {
return /** @type {number} */ (this.getZoomForResolution(this.minResolution_));
};
/**
* Get the minimum zoom level for the view.
* @return {number} The minimum zoom level.
* @api
*/
ol.View.prototype.getMinZoom = function() {
return /** @type {number} */ (this.getZoomForResolution(this.maxResolution_));
};
/**
* Get the view projection.
* @return {ol.proj.Projection} The projection of the view.