[OpenLayers-Users] How to change WMS layer on the fly?

Mulone mulone at rome.com
Wed Sep 1 06:23:31 EDT 2010


Hi all,

I'm struggling with a peculiar set up: we have a WMS layer in OpenLayers
(within a GeoExt web interface) invoking a MapServer string (e.g.
http://mydomain/cgi-bin/mapserv.exe?map=someMapFile.map&etcetc).
Now we need to split the dataset into several layers.
We tried by instanciating n separate WMS layers and it's way too slow, so
we're trying a pretty simple solution: generating a custom mapFile
containing only the required layers. This dynamic mapfile is returned by a
service:
http://mydomain/myservice/get?layers=listoflayers,otherparams,etc that
returns the path to the custom mapfile. This solution is very simple and
efficient.
So now we should update the WMS layer in order to replace this mapfile on
the fly, without reloading the whole page.
So my questions are:
- Is this possible?
- Is it ok to have a separate layer list (not the default one offered by
OpenLayers) and trigger an event "changeLayers"? Are there any examples of
this setup?

Thanks in advance for any hints!
Mulone


-----
Mulone
PhD student
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-change-WMS-layer-on-the-fly-tp5486278p5486278.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list