Use view2DState in ol.interaction.TouchRotate
This commit is contained in:
@@ -103,9 +103,10 @@ ol.interaction.TouchRotate.prototype.handleTouchMove =
|
|||||||
if (this.rotating_) {
|
if (this.rotating_) {
|
||||||
// FIXME works for View2D only
|
// FIXME works for View2D only
|
||||||
var view = map.getView().getView2D();
|
var view = map.getView().getView2D();
|
||||||
|
var view2DState = view.getView2DState();
|
||||||
map.requestRenderFrame();
|
map.requestRenderFrame();
|
||||||
ol.interaction.Interaction.rotateWithoutConstraints(map, view,
|
ol.interaction.Interaction.rotateWithoutConstraints(map, view,
|
||||||
view.getRotation() + rotationDelta, this.anchor_);
|
view2DState.rotation + rotationDelta, this.anchor_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -119,9 +120,10 @@ ol.interaction.TouchRotate.prototype.handleTouchEnd =
|
|||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
// FIXME works for View2D only
|
// FIXME works for View2D only
|
||||||
var view = map.getView().getView2D();
|
var view = map.getView().getView2D();
|
||||||
|
var view2DState = view.getView2DState();
|
||||||
if (this.rotating_) {
|
if (this.rotating_) {
|
||||||
ol.interaction.Interaction.rotate(
|
ol.interaction.Interaction.rotate(
|
||||||
map, view, view.getRotation(), this.anchor_,
|
map, view, view2DState.rotation, this.anchor_,
|
||||||
ol.interaction.TOUCHROTATE_ANIMATION_DURATION);
|
ol.interaction.TOUCHROTATE_ANIMATION_DURATION);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user