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.
|
||||
*/
|
||||
isEligible: function(target) {
|
||||
return (
|
||||
target.state !== OpenLayers.State.DELETE
|
||||
) && (
|
||||
typeof target.geometry.split === "function"
|
||||
) && (
|
||||
this.feature !== target
|
||||
) && (
|
||||
!this.targetFilter ||
|
||||
this.targetFilter.evaluate(target.attributes)
|
||||
);
|
||||
if (!target.geometry) {
|
||||
return false;
|
||||
} else {
|
||||
return (
|
||||
target.state !== OpenLayers.State.DELETE
|
||||
) && (
|
||||
typeof target.geometry.split === "function"
|
||||
) && (
|
||||
this.feature !== target
|
||||
) && (
|
||||
!this.targetFilter ||
|
||||
this.targetFilter.evaluate(target.attributes)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user