Tim's big refactoring of the Geometry modules. Fixes #590. All tests pass in FF (except the PanZoomBar stuff, which wasn't touched by this patch) and IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2931 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -79,10 +79,11 @@ OpenLayers.Handler.Path.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Add point to geometry
|
||||
* Add point to geometry. Send the point index to override
|
||||
* the behavior of LinearRing that disregards adding duplicate points.
|
||||
*/
|
||||
addPoint: function() {
|
||||
this.line.addComponent(this.point.clone());
|
||||
this.line.addComponent(this.point.clone(), this.line.components.length);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,6 +86,22 @@ OpenLayers.Handler.Polygon.prototype =
|
||||
return this.polygon.clone();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle double-clicks. Finish the geometry and send it back
|
||||
* to the control.
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
dblclick: function(evt) {
|
||||
if(!this.freehandMode(evt)) {
|
||||
// remove the penultimate point
|
||||
var index = this.line.components.length - 2;
|
||||
this.line.removeComponent(this.line.components[index]);
|
||||
this.finalize(this.line);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Handler.Polygon"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user