making drawing handler work on touch devices. p=sbrunner, r=me (closes #3072)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11563 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-02-27 15:00:38 +00:00
parent ba8aed56ef
commit 33eef42075
7 changed files with 535 additions and 48 deletions

View File

@@ -148,7 +148,18 @@ OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, {
point.y = last.y;
}
},
/**
* Method: finishTouchGeometry
* Finish the geometry and send it back to the control.
*/
finishTouchGeometry: function() {
var index = this.line.geometry.components.length - 2;
this.line.geometry.removeComponent(this.line.geometry.components[index]);
this.removePoint();
this.finalize();
},
/**
* Method: finalizeInteriorRing
* Enforces that new ring has some area and doesn't contain vertices of any