[OpenLayers-Users] WFS GEtFeature layer not showing on map

sunny74 sb.ray at hotmail.com
Tue Apr 20 02:21:57 EDT 2010


Hi,

I am trying to loop thru' the Attribute list and display the name,value
pair.
For eg S_Name: Navsari

where S_Name is the name of the attribute and Navsari is value.
But not successful till now.

The only thing that is working is:

 document.getElementById('featuredetails').innerHTML += "<br>" +
e.feature.attributes.S_Name + "<br>"
                                        + e.feature.attributes.S_No + "<br>"
                                        + e.feature.attributes.Distance_K +
"<br>"
                                        + e.feature.attributes.Stn_Code;

But this directly shows the value without the name.

tried something like this:

 var feats = e.feature;
                   alert(results.attributes.length);
                   //alert(feats);
                   //                   while (feats.attributes != null) {
                   //                      
document.getElementById('featuredetails').innerHTML += "<br>" +
feats.attributes.name + "<br>";

                   //                   }
                   //                   for (i = 0; i <
feats.attributes.length; i++) {
                   //                       alert(feats.attributes.first);
                   //                       alert(feats.attributes);
                   //                      
document.getElementById('featuredetails').innerHTML += "<br>" +
feats.attributes[i].name + "<br>";
                   //                   }

but feats.attributes.length is undefined.
If I use while loop IE hangs.

What is the way out?

Thanks.

-- 
View this message in context: http://n2.nabble.com/WFS-GEtFeature-layer-not-showing-on-map-tp4921150p4929582.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list