[OpenLayers-Users] Multiple selectfeature on one layer

Lid Sjur Ringheim sjur.ringheim.lid at imr.no
Mon May 5 06:51:54 EDT 2008


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?

 

Best regards

Sjur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080505/2b4dfb50/attachment.html


More information about the Users mailing list