[OpenLayers-Users] How to remove and reload a GML layer - solved
Robert Sanson
SansonR at asurequality.com
Wed Sep 17 22:25:29 EDT 2008
Hi
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.
Cheers,
Robert
>>> "Robert Sanson" <SansonR at asurequality.com> 18/09/2008 12:03 p.m. >>>
Does anyone know how to remove and reload a GML layer?
I have a layer added to my map as:
va map, fbnd;
fbnd = new OpenLayers.Layer.GML("Farm boundary",
"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' )",
{singleTile: true, style: farm_style, extractAttributes: true});
map.addLayer(fbnd);
I then do some edits to the database.
I now want to remove it and reload it, based on a user clicking a button
I tried:
map.removeLayer(fbnd,false);
This works, but then iI tried to reload it as:
fbnd = new OpenLayers.Layer.GML("Farm boundary",
"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' )",
{singleTile: true, style: farm_style, extractAttributes: true});
map.addLayer(fbnd);
This seems to load the same data without forcing a refresh.
Any clues?
Many thanks,
Robert
------------------------------------------------------------------
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.
------------------------------------------------------------------
This message has been scanned for malware by SurfControl plc. www.surfcontrol.com ( http://www.surfcontrol.com/ )
Click here ( https://www.mailcontrol.com/sr/lboVqLLfumvTndxI!oX7UhblTb0BBCjq4am39x6ai4pLLlBB97uqOsrupOtDxR9eNzk2Jf8HBVsDNW0+5ADKWw== ) to report this email as spam.
------------------------------------------------------------------
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.
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080918/7777a1ef/attachment.html
More information about the Users
mailing list