diff --git a/lib/OpenLayers/Handler/Feature.js b/lib/OpenLayers/Handler/Feature.js index fba3d969c7..e9af869c16 100644 --- a/lib/OpenLayers/Handler/Feature.js +++ b/lib/OpenLayers/Handler/Feature.js @@ -211,6 +211,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { // in feature for the first time this.triggerCallback(type, 'in', [this.feature]); } + this.lastFeature = this.feature; stopEvtPropag = true; } else { // not in to a feature @@ -219,7 +220,6 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { this.triggerCallback(type, 'out', [this.lastFeature]); } } - this.lastFeature = this.feature; } else { if(previouslyIn || (click && this.lastFeature)) { this.triggerCallback(type, 'out', [this.lastFeature]); diff --git a/tests/manual/select-feature.html b/tests/manual/select-feature.html new file mode 100644 index 0000000000..303ed19466 --- /dev/null +++ b/tests/manual/select-feature.html @@ -0,0 +1,150 @@ + +
++ + The map includes two select feature controls. The first one operates on + geometries of type OpenLayers.Geometry.Point only and works on clicks. The + second one operates on geometries of type OpenLayers.Geometry.Polygon and + works on mouseover's. If you select the point geometry by clicking on it, + it shouldn't be unselected when the mouse moves out if it. + +
+ + + + ++ + The map includes two select feature controls. The first one operates on + geometries of type OpenLayers.Geometry.Point only and works on clicks. The + second one operates on geometries of type OpenLayers.Geometry.Polygon and + works on mouseover's. If you select the point geometry by clicking on it, + it shouldn't be unselected when the mouse moves out if it. + +
+ +