Redefine ol.Coordinate to be Array.<number>

This commit is contained in:
Tom Payne
2013-04-04 19:39:18 +02:00
parent 6fc86b81c7
commit 02196c94b5
74 changed files with 613 additions and 687 deletions

View File

@@ -43,8 +43,8 @@ ol.animation.bounce = function(options) {
ol.animation.pan = function(options) {
var source = options.source;
var start = goog.isDef(options.start) ? options.start : goog.now();
var sourceX = source.x;
var sourceY = source.y;
var sourceX = source[0];
var sourceY = source[1];
var duration = goog.isDef(options.duration) ? options.duration : 1000;
var easing = goog.isDef(options.easing) ?
options.easing : ol.easing.inAndOut;
@@ -55,11 +55,11 @@ ol.animation.pan = function(options) {
return true;
} else if (frameState.time < start + duration) {
var delta = 1 - easing((frameState.time - start) / duration);
var deltaX = sourceX - frameState.view2DState.center.x;
var deltaY = sourceY - frameState.view2DState.center.y;
var deltaX = sourceX - frameState.view2DState.center[0];
var deltaY = sourceY - frameState.view2DState.center[1];
frameState.animate = true;
frameState.view2DState.center.x += delta * deltaX;
frameState.view2DState.center.y += delta * deltaY;
frameState.view2DState.center[0] += delta * deltaX;
frameState.view2DState.center[1] += delta * deltaY;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else {