Fix for Feature handler uses getFeatureFromEvent on mousemove even without

hover callbacks; r=ahocevar (Closes #1655) 

This means that On the SelectFeature control hover can no longer be set on the
SelectFeature control after the control has been initialized: must be passed at
initialize time. Example has been updated. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7682 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-08-03 02:06:31 +00:00
parent f0e9c1c6a5
commit 693e6d07e3
4 changed files with 31 additions and 12 deletions

View File

@@ -128,12 +128,16 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
initialize: function(layer, options) {
OpenLayers.Control.prototype.initialize.apply(this, [options]);
this.layer = layer;
this.callbacks = OpenLayers.Util.extend({
click: this.clickFeature,
clickout: this.clickoutFeature,
over: this.overFeature,
out: this.outFeature
}, this.callbacks);
var callbacks = {
click: this.clickFeature,
clickout: this.clickoutFeature
};
if (this.hover) {
callbacks.over = this.overFeature;
callbacks.out = this.outFeature;
}
this.callbacks = OpenLayers.Util.extend(callbacks, this.callbacks);
this.handlers = {
feature: new OpenLayers.Handler.Feature(
this, layer, this.callbacks, {geometryTypes: this.geometryTypes}