Touch rotate interaction requests render frames

This commit is contained in:
Éric Lemoine
2013-04-10 15:19:41 +02:00
parent 1e3e7fb0c1
commit 703842a021
+4 -1
View File
@@ -98,6 +98,7 @@ ol.interaction.TouchRotate.prototype.handleTouchMove =
// rotate // rotate
if (this.rotating_) { if (this.rotating_) {
var view = map.getView().getView2D(); var view = map.getView().getView2D();
map.requestRenderFrame();
ol.interaction.Interaction.rotateWithoutConstraints(map, view, ol.interaction.Interaction.rotateWithoutConstraints(map, view,
view.getRotation() + rotationDelta, anchor); view.getRotation() + rotationDelta, anchor);
} }
@@ -131,10 +132,12 @@ ol.interaction.TouchRotate.prototype.handleTouchEnd =
ol.interaction.TouchRotate.prototype.handleTouchStart = ol.interaction.TouchRotate.prototype.handleTouchStart =
function(mapBrowserEvent) { function(mapBrowserEvent) {
if (this.targetTouches.length >= 2) { if (this.targetTouches.length >= 2) {
var view = mapBrowserEvent.map.getView(); var map = mapBrowserEvent.map;
var view = map.getView();
this.lastAngle_ = undefined; this.lastAngle_ = undefined;
this.rotating_ = false; this.rotating_ = false;
this.rotationDelta_ = 0.0; this.rotationDelta_ = 0.0;
map.requestRenderFrame();
view.setHint(ol.ViewHint.INTERACTING, 1); view.setHint(ol.ViewHint.INTERACTING, 1);
return true; return true;
} else { } else {