Merge pull request #6445 from tschaub/fix-pinch

Fix pinch zooming
This commit is contained in:
Tim Schaub
2017-02-03 15:04:59 -07:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -112,6 +112,11 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
view.setHint(ol.ViewHint.INTERACTING, -1);
return false;
} else {
if (this.kinetic_) {
// reset so we don't overestimate the kinetic energy after
// after one finger up, tiny drag, second finger up
this.kinetic_.begin();
}
this.lastCentroid = null;
return true;
}

View File

@@ -187,8 +187,8 @@ ol.interaction.Pointer.handleEvent = function(mapBrowserEvent) {
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDRAG) {
this.handleDragEvent_(mapBrowserEvent);
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERUP) {
this.handleUpEvent_(mapBrowserEvent);
this.handlingDownUpSequence = false;
var handledUp = this.handleUpEvent_(mapBrowserEvent);
this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;
}
} else {
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDOWN) {