Fixed the scope of onSelect, onUnselect,... when scope is not specified.

r=crschmidt (pullup #2115)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9419 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-06-01 16:27:02 +00:00
parent 553f05d293
commit d6a3c508a1
2 changed files with 10 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
* {Object} The scope to use with the onBeforeSelect, onSelect, onUnselect
* callbacks. If null the scope will be this control.
*/
scope: this,
scope: null,
/**
* APIProperty: geometryTypes
@@ -178,6 +178,10 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.EVENT_TYPES
);
OpenLayers.Control.prototype.initialize.apply(this, [options]);
if(this.scope === null) {
this.scope = this;
}
if(layers instanceof Array) {
this.layers = layers;
this.layer = new OpenLayers.Layer.Vector.RootContainer(