You can write a function to refresh the layer. Something like:
 
function refreshLayer() {
for (key in map.layers) {
                var layerRef = map.layers[key];
                if (layerRef.name == "Points"){
                  layerRef.destroy();
                }
              }
//then your code for reloading the layer here, including re-adding to the map
map.addLayer(myPoints);
}
 
Regards,
 
Robert
>>> Vikash Talanki <[email protected]> 8/06/2011 2:18 p.m. >>>
Hi, 

  I have my map code in openlayers JS. My input data is in a text file and I
am able to render the points on the map. I have to give the user a right to
create a layer by entering the data in a form. Writing a program to insert
data into a text file is trivial. But I am stuck at how to include this
layers code in the JS programmatically so that after giving the layers
details in the form if the user reloads the page then the new layer should
be visible, Any solutions??

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Automatic-updation-of-OpenLayers-code-tp6452157p6452157.html
 
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected] 
http://lists.osgeo.org/mailman/listinfo/openlayers-users


This email and any attachments are confidential and intended solely for the 
addressee(s). If you are not the intended recipient, please notify us 
immediately and then delete this email from your system.

This message has been scanned for Malware and Viruses by Websense Hosted 
Security.
www.websense.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to