Control/Split isEligible() should check feature has a geometry
This commit is contained in:
@@ -312,16 +312,20 @@ OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* {Boolean} The target is eligible for splitting.
|
* {Boolean} The target is eligible for splitting.
|
||||||
*/
|
*/
|
||||||
isEligible: function(target) {
|
isEligible: function(target) {
|
||||||
return (
|
if (!target.geometry) {
|
||||||
target.state !== OpenLayers.State.DELETE
|
return false;
|
||||||
) && (
|
} else {
|
||||||
typeof target.geometry.split === "function"
|
return (
|
||||||
) && (
|
target.state !== OpenLayers.State.DELETE
|
||||||
this.feature !== target
|
) && (
|
||||||
) && (
|
typeof target.geometry.split === "function"
|
||||||
!this.targetFilter ||
|
) && (
|
||||||
this.targetFilter.evaluate(target.attributes)
|
this.feature !== target
|
||||||
);
|
) && (
|
||||||
|
!this.targetFilter ||
|
||||||
|
this.targetFilter.evaluate(target.attributes)
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user