Adding a PinchZoom control for smooth zooming on multi-touch devices. p=bbinet,me r=crschmidt (closes #3105)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11544 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -120,13 +120,15 @@ OpenLayers.Handler.Pinch = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Let the event propagate.
|
||||
*/
|
||||
touchmove: function(evt) {
|
||||
var propagate = true;
|
||||
if (this.started && OpenLayers.Event.isMultiTouch(evt)) {
|
||||
this.pinching = true;
|
||||
var current = this.getPinchData(evt);
|
||||
this.callback("move", [evt, current]);
|
||||
this.last = current;
|
||||
propagate = false;
|
||||
}
|
||||
return true;
|
||||
return propagate;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -140,14 +142,16 @@ OpenLayers.Handler.Pinch = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Let the event propagate.
|
||||
*/
|
||||
touchend: function(evt) {
|
||||
var propagate = true;
|
||||
if (this.started) {
|
||||
this.started = false;
|
||||
this.pinching = false;
|
||||
this.callback("done", [evt, this.start, this.last]);
|
||||
this.start = null;
|
||||
this.last = null;
|
||||
propagate = false;
|
||||
}
|
||||
return true;
|
||||
return propagate;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user