[OpenLayers-Users] Multiple selectfeature on one layer

Eric Lemoine eric.c2c at gmail.com
Mon May 5 16:09:26 EDT 2008


On Mon, May 5, 2008 at 12:51 PM, Lid Sjur Ringheim
<sjur.ringheim.lid at imr.no> wrote:
>
>
>
>
> Hello,
>
>
>
> This was working in OpenLayers 2.5 but I can't get it to work in 2.6.
>
>
>
> I'm having a GML layer with point features that I want to put a hover and a
> click selectFeature control on but only the hover one seems to be working.
>
> This is the code I'm using which were working in 2.5
>
>
>
>     selfeature = new OpenLayers.Control.SelectFeature(pointlayer, { hover :
> true, onSelect : onFeatureSelect, onUnselect :onFeatureUnselect});
>
>     clickfeature = new OpenLayers.Control.SelectFeature(pointlayer,
> {onSelect : updateStationsFeature, onUnselect : updateStationsFeature});
>
>
>
>     map.addControl(clickfeature);
>
>     map.addControl(selfeature);
>
>
>
>     clickfeature.activate();
>
>     selfeature.activate();
>
>
>
> In 2.6 only the first method is working the second is never used for some
> reason. I have checked the DOM tree and both are part of the controls array
> of the map object.
>
>
>
> Do anyone know a workaround for this? Maybe making two layers and having one
> of them use the hover version and one the click version?

Hello

I can confirm that there are problems. I'll try to take a look.

Thanks for reporting it.

--
Eric



More information about the Users mailing list