[OpenLayers-Commits] r11793 -
trunk/openlayers/lib/OpenLayers/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Mar 30 10:26:15 EDT 2011
Author: erilem
Date: 2011-03-30 07:26:12 -0700 (Wed, 30 Mar 2011)
New Revision: 11793
Modified:
trunk/openlayers/lib/OpenLayers/Handler/Path.js
trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
Log:
simplify the code of the path and polygon handlers, removing the finishTouchGeometry function, r=sbrunner (closes #3214)
Modified: trunk/openlayers/lib/OpenLayers/Handler/Path.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Path.js 2011-03-30 14:26:03 UTC (rev 11792)
+++ trunk/openlayers/lib/OpenLayers/Handler/Path.js 2011-03-30 14:26:12 UTC (rev 11793)
@@ -25,7 +25,7 @@
* {<OpenLayers.Feature.Vector>}
*/
line: null,
-
+
/**
* Property: freehand
* {Boolean} In freehand mode, the handler starts the path on mouse down,
@@ -234,7 +234,7 @@
this.passesTolerance(this.lastTouchPx, evt.xy, this.dblclickTolerance)) {
// double-tap, finalize the geometry
this.lastTouchPx = evt.xy; // for up() to detect dblclick and do nothing
- this.finishTouchGeometry();
+ this.finishGeometry();
window.clearTimeout(this.timerId);
this.timerId = null;
return false;
@@ -337,14 +337,6 @@
},
/**
- * Method: finishTouchGeometry
- * Finish the geometry and send it back to the control.
- */
- finishTouchGeometry: function() {
- this.finishGeometry();
- },
-
- /**
* APIMethod: finishGeometry
* Finish the geometry and send it back to the control.
*/
Modified: trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Polygon.js 2011-03-30 14:26:03 UTC (rev 11792)
+++ trunk/openlayers/lib/OpenLayers/Handler/Polygon.js 2011-03-30 14:26:12 UTC (rev 11793)
@@ -151,10 +151,10 @@
},
/**
- * Method: finishTouchGeometry
+ * Method: finishGeometry
* Finish the geometry and send it back to the control.
*/
- finishTouchGeometry: function() {
+ finishGeometry: function() {
var index = this.line.geometry.components.length - 2;
this.line.geometry.removeComponent(this.line.geometry.components[index]);
this.removePoint();
@@ -293,24 +293,5 @@
return geometry;
},
- /**
- * Method: dblclick
- * Handle double-clicks. Finish the geometry and send it back
- * to the control.
- *
- * Parameters:
- * evt - {Event}
- */
- dblclick: function(evt) {
- if(!this.freehandMode(evt)) {
- // remove the penultimate point
- var index = this.line.geometry.components.length - 2;
- this.line.geometry.removeComponent(this.line.geometry.components[index]);
- this.removePoint();
- this.finalize();
- }
- return false;
- },
-
CLASS_NAME: "OpenLayers.Handler.Polygon"
});
More information about the Commits
mailing list