<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 defanghtml_style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>The trick to getting the reload layer to work was to add a dummy parameter to the end of the URL, so the browser thought it was a new request.</DIV>
<DIV> </DIV>
<DIV>Cheers,</DIV>
<DIV> </DIV>
<DIV>Robert <BR><BR>>>> "Robert Sanson" <SansonR@asurequality.com> 18/09/2008 12:03 p.m. >>><BR></DIV>
<DIV>Does anyone know how to remove and reload a GML layer?</DIV>
<DIV> </DIV>
<DIV>I have a layer added to my map as:</DIV>
<DIV> </DIV>
<DIV>va map, fbnd;</DIV>
<DIV> </DIV>
<DIV>fbnd = new OpenLayers.Layer.GML("Farm boundary",<BR> "<A href='http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120'>http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120</A>",<BR> {singleTile: true, style: farm_style, extractAttributes: true});<BR> map.addLayer(fbnd);</DIV>
<DIV> </DIV>
<DIV>I then do some edits to the database.</DIV>
<DIV> </DIV>
<DIV>I now want to remove it and reload it, based on a user clicking a button</DIV>
<DIV> </DIV>
<DIV>I tried:</DIV>
<DIV> </DIV>map.removeLayer(fbnd,false);
<DIV> </DIV>
<DIV>This works, but then iI tried to reload it as:</DIV>
<DIV> </DIV>
<DIV>fbnd = new OpenLayers.Layer.GML("Farm boundary",<BR> "<A href='http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120'>http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120</A>",<BR> {singleTile: true, style: farm_style, extractAttributes: true});<BR> map.addLayer(fbnd);</DIV>
<DIV> </DIV>
<DIV>This seems to load the same data without forcing a refresh.</DIV>
<DIV> </DIV>
<DIV>Any clues?</DIV>
<DIV> </DIV>
<DIV>Many thanks,</DIV>
<DIV> </DIV>
<DIV>Robert</DIV><BR><BR>
<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 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><BR><BR><FONT style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">Click <A href="https://www.mailcontrol.com/sr/lboVqLLfumvTndxI!oX7UhblTb0BBCjq4am39x6ai4pLLlBB97uqOsrupOtDxR9eNzk2Jf8HBVsDNW0+5ADKWw==">here</A> to report this email as spam.</FONT></P></FONT><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>