The feature handler should not handle destroyed features. Or any features without a layer for that matter. r=elemoine (closes #1806)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8284 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -223,7 +223,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
|
||||
var previouslyIn = !!(this.feature); // previously in a feature
|
||||
var click = (type == "click" || type == "dblclick");
|
||||
this.feature = this.layer.getFeatureFromEvent(evt);
|
||||
if(this.feature) {
|
||||
if(this.feature && this.feature.layer) {
|
||||
var inNew = (this.feature != this.lastFeature);
|
||||
if(this.geometryTypeMatches(this.feature)) {
|
||||
// in to a feature
|
||||
@@ -251,7 +251,8 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
|
||||
this.feature = null;
|
||||
}
|
||||
} else {
|
||||
if(previouslyIn || (click && this.lastFeature)) {
|
||||
if(this.lastFeature && this.lastFeature.layer &&
|
||||
(previouslyIn || click)) {
|
||||
this.triggerCallback(type, 'out', [this.lastFeature]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user