Avoiding duplicate events

This commit is contained in:
ahocevar
2013-05-23 12:42:31 -05:00
committed by Bart van den Eijnden
parent cd5ae45273
commit 8562582dd2

View File

@@ -235,8 +235,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.handlers.drag.evt); this.handlers.drag.evt);
if (feature) { if (feature) {
this.dragStart(feature); this.dragStart(feature);
} else if (this.feature && this.clickout) { } else if (this.clickout) {
this.unselectFeature(this.feature); this._unselect = this.feature;
} }
}, },
move: function(pixel) { move: function(pixel) {
@@ -363,8 +363,9 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* feature - {<OpenLayers.Feature.Vector>} the selected feature. * feature - {<OpenLayers.Feature.Vector>} the selected feature.
*/ */
selectFeature: function(feature) { selectFeature: function(feature) {
if (this.geometryTypes && OpenLayers.Util.indexOf(this.geometryTypes, if ((this.modified && this.feature === feature) ||
feature.geometry.CLASS_NAME) == -1) { (this.geometryTypes && OpenLayers.Util.indexOf(this.geometryTypes,
feature.geometry.CLASS_NAME) == -1)) {
return; return;
} }
if (this.beforeSelectFeature(feature) !== false) { if (this.beforeSelectFeature(feature) !== false) {