Use requestRenderFrame API in interactions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user