<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 Bill</DIV>
<DIV> </DIV>
<DIV>For style, and extracting attributes, here is some example code:</DIV>
<DIV> </DIV>
<DIV>var farm_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);<BR> farm_style.strokeWidth = 3;<BR> farm_style.strokeColor = "#ff0000";<BR> farm_style.fillOpacity = 0.5;</DIV>
<DIV> </DIV>
<DIV>var fbnd = new OpenLayers.Layer.WFS("Selected Farm WFS", <BR> "<A href='http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid'>http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid</A>+"&",<BR> {typename: 'farm', maxfeatures: 100},<BR> {scales: [150000, 10], style: farm_style, extractAttributes: true});</DIV>
<DIV>map.addLayer(fbnd);</DIV>
<DIV> </DIV>
<DIV>var options = {<BR> hover: true,<BR> onSelect: function(feature) { <BR> OpenLayers.Util.getElement('selfarm').innerHTML = "<strong>Farm_id:</strong>" + feature.attributes.FARM_ID + " <strong>Par_no:</strong>" + feature.attributes.PAR_ID<BR> }</DIV>
<DIV> </DIV>
<DIV> };<BR> var select = new OpenLayers.Control.SelectFeature(fbnd, options);<BR> map.addControl(select);<BR> //select.handler.stopDown = false;<BR> //select.handler.stopUp = false;<BR> select.activate();<BR> }</DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Robert S<BR><BR>>>> Bill Thoen <bthoen@gisnet.com> 3/09/2008 11:13 a.m. >>><BR>I've got a couple questions about WFS layers:<BR><BR>After I load features into a WFS layer, how do I access them via js <BR>code? I thought these would be in the layer.features array, but even <BR>though there are features in the layer, the features array is empty.<BR><BR>Second, how do I style WFS features? The default style for linear <BR>features appears to be solid 1px orange, but I want to apply some <BR>different styles.<BR><BR>TIA,<BR>- Bill Thoen<BR><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 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><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>