diff --git a/lib/OpenLayers/Handler/Feature.js b/lib/OpenLayers/Handler/Feature.js index 96c486e0a6..769f8e6d8d 100644 --- a/lib/OpenLayers/Handler/Feature.js +++ b/lib/OpenLayers/Handler/Feature.js @@ -33,7 +33,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { /** * Property: feature - * {} The feature currently being handled. + * {} The last feature that was hovered. */ feature: null, @@ -246,6 +246,12 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { // out of last feature for the first time this.triggerCallback(type, 'out', [this.lastFeature]); } + // next time the mouse goes in a feature whose geometry type + // doesn't match we don't want to call the 'out' callback + // again, so let's set this.feature to null so that + // previouslyIn will evaluate to false the next time + // we enter handle. Yes, a bit hackish... + this.feature = null; } } else { if(previouslyIn || (click && this.lastFeature)) {