Hi all,
in my project I've 2 layers (layer1, layer2) with different attributes.
Layer 1 is in gml format, layer2 is a txt file
When I click on the layer1, I open a popup with this code:

function onPopupClose(evt) {selectControl.unselect(feature);}

//al click su un elemento, creo e visualizzo al popup
function onFeatureSelect(event) {
       feature = event.feature;
       popup = new OpenLayers.Popup.FramedCloud("chicken",
                  feature.geometry.getBounds().getCenterLonLat(),
                  null,
                  "<div><b>Nome:</b> <a href=\"scheda_comune.php?comune=" +
feature.attributes.NOME + "\" target=\"eastFrame\"
onClick=\"outerLayout.open('east')\">" + feature.attributes.NOME
+"</a></div>",
                  null, true, onPopupClose);
       feature.popup = popup;
       map.addPopup(popup);
      }

function onFeatureUnselect(event) {
        feature = event.feature;
       if (feature.popup){
           map.removePopup(feature.popup);
           feature.popup.destroy();
           feature.popup = null;
      }
     }
....

selectControl = new OpenLayers.Control.SelectFeature(layer1);
   //{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
    layer1.events.on({
                "featureselected": onFeatureSelect,
                "featureunselected": onFeatureUnselect
            });


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!!!


thanks
-- 
-beppe-
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to