Re: [OpenLayers-Users] dynamic WMS add/remove problem

2009-06-16 Thread Andreas Hocevar
Balázs Bámer wrote: > Hi Andreas, > >> no need to remove, destroy and re-add the layer. If your WMS URL stays >> the same, all you need to do is > > I need to do this because the URL changes. Here the * value > changes, the 'shapefile.map' part changes when someone wants to upload > a new sha

Re: [OpenLayers-Users] dynamic WMS add/remove problem

2009-06-16 Thread Andreas Hocevar
Hi, no need to remove, destroy and re-add the layer. If your WMS URL stays the same, all you need to do is var layer=window.parent.map.getLayer("shapefile"); if(layer !== null) { layer.redraw(true); } This will force WMS images to be re-fetched, by adding a unique url parameter to the reques

[OpenLayers-Users] dynamic WMS add/remove problem

2009-06-15 Thread Balázs Bámer
Hi All, I try to create a page where the user can upload a shapefile (dbf shp shx in a zip file) and its contents are added to the existing display of WMSes. This works fine. However, my goal is to allow only one uploaded shapefile to be displayed, so when the user uploads a new one, the old shoul