Hi,<br>I&#39;ve two overlays, one is a Vector layers of markers built from a kml file, <br>the other is a GML geometric layer from an xml file.<br>I&#39;ve added a SelectFeature for each layer, but if I add first layer1 then layer2 <br>
only selectFeature for layer2 work. On otherwise if I add layer2 then layer1 only<br>selectFeature for layer1 work, there is a way to make working both layers?<br>Here the code:<br><br>var layer1 = new OpenLayers.Layer.Vector(&quot;Segnalazioni&quot;, {<br>
    &#39;displayInLayerSwitcher&#39;:false,<br>    styleMap: new OpenLayers.StyleMap(style),<br>    projection: map.displayProjection,<br>    strategies: [new OpenLayers.Strategy.Fixed()],<br>    protocol: new OpenLayers.Protocol.HTTP({<br>
        url: &quot;file.kml&quot;,<br>        format: new OpenLayers.Format.KML({<br>            extractStyles: false,<br>            extractAttributes: true<br>        })<br>    })<br>});<br>           <br>var  layer2 = new OpenLayers.Layer.GML(<br>
    &quot;GML&quot;,<br>    &quot;file.xml&quot;,<br>    {<br>        projection: map.displayProjection,<br>        styleMap: myStyleMap,<br>        &#39;displayInLayerSwitcher&#39;:false,<br>        &#39;isBaseLayer&#39;:false<br>
    }<br>);<br><br><br><br><br>selectControl = new OpenLayers.Control.SelectFeature(<br>    layer2,<br>    {<br>        clickout: true, toggle: true,<br>        multiple: false, hover: true<br>    }<br>);<br>           <br>
layer2.events.on(<br>    {<br>        &quot;featureselected&quot;: function(e) {<br>            alert(&quot;Selected.&quot;);<br>        },<br>        &quot;featureunselected&quot;: function(e) {<br>            alert(&quot;Unselected.&quot;);<br>
        }<br>    }<br>);<br>            <br>map.addControl(selectControl);<br>selectControl.activate();<br><br>select = new OpenLayers.Control.SelectFeature(layer1);<br>layer1.events.on(<br>    {<br>        &quot;featureselected&quot;: onFeatureSelect,<br>
        &quot;featureunselected&quot;: onFeatureUnselect<br>    }<br>);<br><br>map.addControl(select);<br>select.activate();            <br>            <br>