[OpenLayers-Commits] r11398 - in
sandbox/crschmidt/pan-tap/lib/OpenLayers: Control Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Thu Feb 24 05:49:14 EST 2011
Author: crschmidt
Date: 2011-02-24 02:49:14 -0800 (Thu, 24 Feb 2011)
New Revision: 11398
Modified:
sandbox/crschmidt/pan-tap/lib/OpenLayers/Control/Navigation.js
sandbox/crschmidt/pan-tap/lib/OpenLayers/Handler/Click.js
Log:
Improving documentation on new code.
Modified: sandbox/crschmidt/pan-tap/lib/OpenLayers/Control/Navigation.js
===================================================================
--- sandbox/crschmidt/pan-tap/lib/OpenLayers/Control/Navigation.js 2011-02-24 10:38:14 UTC (rev 11397)
+++ sandbox/crschmidt/pan-tap/lib/OpenLayers/Control/Navigation.js 2011-02-24 10:49:14 UTC (rev 11398)
@@ -201,11 +201,22 @@
this.mouseWheelOptions );
},
+ /**
+ * Method: handleClick
+ * On tap devices (usually mobile devices with no touch support), when
+ * receiving a click, pan to the event pixel. To override automatic
+ * tap detection, pass clickOptions: {tap:false} to the control
+ * options.
+ *
+ * Parameters:
+ * evt - {Event}
+ */
handleClick: function(evt) {
if (this.handlers.click.tap) {
map.panTo(map.getLonLatFromPixel(evt.xy));
}
},
+
/**
* Method: defaultDblClick
*
Modified: sandbox/crschmidt/pan-tap/lib/OpenLayers/Handler/Click.js
===================================================================
--- sandbox/crschmidt/pan-tap/lib/OpenLayers/Handler/Click.js 2011-02-24 10:38:14 UTC (rev 11397)
+++ sandbox/crschmidt/pan-tap/lib/OpenLayers/Handler/Click.js 2011-02-24 10:49:14 UTC (rev 11398)
@@ -117,7 +117,32 @@
*/
tapTolerance: 50,
+
/**
+ * Property: lastMove
+ * Timestamp for last move event. Used in a click handler to determine
+ * whether the move/down/up are happening at very close to the same
+ * time, and if so, setting the tap property on the control.
+ */
+ lastMove: null,
+
+ /**
+ * Property: lastDown
+ * Timestamp for last down event. Used in a click handler to determine
+ * whether the move/down/up are happening at very close to the same
+ * time, and if so, setting the tap property on the control.
+ */
+ lastDown: null,
+
+ /**
+ * Property: lastUp
+ * Timestamp for last up event. Used in a click handler to determine
+ * whether the move/down/up are happening at very close to the same
+ * time, and if so, setting the tap property on the control.
+ */
+ lastUp: null,
+
+ /**
* Property: rightclickTimerId
* {Number} The id of the right mouse timeout waiting to clear the
* <delayedEvent>.
@@ -143,7 +168,14 @@
initialize: function(control, callbacks, options) {
OpenLayers.Handler.prototype.initialize.apply(this, arguments);
},
-
+
+ /**
+ * Method: mouseover
+ * Handle mouseover. Record the firstMouseOver property on the
+ * control, then unregister to save processing on further
+ * mousemoves. This is designed primarily to support the 'tap'
+ * property detection.
+ */
mouseover: function(evt) {
this.firstMouseOver = evt.xy;
this.unregister("mouseover", this.mouseover);
@@ -166,7 +198,8 @@
/**
* Method: mousemove
- * Handle mousemove. This is simply used to record
+ * Handle mousemove. This is simply used to record the last
+ * time the mousemove event was triggered.
*
*/
mousemove: function(evt) {
More information about the Commits
mailing list