diff --git a/src/ol/interaction/dragrotateinteraction.js b/src/ol/interaction/dragrotateinteraction.js index 276fb15c56..90b92c0be5 100644 --- a/src/ol/interaction/dragrotateinteraction.js +++ b/src/ol/interaction/dragrotateinteraction.js @@ -1,6 +1,7 @@ goog.provide('ol.interaction.DragRotate'); goog.require('ol.View2D'); +goog.require('ol.ViewHint'); goog.require('ol.interaction.ConditionType'); goog.require('ol.interaction.Drag'); @@ -46,12 +47,26 @@ ol.interaction.DragRotate.prototype.handleDrag = function(mapBrowserEvent) { // FIXME supports View2D only goog.asserts.assert(view instanceof ol.View2D); map.requestRenderFrame(); - view.rotate(map, view.getRotation() - delta); + view.rotateNoConstraint(map, view.getRotation() - delta); } this.lastAngle_ = theta; }; +/** + * @inheritDoc + */ +ol.interaction.DragRotate.prototype.handleDragEnd = function(mapBrowserEvent) { + var browserEvent = mapBrowserEvent.browserEvent; + var map = mapBrowserEvent.map; + // FIXME supports View2D only + var view = map.getView(); + goog.asserts.assert(view instanceof ol.View2D); + view.rotate(map, view.getRotation()); + view.setHint(ol.ViewHint.INTERACTING, -1); +}; + + /** * @inheritDoc */ @@ -65,6 +80,7 @@ ol.interaction.DragRotate.prototype.handleDragStart = goog.asserts.assert(view instanceof ol.View2D); map.requestRenderFrame(); this.lastAngle_ = undefined; + view.setHint(ol.ViewHint.INTERACTING, 1); return true; } else { return false;