diff --git a/src/ol/interaction/draginteraction.js b/src/ol/interaction/draginteraction.js index 7857aafdc7..395cf69c17 100644 --- a/src/ol/interaction/draginteraction.js +++ b/src/ol/interaction/draginteraction.js @@ -6,6 +6,7 @@ goog.require('goog.functions'); goog.require('ol.Coordinate'); goog.require('ol.MapBrowserEvent'); goog.require('ol.MapBrowserEvent.EventType'); +goog.require('ol.ViewHint'); goog.require('ol.interaction.Interaction'); @@ -113,6 +114,7 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent = this.deltaX = browserEvent.clientX - this.startX; this.deltaY = browserEvent.clientY - this.startY; this.handleDragEnd(mapBrowserEvent); + view.setHint(ol.ViewHint.INTERACTING, -1); this.dragging_ = false; } } else if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DRAGSTART) { @@ -126,6 +128,7 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent = (mapBrowserEvent.getCoordinate()); var handled = this.handleDragStart(mapBrowserEvent); if (handled) { + view.setHint(ol.ViewHint.INTERACTING, 1); this.dragging_ = true; mapBrowserEvent.preventDefault(); mapBrowserEvent.stopOtherInteractions(); diff --git a/src/ol/interaction/dragpaninteraction.js b/src/ol/interaction/dragpaninteraction.js index 12c1212b5b..4d61daffd5 100644 --- a/src/ol/interaction/dragpaninteraction.js +++ b/src/ol/interaction/dragpaninteraction.js @@ -6,7 +6,6 @@ goog.require('goog.asserts'); goog.require('ol.Kinetic'); goog.require('ol.PreRenderFunction'); goog.require('ol.View2D'); -goog.require('ol.ViewHint'); goog.require('ol.coordinate'); goog.require('ol.interaction.ConditionType'); goog.require('ol.interaction.Drag'); @@ -82,7 +81,6 @@ ol.interaction.DragPan.prototype.handleDragEnd = function(mapBrowserEvent) { var map = mapBrowserEvent.map; var view = map.getView(); - var interacting = view.setHint(ol.ViewHint.INTERACTING, -1); if (this.kinetic_ && this.kinetic_.end()) { var distance = this.kinetic_.getDistance(); @@ -97,9 +95,8 @@ ol.interaction.DragPan.prototype.handleDragEnd = function(mapBrowserEvent) { centerpx[1] - distance * Math.sin(angle) ]); view.setCenter(dest); - } else if (interacting === 0) { - map.requestRenderFrame(); } + map.requestRenderFrame(); }; @@ -115,7 +112,6 @@ ol.interaction.DragPan.prototype.handleDragStart = function(mapBrowserEvent) { } var map = mapBrowserEvent.map; map.requestRenderFrame(); - map.getView().setHint(ol.ViewHint.INTERACTING, 1); return true; } else { return false; diff --git a/src/ol/interaction/dragrotateinteraction.js b/src/ol/interaction/dragrotateinteraction.js index e66875e704..534ddd1618 100644 --- a/src/ol/interaction/dragrotateinteraction.js +++ b/src/ol/interaction/dragrotateinteraction.js @@ -2,7 +2,6 @@ goog.provide('ol.interaction.DragRotate'); goog.require('goog.asserts'); goog.require('ol.View2D'); -goog.require('ol.ViewHint'); goog.require('ol.interaction.ConditionType'); goog.require('ol.interaction.Drag'); goog.require('ol.interaction.Interaction'); @@ -76,7 +75,6 @@ ol.interaction.DragRotate.prototype.handleDragEnd = function(mapBrowserEvent) { goog.asserts.assertInstanceof(view, ol.View2D); ol.interaction.Interaction.rotate(map, view, view.getRotation(), undefined, ol.interaction.DRAGROTATE_ANIMATION_DURATION); - view.setHint(ol.ViewHint.INTERACTING, -1); }; @@ -93,7 +91,6 @@ ol.interaction.DragRotate.prototype.handleDragStart = goog.asserts.assertInstanceof(view, ol.View2D); map.requestRenderFrame(); this.lastAngle_ = undefined; - view.setHint(ol.ViewHint.INTERACTING, 1); return true; } else { return false;