Dear List,

 

I am a newbie in using OpenLayers. 

I have setup my WFS server layers with ["gml_include_items" "all"] which
successfully serve PostGIS layers. I am able to add a WFS layer as my base
layer and I'm able to view, zoom pan the map. But I don't know how to get
the attribute information associated with the features. .I tried with
"OpenLayers. Feature. Vector" class's attributes property but it's not
working for me. I tried the following codes but nothing seemed to work:

 

#1.

var feature = wfsLayer.getFeatureFromEvent(e); //this is getting me a
feature on double click without any troble

if(feature) {

    alert(feature.attributes[0]);

}

 

#2.

var feature = wfsLayer.getFeatureFromEvent(e);

if(feature) {

      for(var attr in feature.attributes){

alert(attr);

      }

}

 

Am I doing anything wrong?

Please help me out.

 

Thanks.

Regards,

Ela

 

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to