Making it so the navigation control zooms out on two touch taps. r=erilem (closes #3127)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11537 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-02-25 18:35:50 +00:00
parent 5826bf5f3b
commit 76a420b278
2 changed files with 35 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
}
var clickCallbacks = {
'click': this.defaultClick,
'dblclick': this.defaultDblClick,
'dblrightclick': this.defaultDblRightClick
};
@@ -189,6 +190,18 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
this.mouseWheelOptions );
},
/**
* Method: defaultClick
*
* Parameters:
* evt - {Event}
*/
defaultClick: function (evt) {
if (evt.lastTouches && evt.lastTouches.length == 2) {
this.map.zoomOut();
}
},
/**
* Method: defaultDblClick
*