AW: [OpenLayers-Users] referring to vector layer attributes
byattribute column index?
Arnd Wippermann
arnd.wippermann at web.de
Fri Jun 10 17:24:44 EDT 2011
if you want access every attribute, you can use something like this
function ftAttributes(ft)
{
var theHTML = "<table>\n";
for(var key in ft.attributes)
{
theHTML += '<tr><td>' + key + '</td><td>' + ft.attributes[key] +
'</td></tr>\n';
}
theHTML += "</table>\n";
return(theHTML);
}
Arnd
_____
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Vishal
Mehta
Gesendet: Freitag, 10. Juni 2011 22:57
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] referring to vector layer attributes byattribute
column index?
Is it possible to refer to an attribute by an index instead of its name?
I want to programmatically be able access any vector layer's attributes in a
popup when a feature is selected. Each vector layer has different number and
names of attributes.
Thanks,
Vishal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110610/eaba2b22/attachment.html
More information about the Users
mailing list