Use ol.math.clamp()

This commit is contained in:
Tim Schaub
2015-09-27 09:54:11 -06:00
parent 5cac9d61cc
commit f746cb7f57
12 changed files with 67 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
goog.provide('ol.CenterConstraint');
goog.provide('ol.CenterConstraintType');
goog.require('goog.math');
goog.require('ol.math');
/**
@@ -23,8 +23,8 @@ ol.CenterConstraint.createExtent = function(extent) {
function(center) {
if (center) {
return [
goog.math.clamp(center[0], extent[0], extent[2]),
goog.math.clamp(center[1], extent[1], extent[3])
ol.math.clamp(center[0], extent[0], extent[2]),
ol.math.clamp(center[1], extent[1], extent[3])
];
} else {
return undefined;