Hi all,<br>in my project I've 2 layers (layer1, layer2) with different attributes.<br>Layer 1 is in gml format, layer2 is a txt file<br>When I click on the layer1, I open a popup with this code:<br><br>function onPopupClose(evt) {selectControl.unselect(feature);}<br>
<br>//al click su un elemento, creo e visualizzo al popup <br>function onFeatureSelect(event) {<br> feature = event.feature;<br> popup = new OpenLayers.Popup.FramedCloud("chicken", <br> feature.geometry.getBounds().getCenterLonLat(),<br>
null,<br> "<div><b>Nome:</b> <a href=\"scheda_comune.php?comune=" + feature.attributes.NOME + "\" target=\"eastFrame\" onClick=\"outerLayout.open('east')\">" + feature.attributes.NOME +"</a></div>",<br>
null, true, onPopupClose);<br> feature.popup = popup;<br> map.addPopup(popup);<br> }<br> <br>function onFeatureUnselect(event) {<br> feature = event.feature;<br> if (feature.popup){<br>
map.removePopup(feature.popup);<br> feature.popup.destroy();<br> feature.popup = null;<br> } <br> }<br clear="all">....<br><br>selectControl = new OpenLayers.Control.SelectFeature(layer1);<br>
//{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});<br> layer1.events.on({<br> "featureselected": onFeatureSelect,<br> "featureunselected": onFeatureUnselect<br>
});<br><br><br>Now I'd like to display the same kind of popup for the layer2 but I don't know what is the correct code to write!!!<br><br><br>thanks<br>-- <br>-beppe-<br>