Dissalow vertex deletion while dragging - thanks for the review crschmidt (closes #1122).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5099 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -384,7 +384,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) {
|
OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) {
|
||||||
var vertex = this.dragControl.feature;
|
var vertex = this.dragControl.feature;
|
||||||
if(vertex &&
|
if(vertex &&
|
||||||
OpenLayers.Util.indexOf(this.vertices, vertex) != -1) {
|
OpenLayers.Util.indexOf(this.vertices, vertex) != -1 &&
|
||||||
|
!this.dragControl.dragHandler.dragging) {
|
||||||
// remove the vertex
|
// remove the vertex
|
||||||
vertex.geometry.parent.removeComponent(vertex.geometry);
|
vertex.geometry.parent.removeComponent(vertex.geometry);
|
||||||
this.layer.drawFeature(this.feature,
|
this.layer.drawFeature(this.feature,
|
||||||
|
|||||||
@@ -168,6 +168,11 @@
|
|||||||
// run the above four tests twice
|
// run the above four tests twice
|
||||||
control.handleKeypress(delKey);
|
control.handleKeypress(delKey);
|
||||||
control.handleKeypress(dKey);
|
control.handleKeypress(dKey);
|
||||||
|
|
||||||
|
// now make sure nothing happens if the vertex is mid-drag
|
||||||
|
control.dragControl.dragHandler.dragging = true;
|
||||||
|
control.handleKeypress(delKey);
|
||||||
|
|
||||||
// reset modified methods
|
// reset modified methods
|
||||||
control.onModification = function() {};
|
control.onModification = function() {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user