On Feb 4, 2008 4:45 PM, Jean Pommier (IGE) <[EMAIL PROTECTED]> wrote:
> Hi,

Hi Jean

> I'm using a selectFeature with hover:true, to change the style of some GML
> data (using an SLD file), and perform some actions. It works nicely, except
> for one thing : i'd like the last selected feature to keep it's "selected"
> style until a new feature is selected. Can someone tell me how to do this ?
>  Thanks

I guess you'd need to override the outFeature callback, which is
called when the mouse goes out of a feature. You'd possibly need to
modify the overFeature callback as well (to unselect the previously
selected feature).

To override the callbacks do something like that:

var sc = new OpenLayers.Control.SelectFeature(layer, {
    hover: true,
    callbacks: {
        out: function(feature) {
            // your code here
        }, {
        over: function(feature) {
            // your code here
        }
    }
);

Hope this helps,

--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to