Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select Feature Control OpenLayers

Tags:

openlayers

I've been working with OpenLayers, and i made a layer tree (all layers are vector layers), and all this layers have features, what i want is to select those features through the select control.

I made the Select Feature Control but the problem it's that when i turn off one of those layers(i'm removing the layer from the map to turn it off), the icon still there, it's like it doesn't turned off at all...

I've tryed almost everything and i don't know why this could be happening...

Does anybody know how to solve this???

like image 437
Ricardo ACB Avatar asked Aug 13 '26 09:08

Ricardo ACB


1 Answers

You could just remove all features from the layer each time you deactivate your control enstead of removing the layer.

like image 154
danielrvt Avatar answered Aug 15 '26 13:08

danielrvt