I'm working with OpenLayers, I created a new plugin to perform a selection feature. But every event I perform in my plugin button it creates a new layers. (Attached is a print).
Of the attempts that tried to make the removal of the layer were:
map.layers.remove (0); map.layers.length; map.layers.remove;
Can anyone help me ?