<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>I am still struggling with attributes from a WFS layer.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have a WFS layer, which I understand inherits from OpenLayers.Feature.Vector. I set "extractAttributes: true" as in:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var apiwfs = new OpenLayers.Layer.WFS("API WFS", <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"<A href="http://10.65.192.1/cgi-bin/apinzmg.exe">http://10.65.192.1/cgi-bin/apinzmg.exe</A>?",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{typename: 'apiaries_dev', maxfeatures: 100, extractAttributes: true},<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{scales: [150000, 10]});</DIV>
<DIV>&nbsp;</DIV>
<DIV>The layer loads fine and displays on my map. When I try to extract the attributes with:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var options = {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hover: true,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; onSelect: function(feature) {&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenLayers.Util.getElement('apiary').innerHTML = "&lt;strong&gt;Apiary_id:&lt;/strong&gt;" + feature.fid + " &lt;strong&gt;Geometry:&lt;/strong&gt;" + feature.geometry + ":" + feature.attributes[0] + ":" + feature.attributes[1] + ":" + feature.attributes[2];<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR></DIV>
<DIV>I can get at the feature.fid and feature.geometry, but calls to feature.attributes[n] return "undefined" (I have also tried "feature.data[n]".</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any pointers appreciated.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson</DIV>
<DIV><BR>&gt;&gt;&gt; Christopher Schmidt &lt;crschmidt@metacarta.com&gt; 3/06/2008 2:21 a.m. &gt;&gt;&gt;<BR></DIV>
<DIV style="COLOR: #000000">On Mon, Jun 02, 2008 at 09:38:34AM +0200, Eric Lemoine wrote:<BR>&gt; On Mon, Jun 2, 2008 at 9:03 AM,&nbsp; &lt;bartvde@osgis.nl&gt; wrote:<BR>&gt; &gt; Hi list,<BR>&gt; &gt;<BR>&gt; &gt; why does an OpenLayers.Feature.Vector instance have both "data" and<BR>&gt; &gt; "attributes" properties, which contain the same arrays AFAICT?<BR>&gt; <BR>&gt; I may be wrong but I'd say: "historical reasons" [*].<BR><BR>Yes.<BR><BR>Regards,<BR>-- <BR>Christopher Schmidt<BR>MetaCarta<BR>_______________________________________________<BR>Dev mailing list<BR>Dev@openlayers.org<BR><A href="http://openlayers.org/mailman/listinfo/dev">http://openlayers.org/mailman/listinfo/dev</A><BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>