Use view.getRotation instead of view.getState

This commit is contained in:
Frederic Junod
2015-01-26 10:38:50 +01:00
parent 8e161a077f
commit 7c7a4c2b7a

View File

@@ -107,10 +107,10 @@ ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
// rotate
if (this.rotating_) {
var view = map.getView();
var viewState = view.getState();
var rotation = view.getRotation();
map.render();
ol.interaction.Interaction.rotateWithoutConstraints(map, view,
viewState.rotation + rotationDelta, this.anchor_);
rotation + rotationDelta, this.anchor_);
}
};
@@ -127,10 +127,9 @@ ol.interaction.PinchRotate.handleUpEvent_ = function(mapBrowserEvent) {
var view = map.getView();
view.setHint(ol.ViewHint.INTERACTING, -1);
if (this.rotating_) {
var viewState = view.getState();
var rotation = view.getRotation();
ol.interaction.Interaction.rotate(
map, view, viewState.rotation, this.anchor_,
ol.ROTATE_ANIMATION_DURATION);
map, view, rotation, this.anchor_, ol.ROTATE_ANIMATION_DURATION);
}
return false;
} else {