Replace map.zoomIn and map.zoomOut by map.zoom(delta)

This commit is contained in:
Éric Lemoine
2012-09-27 09:37:19 +02:00
parent 25e00e5d74
commit cf20fd3e49
3 changed files with 5 additions and 27 deletions

View File

@@ -838,28 +838,12 @@ ol.Map.prototype.zoom_ = function(resolution, opt_anchor) {
* @param {number} delta Delta from previous zoom level.
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
*/
ol.Map.prototype.zoomByDelta = function(delta, opt_anchor) {
ol.Map.prototype.zoom = function(delta, opt_anchor) {
var resolution = this.constraints_.resolution(this.getResolution(), delta);
this.zoom_(resolution, opt_anchor);
};
/**
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
*/
ol.Map.prototype.zoomIn = function(opt_anchor) {
this.zoomByDelta(4, opt_anchor);
};
/**
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.
*/
ol.Map.prototype.zoomOut = function(opt_anchor) {
this.zoomByDelta(-4, opt_anchor);
};
/**
* @param {number|undefined} resolution Resolution to go to.
* @param {ol.Coordinate=} opt_anchor Anchor coordinate.