Stop current kinetic animation on DOWN events

This commit is contained in:
Bruno Binet
2013-01-29 14:12:01 +01:00
parent 39cbba3eb7
commit 2bb8a5cfd9
2 changed files with 37 additions and 2 deletions

View File

@@ -80,6 +80,13 @@ ol.interaction.Drag.prototype.handleDragEnd = goog.nullFunction;
ol.interaction.Drag.prototype.handleDragStart = goog.functions.FALSE;
/**
* @param {ol.MapBrowserEvent} mapBrowserEvent Event.
* @protected
*/
ol.interaction.Drag.prototype.handleDown = goog.nullFunction;
/**
* @inheritDoc
*/
@@ -91,6 +98,10 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent =
}
var view = map.getView();
var browserEvent = mapBrowserEvent.browserEvent;
if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DOWN) {
goog.asserts.assert(browserEvent instanceof goog.events.BrowserEvent);
this.handleDown(mapBrowserEvent);
}
if (this.dragging_) {
if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DRAG) {
goog.asserts.assert(browserEvent instanceof goog.events.BrowserEvent);