Merge pull request #209 from fredj/modify-feature-create-vertices

New createVertices option for Control.ModifyFeature. r=bartvde
This commit is contained in:
Frédéric Junod
2012-02-10 04:16:45 -08:00
3 changed files with 33 additions and 1 deletions

View File

@@ -137,6 +137,13 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
*/
mode: null,
/**
* APIProperty: createVertices
* {Boolean} Create new vertices by dragging the virtual vertices
* in the middle of each edge. Default is true.
*/
createVertices: true,
/**
* Property: modified
* {Boolean} The currently selected feature has been modified.
@@ -677,7 +684,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
}
// add virtual vertices in the middle of each edge
if(geometry.CLASS_NAME != "OpenLayers.Geometry.MultiPoint") {
if (control.createVertices && geometry.CLASS_NAME != "OpenLayers.Geometry.MultiPoint") {
for(i=0, len=geometry.components.length; i<len-1; ++i) {
var prevVertex = geometry.components[i];
var nextVertex = geometry.components[i + 1];