From d61a1177870cbb123e4d739c7e2a65eda1f46511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 27 Sep 2012 13:44:24 +0200 Subject: [PATCH] Remove CenterConstraint entirely --- src/ol/centerconstraint.js | 47 -------------------------------------- src/ol/mapoptions.js | 1 - 2 files changed, 48 deletions(-) delete mode 100644 src/ol/centerconstraint.js diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js deleted file mode 100644 index 7532427221..0000000000 --- a/src/ol/centerconstraint.js +++ /dev/null @@ -1,47 +0,0 @@ -goog.provide('ol.interaction.CenterConstraint'); -goog.provide('ol.interaction.CenterConstraintType'); - -goog.require('ol.Coordinate'); - - -/** - * @typedef {function((ol.Coordinate|undefined), - * (number|undefined), - * ol.Coordinate): (ol.Coordinate|undefined)} - */ -ol.interaction.CenterConstraintType; - - -/** - * @param {ol.Coordinate|undefined} center Center. - * @param {number|undefined} resolution Resolution. - * @param {ol.Coordinate} delta Delta. - * @return {ol.Coordinate|undefined} Center. - */ -ol.interaction.CenterConstraint.none = function(center, resolution, delta) { - if (goog.isDefAndNotNull(center) && goog.isDef(resolution)) { - var x = center.x + delta.x; - var y = center.y + delta.y; - return new ol.Coordinate(x, y); - } else { - return undefined; - } -}; - - -/** - * @param {ol.Coordinate|undefined} center Center. - * @param {number|undefined} resolution Resolution. - * @param {ol.Coordinate} delta Delta. - * @return {ol.Coordinate|undefined} Center. - */ -ol.interaction.CenterConstraint.snapToPixel = - function(center, resolution, delta) { - if (goog.isDefAndNotNull(center) && goog.isDef(resolution)) { - var x = Math.floor((center.x + delta.x) / resolution + 0.5) * resolution; - var y = Math.floor((center.y + delta.y) / resolution + 0.5) * resolution; - return new ol.Coordinate(x, y); - } else { - return undefined; - } -}; diff --git a/src/ol/mapoptions.js b/src/ol/mapoptions.js index 5285767287..6b35cd31a6 100644 --- a/src/ol/mapoptions.js +++ b/src/ol/mapoptions.js @@ -11,7 +11,6 @@ goog.require('ol.Projection'); goog.require('ol.ResolutionConstraint'); goog.require('ol.RotationConstraint'); goog.require('ol.interaction.AltDragRotate'); -goog.require('ol.interaction.CenterConstraint'); goog.require('ol.interaction.DblClickZoom'); goog.require('ol.interaction.DragPan'); goog.require('ol.interaction.KeyboardPan');