<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>Thanks for the clarification Oscar.</DIV>
<DIV> </DIV>
<DIV>Tried:</DIV>
<DIV> </DIV>
<DIV>var apiwfs = new OpenLayers.Layer.WFS("API WFS", <BR> "<A href="http://10.65.192.1/cgi-bin/apinzmg.exe">http://10.65.192.1/cgi-bin/apinzmg.exe</A>?",<BR> {typename: 'apiaries_dev', maxfeatures: 100},<BR> {scales: [150000, 10], extractAttributes: true});</DIV>
<DIV> </DIV>
<DIV>feature.attributes[0] still yields "undefined"</DIV>
<DIV> </DIV>
<DIV>Robert</DIV>
<DIV><BR><BR>>>> "Oscar Fonts" <oscar.fonts.lists@gmail.com> 3/06/2008 7:06 p.m. >>><BR></DIV>
<DIV style="COLOR: #000000">Hi, <BR><BR>There are "params" -> WFS call, and "options" -> JS object properties.<BR><BR>Try moving "extractAttributes:true" from "params" to "options", as is an OL fuctionality, not WFS protocol.<BR><BR><A href="http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Layer/WFS-js.html#OpenLayers.Layer.WFS.OpenLayers.Layer.WFS">http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Layer/WFS-js.html#OpenLayers.Layer.WFS.OpenLayers.Layer.WFS</A><BR><BR>Oscar.<BR>---<BR><BR><BR>
<DIV class=gmail_quote>2008/6/2 Robert Sanson <<A href="mailto:SansonR@asurequality.com">SansonR@asurequality.com</A>>:<BR>
<BLOCKQUOTE class=gmail_quote defanghtml_style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<DIV defanghtml_style="margin: 4px 4px 1px; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<DIV>I am still struggling with attributes from a WFS layer.</DIV>
<DIV> </DIV>
<DIV>I have a WFS layer, which I understand inherits from OpenLayers.Feature.Vector. I set "extractAttributes: true" as in:</DIV>
<DIV> </DIV>
<DIV>var apiwfs = new OpenLayers.Layer.WFS("API WFS", <BR> "<A href="http://10.65.192.1/cgi-bin/apinzmg.exe" target=_blank>http://10.65.192.1/cgi-bin/apinzmg.exe</A>?",<BR> {typename: 'apiaries_dev', maxfeatures: 100, extractAttributes: true},<BR> {scales: [150000, 10]});</DIV>
<DIV> </DIV>
<DIV>The layer loads fine and displays on my map. When I try to extract the attributes with:</DIV>
<DIV> </DIV>
<DIV>var options = {<BR> hover: true,<BR> onSelect: function(feature) { <BR> OpenLayers.Util.getElement('apiary').innerHTML = "<strong>Apiary_id:</strong>" + feature.fid + " <strong>Geometry:</strong>" + feature.geometry + ":" + feature.attributes[0] + ":" + feature.attributes[1] + ":" + feature.attributes[2];<BR> }<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> </DIV>
<DIV>Any pointers appreciated.</DIV>
<DIV> </DIV>
<DIV>Robert Sanson</DIV>
<DIV><BR>>>> Christopher Schmidt <<A href="mailto:crschmidt@metacarta.com" target=_blank>crschmidt@metacarta.com</A>> 3/06/2008 2:21 a.m. >>><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>
<DIV defanghtml_style="color: rgb(0, 0, 0);">On Mon, Jun 02, 2008 at 09:38:34AM +0200, Eric Lemoine wrote:<BR>> On Mon, Jun 2, 2008 at 9:03 AM, <<A href="mailto:bartvde@osgis.nl" target=_blank>bartvde@osgis.nl</A>> wrote:<BR>> > Hi list,<BR>> ><BR>> > why does an OpenLayers.Feature.Vector instance have both "data" and<BR>> > "attributes" properties, which contain the same arrays AFAICT?<BR>> <BR>> 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><A href="mailto:Dev@openlayers.org" target=_blank>Dev@openlayers.org</A><BR><A href="http://openlayers.org/mailman/listinfo/dev" target=_blank>http://openlayers.org/mailman/listinfo/dev</A><BR><BR></DIV><BR><BR></DIV></DIV>
<TABLE style="COLOR: black" bgColor=white>
<TBODY>
<TR>
<TD><BR>------------------------------------------------------------------<BR>The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.<BR>------------------------------------------------------------------</TD></TR></TBODY></TABLE><BR><BR>
<P align=center><FONT defanghtml_style="background-color: rgb(255, 255, 255);">This message has been scanned for malware by SurfControl plc. </FONT><A href="http://www.surfcontrol.com/" target=_blank><FONT color=#000000 defanghtml_style="background-color: rgb(255, 255, 255);">www.surfcontrol.com</FONT></A></P></DIV><BR>_______________________________________________<BR>Dev mailing list<BR><A href="mailto:Dev@openlayers.org">Dev@openlayers.org</A><BR><A href="http://openlayers.org/mailman/listinfo/dev" target=_blank>http://openlayers.org/mailman/listinfo/dev</A><BR><BR></BLOCKQUOTE></DIV><BR><BR><BR><FONT style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">Click <A href="https://www.mailcontrol.com/sr/V0DxUzW9P5jTndxI!oX7UmBDHWqdmev3aeaqsShuP9lvpOOimEGnQtEIgGBnpAHxQsiovm37qtteTFI5G433hQ==">here</A> to report this email as spam.</FONT></P></FONT></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.<br>
------------------------------------------------------------------</td></tr></table></BODY></HTML>