[OpenLayers-Users] Automatic updation of OpenLayers code

Robert Sanson Robert.Sanson at asurequality.com
Tue Jun 7 22:46:06 EDT 2011


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 <vikashtalanki at gmail.com> 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
Users at lists.osgeo.org 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110608/38981e5b/attachment.html


More information about the Users mailing list