Add ol.View2D.prototype.setZoom

This commit is contained in:
Éric Lemoine
2013-06-27 16:43:29 +02:00
parent a071c3521c
commit 0cf4024194
2 changed files with 11 additions and 0 deletions

View File

@@ -4,3 +4,4 @@
@exportProperty ol.View2D.prototype.constrainRotation
@exportProperty ol.View2D.prototype.fitExtent
@exportProperty ol.View2D.prototype.getView2D
@exportProperty ol.View2D.prototype.setZoom

View File

@@ -398,6 +398,16 @@ goog.exportProperty(
ol.View2D.prototype.setRotation);
/**
* Zoom to a specific zoom level.
* @param {number} zoom Zoom level.
*/
ol.View2D.prototype.setZoom = function(zoom) {
var resolution = this.constrainResolution(this.maxResolution_, zoom);
this.setResolution(resolution);
};
/**
* @private
* @param {ol.View2DOptions} options View2D options.