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
@@ -42,6 +42,7 @@ ol.interaction.DragRotate.prototype.handleDrag = function(mapBrowserEvent) {
var theta = Math.atan2(
size.height / 2 - offset.y,
offset.x - size.width / 2);
map.requestRenderFrame();
map.rotate(this.startRotation_, -theta);
};
@@ -55,6 +56,7 @@ ol.interaction.DragRotate.prototype.handleDragStart =
var map = mapBrowserEvent.map;
if (browserEvent.isMouseActionButton() && this.condition_(browserEvent) &&
map.canRotate()) {
map.requestRenderFrame();
var size = map.getSize();
var offset = mapBrowserEvent.getPixel();
var theta = Math.atan2(