[OpenLayers-Users] How to set scope for callbacks in SelectFeature
control?
Casper Børgesen
cbo at le34.dk
Tue Apr 20 06:05:48 EDT 2010
How do I set the scope for any of the callbacks associated in the SelectFeature control?
Var featSelect = new OpenLayers.Control.SelectFeature(
this.Layer,
{
...
scope: this, // Appearently not for the callbacks
callbacks: { 'click': this.handleClick }
}
);
Using closures doesn't seem to work either.
Var featSelect = new OpenLayers.Control.SelectFeature(
this.Layer,
{
...
scope: this, // Appearently not for the callbacks
callbacks: { 'click': function (feat) {
this.handleClick(feat);
}
}
}
);
I'm still working on learning how to understand the OpenLayers source and how to handle scopes in general :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100420/965896cc/attachment.html
More information about the Users
mailing list