Hi, It seems you have to add a random number to the url. You take as url the same as you take for your gml layer.
yourLayer.setUrl("XML1/FeatureGML.xml?A="+counter++); Arnd -----Ursprüngliche Nachricht----- Von: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] Im Auftrag von sunny74 Gesendet: Montag, 7. September 2009 20:32 An: users@openlayers.org Betreff: Re: [OpenLayers-Users] Layer from GML loading only for the first time Hi, Thanks for your reply. I am afraid I have not understood the solution suggested by you. You are saying to use the setURL to change the url for a gml layer after layer creation. Does that mean the following code: map.addLayer(new OpenLayers.Layer.GML('choice_features', "XML1/FeatureGML.xml")) after the creation of the above layer I use the setURL as below: choice_features.setUrl("http://...."); Do i give just the Url for the GML file or do i need to add some random number to it at the end. Then how do I load the above Url. Regards. Arnd Wippermann wrote: > > Hi, > > So far I rembember, there is a function setUrl to change the url for a > gml layer after layer creation. And also you link to the same as > previous, the new data will displayed. > > So you don't need to add-remove-add your layer to display new data > from a GML vectorlayer. > > yourLayer.setUrl("http://...."); should do the trick. > > Arnd > > > > -----Ursprüngliche Nachricht----- > Von: users-boun...@openlayers.org > [mailto:users-boun...@openlayers.org] Im Auftrag von sunny74 > Gesendet: Montag, 7. September 2009 13:29 > An: users@openlayers.org > Betreff: Re: [OpenLayers-Users] Layer from GML loading only for the > first time > > > Hi, > > Thanks for your reply. > So how to do the following: > > 1) change the cache > settings on your webserver for the XML1 subdir (tell the browser to > never cache the file)? > > 2) append a random number to the url? > Pls tell in details. > > Regards. > > > Bart van den Eijnden (OSGIS)-2 wrote: >> >> Hi, >> >> you are probably running into browser cache. So either change the >> cache settings on your webserver for the XML1 subdir (tell the >> browser to never cache the file), or append a random number to the url. >> >> Best regards, >> Bart >> >>> >>> Dear Friends, >>> >>> I am having a query builder which allows an user to select one >>> feature at a time. >>> The geometry for this feature is then populated into a GML file >>> format using another xml. >>> So every time an user selects one feature the GML file is deleted >>> and a new one created with the geometry of the new feature. >>> >>> Although GML file is created with every change in selection >>> Openlayers is unable to load the changed GML and show it on the map. >>> >>> So openlayers is able to display the data from the GML for the first >>> time only. So from second and subsequent selection it shows only the >>> first feature on the map. >>> >>> The code is: >>> >>> map.addLayer(new OpenLayers.Layer.GML('choice_features', >>> "XML1/FeatureGML.xml")); >>> >>> Is it a bug? >>> If not how to tackle the problem. >>> >>> Thanks in advance. >>> -- >>> View this message in context: >>> http://n2.nabble.com/Layer-from-GML-loading-only-for-the-first-time- >>> t p3596382p3596382.html Sent from the OpenLayers Users mailing list >>> archive at Nabble.com. >>> _______________________________________________ >>> Users mailing list >>> Users@openlayers.org >>> http://openlayers.org/mailman/listinfo/users >>> >> >> >> _______________________________________________ >> Users mailing list >> Users@openlayers.org >> http://openlayers.org/mailman/listinfo/users >> >> > > -- > View this message in context: > http://n2.nabble.com/Layer-from-GML-loading-only-for-the-first-time-tp > 359638 > 2p3596762.html > Sent from the OpenLayers Users mailing list archive at Nabble.com. > _______________________________________________ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > > _______________________________________________ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > > -- View this message in context: http://n2.nabble.com/Layer-from-GML-loading-only-for-the-first-time-tp359638 2p3598816.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users