Move rotate from View2D to Interaction

This commit is contained in:
Éric Lemoine
2013-04-09 18:05:19 +02:00
parent 51094139a8
commit dbca68650c
5 changed files with 70 additions and 61 deletions

View File

@@ -5,6 +5,7 @@ goog.require('ol.View2D');
goog.require('ol.ViewHint');
goog.require('ol.interaction.ConditionType');
goog.require('ol.interaction.Drag');
goog.require('ol.interaction.Interaction');
/**
@@ -54,7 +55,8 @@ ol.interaction.DragRotate.prototype.handleDrag = function(mapBrowserEvent) {
// FIXME supports View2D only
goog.asserts.assertInstanceof(view, ol.View2D);
map.requestRenderFrame();
view.rotateWithoutConstraints(map, view.getRotation() - delta);
ol.interaction.Interaction.rotateWithoutConstraints(
map, view, view.getRotation() - delta);
}
this.lastAngle_ = theta;
};
@@ -69,7 +71,7 @@ ol.interaction.DragRotate.prototype.handleDragEnd = function(mapBrowserEvent) {
// FIXME supports View2D only
var view = map.getView();
goog.asserts.assertInstanceof(view, ol.View2D);
view.rotate(map, view.getRotation(), undefined,
ol.interaction.Interaction.rotate(map, view, view.getRotation(), undefined,
ol.interaction.DRAGROTATE_ANIMATION_DURATION);
view.setHint(ol.ViewHint.INTERACTING, -1);
};