Do not set center constraint

This change slipped in accidently. Thanks @twpayne for catching
this.
This commit is contained in:
ahocevar
2013-06-17 16:46:47 +02:00
parent 24953e5f0e
commit b71bf9607c
2 changed files with 1 additions and 13 deletions

View File

@@ -89,8 +89,6 @@
* Object literal with config options for the view.
* @typedef {Object} ol.View2DOptions
* @property {ol.Coordinate|undefined} center The view center in map projection.
* @property {ol.Extent|undefined} maxExtent The maximum extent for the view.
* If configured, the view's center cannot be outside this extent.
* @property {number|undefined} maxResolution The maximum resolution in map
* units per pixel.
* @property {number|undefined} maxZoom The maximum zoom level for this view.

View File

@@ -4,7 +4,6 @@ goog.provide('ol.View2D');
goog.provide('ol.View2DProperty');
goog.require('goog.asserts');
goog.require('goog.math');
goog.require('ol.Constraints');
goog.require('ol.IView2D');
goog.require('ol.IView3D');
@@ -60,12 +59,6 @@ ol.View2D = function(opt_options) {
values[ol.View2DProperty.PROJECTION] = ol.proj.createProjection(
options.projection, 'EPSG:3857');
/**
* @private
* @type {ol.Extent}
*/
this.maxExtent_ = goog.isDef(options.maxExtent) ? options.maxExtent : null;
var parts = ol.View2D.createResolutionConstraint_(options);
/**
@@ -359,10 +352,7 @@ ol.View2D.prototype.isDef = function() {
* @param {ol.Coordinate|undefined} center Center.
*/
ol.View2D.prototype.setCenter = function(center) {
this.set(ol.View2DProperty.CENTER, goog.isNull(this.maxExtent_) ? center : [
goog.math.clamp(center[0], this.maxExtent_[0], this.maxExtent_[1]),
goog.math.clamp(center[1], this.maxExtent_[2], this.maxExtent_[3])
]);
this.set(ol.View2DProperty.CENTER, center);
};
goog.exportProperty(
ol.View2D.prototype,