<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>&nbsp;</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>&nbsp;</DIV>
<DIV>Cheers,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert <BR><BR>&gt;&gt;&gt; "Robert Sanson" &lt;SansonR@asurequality.com&gt; 18/09/2008 12:03 p.m. &gt;&gt;&gt;<BR></DIV>
<DIV>Does anyone know how to remove and reload a GML layer?</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have a layer added to my map as:</DIV>
<DIV>&nbsp;</DIV>
<DIV>va map, fbnd;</DIV>
<DIV>&nbsp;</DIV>
<DIV>fbnd = new OpenLayers.Layer.GML("Farm boundary",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;"<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;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;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120</A>",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{singleTile: true, style: farm_style, extractAttributes: true});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(fbnd);</DIV>
<DIV>&nbsp;</DIV>
<DIV>I then do some edits to the database.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I now want to remove it and reload it, based on a user clicking a button</DIV>
<DIV>&nbsp;</DIV>
<DIV>I tried:</DIV>
<DIV>&nbsp;</DIV>map.removeLayer(fbnd,false); 
<DIV>&nbsp;</DIV>
<DIV>This works, but then iI tried to reload it as:</DIV>
<DIV>&nbsp;</DIV>
<DIV>fbnd = new OpenLayers.Layer.GML("Farm boundary",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;"<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;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;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120</A>",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{singleTile: true, style: farm_style, extractAttributes: true});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(fbnd);</DIV>
<DIV>&nbsp;</DIV>
<DIV>This seems to load the same data without forcing a refresh.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any clues?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Many thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert</DIV><BR><BR>
<TABLE style="COLOR: black" bgColor=white>
<TBODY>
<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></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&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>