<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>I couldn't get getDataExtent()) to work for a OpenLayers.Layer.GML</DIV>
<DIV>&nbsp;</DIV>
<DIV>I changed to a OpenLayers.Layer.Vector and then it worked:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var g =&nbsp; new OpenLayers.Format.GML();</DIV>
<DIV>&nbsp;</DIV>
<DIV>var fbndurl = "<A href='http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&amp;request=getfeature&amp;typename=farm&amp;service=wfs&amp;version=1.0.0&amp;SRS=EPSG:2193&amp;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120'>http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&amp;request=getfeature&amp;typename=farm&amp;service=wfs&amp;version=1.0.0&amp;SRS=EPSG:2193&amp;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120</A>";<BR>OpenLayers.loadURL(fbndurl, '', this, fbndreturn);</DIV>
<DIV>&nbsp;</DIV>
<DIV>function fbndreturn(fbndresponse) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fbnd = new OpenLayers.Layer.Vector("Farm boundary",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {isBaseLayer: false,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: farm_style, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extractAttributes: true }); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fbnd.addFeatures(g.read(fbndresponse.responseText));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(fbnd);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.zoomToExtent(fbnd.getDataExtent());</DIV>
<DIV>}<BR></DIV>
<DIV>Robert</DIV>
<DIV><BR>&gt;&gt;&gt; Christopher Schmidt &lt;crschmidt@metacarta.com&gt; 17/10/2008 11:11 a.m. &gt;&gt;&gt;<BR>On Fri, Oct 17, 2008 at 11:08:17AM +1300, Robert Sanson wrote:<BR>&gt; Does anyone know if Layer function getDataExtent() has been implemented for a GML layer constructed with:<BR><BR>The singleTile option is completely useless... as is the<BR>extractAttributes option, I'm pretty sure...<BR><BR>Anyway, "yes, as of 2.7."<BR><BR>-- Chris<BR><BR>&gt; fbnd = new OpenLayers.Layer.GML("Farm boundary",<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&amp;request=getfeature&amp;typename=farm&amp;service=wfs&amp;version=1.0.0&amp;SRS=EPSG:2193&amp;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120 ( 'http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&amp;amp;request=getfeature&amp;amp;typename=farm&amp;amp;service=wfs&amp;amp;version=1.0.0&amp;amp;SRS=EPSG:2193&amp;amp;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;amp;maxfeatures=120' )",<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {singleTile: true, style: farm_style, extractAttributes: true});<BR>&gt;&nbsp; <BR>&gt; ?<BR>&gt;&nbsp; <BR>&gt; Many thanks,<BR>&gt; <BR>&gt; Robert<BR>&gt; ------------------------------------------------------------------<BR>&gt; 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>&gt; ------------------------------------------------------------------<BR>&gt; <BR>&gt; <BR>&gt; This message has been scanned for malware by SurfControl plc. www.surfcontrol.com<BR><BR>&gt; _______________________________________________<BR>&gt; Users mailing list<BR>&gt; Users@openlayers.org<BR>&gt; <A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</A><BR><BR><BR>-- <BR>Christopher Schmidt<BR>MetaCarta<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></BODY></HTML>