<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hi Stephen</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is some code I use. I load the WFS layer as a GML, and make sure that extractAttributes is set to True on load:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var apigml = new OpenLayers.Layer.GML("Selected Apiary",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<A href='http://10.65.192.1/cgi-bin/apimgwfs.exe?apiaryid="+apiaryid+"&amp;request=getfeature&amp;typename=apiaries&amp;service=wfs&amp;version=1.0.0&amp;BBOX="+x1+","+y1+","+x2+","+y2'>http://10.65.192.1/cgi-bin/apimgwfs.exe?apiaryid="+apiaryid+"&amp;request=getfeature&amp;typename=apiaries&amp;service=wfs&amp;version=1.0.0&amp;BBOX="+x1+","+y1+","+x2+","+y2</A>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {styleMap: myStyles, extractAttributes: true});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map.addLayer(apigml);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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) { <BR>&nbsp;&nbsp;&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.attributes.apiary_id + " &lt;strong&gt;Beekeeper_reg_no:&lt;/strong&gt;" + feature.attributes.beekeeper_reg_no + " &lt;strong&gt;MAF_id:&lt;/strong&gt;" + feature.attributes.maf_id<BR></DIV>
<DIV>Cheers,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR><BR>&gt;&gt;&gt; Stephen Woodbridge &lt;woodbri@swoodbridge.com&gt; 9/02/2009 10:26 a.m. &gt;&gt;&gt;<BR>Hi all,<BR><BR>I'm making progress but can't find the attributes of the WFS features.<BR><BR>My goal is to load a WFS layer, pull the attributes into a div as a <BR>scrolling list of items and when you mouse over the item in the <BR>scrolling list have it highlight the feature on the map.<BR><BR>To start with, I'm approaching this backwards and just displaying the <BR>WFS and highlighting the features onHover over the map, with the idea <BR>that if I can grab the attributes and make a list, I can add onHover <BR>handler to the list items and have them select the feature. Any way that <BR>was my thought, but maybe there is a better way to do this.<BR><BR>I assume I can hook the beforefeatureadded or featureadded to extract <BR>the attributes and add them to the list in some div, assuming that I <BR>have access to the attributes which is a problem at the moment.<BR><BR>Thoughts and pointers to examples would be appreciated.<BR><BR>Anyway, missing attributes - the attributes are in the XML, but do not <BR>appear to be added to the features objects at least as far as I can tell <BR>but looking in the DOM with firebug. And adding to the selectFeature <BR>control:<BR><BR>onSelect: function (feature) {<BR>&nbsp;&nbsp; alert(feature.attributes["gid"]);<BR>}<BR><BR>returns a undefined. Here is a link to the page:<BR><BR><A href="http://imaptools.com/maps2/test.html">http://imaptools.com/maps2/test.html</A><BR><BR>Once it loads and displays the vector layer, a hover will generate an alert.<BR><BR>Thanks,<BR>&nbsp;&nbsp; -Steve<BR>_______________________________________________<BR>Users mailing list<BR>Users@openlayers.org<BR><A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</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>