Use requestRenderFrame API in interactions

This commit is contained in:
Tom Payne
2012-10-04 20:33:16 +02:00
parent 8c44dcf83a
commit 934c75bc8c
4 changed files with 7 additions and 0 deletions
@@ -51,6 +51,7 @@ ol.interaction.DragRotateAndZoom.prototype.handleDrag =
size.height / 2 - browserEvent.offsetY);
var theta = Math.atan2(delta.y, delta.x);
// FIXME this should use map.withFrozenRendering but an assertion fails :-(
map.requestRenderFrame();
map.rotate(this.startRotation_, -theta);
var resolution = this.startRatio_ * delta.magnitude();
map.zoomToResolution(resolution);
@@ -73,6 +74,7 @@ ol.interaction.DragRotateAndZoom.prototype.handleDragStart =
var theta = Math.atan2(delta.y, delta.x);
this.startRotation_ = (map.getRotation() || 0) + theta;
this.startRatio_ = resolution / delta.magnitude();
map.requestRenderFrame();
return true;
} else {
return false;