[OpenLayers-Commits] r11626 - sandbox/tschaub/click/lib/OpenLayers/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Sun Mar 6 19:17:16 EST 2011


Author: tschaub
Date: 2011-03-06 16:17:16 -0800 (Sun, 06 Mar 2011)
New Revision: 11626

Modified:
   sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js
Log:
The touch navigation control should accept click handler options and should set a non-zero pixel tolerance for clicks.

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js	2011-03-06 18:23:12 UTC (rev 11625)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js	2011-03-07 00:17:16 UTC (rev 11626)
@@ -45,6 +45,12 @@
     pinchZoomOptions: null,
 
     /**
+     * APIProperty: clickHandlerOptions
+     * {Object} Options passed to the Click handler.
+     */
+    clickHandlerOptions: null,
+
+    /**
      * APIProperty: documentDrag
      * {Boolean} Allow panning of the map by dragging outside map viewport.
      *     Default is false.
@@ -121,13 +127,14 @@
      */
     draw: function() {
         var clickCallbacks = {
-            'click': this.defaultClick,
-            'dblclick': this.defaultDblClick
+            click: this.defaultClick,
+            dblclick: this.defaultDblClick
         };
-        var clickOptions = {
-            'double': true,
-            'stopDouble': true
-        };
+        var clickOptions = OpenLayers.Util.extend({
+            "double": true,
+            stopDouble: true,
+            pixelTolerance: 2
+        }, this.clickHandlerOptions);
         this.handlers.click = new OpenLayers.Handler.Click(
             this, clickCallbacks, clickOptions
         );



More information about the Commits mailing list