Touch zoom interaction requests render frames

This commit is contained in:
Éric Lemoine
2013-04-10 15:20:00 +02:00
parent 703842a021
commit b6a6ba95cc

View File

@@ -76,6 +76,7 @@ ol.interaction.TouchZoom.prototype.handleTouchMove =
var anchor = map.getCoordinateFromPixel(centroid);
// scale, bypass the resolution constraint
map.requestRenderFrame();
ol.interaction.Interaction.zoomWithoutConstraints(
map, view, view.getResolution() * scaleDelta, anchor);
@@ -110,9 +111,11 @@ ol.interaction.TouchZoom.prototype.handleTouchEnd =
ol.interaction.TouchZoom.prototype.handleTouchStart =
function(mapBrowserEvent) {
if (this.targetTouches.length >= 2) {
var view = mapBrowserEvent.map.getView();
var map = mapBrowserEvent.map;
var view = map.getView();
this.lastDistance_ = undefined;
this.lastScaleDelta_ = 1;
map.requestRenderFrame();
view.setHint(ol.ViewHint.INTERACTING, 1);
return true;
} else {