views:

56

answers:

1

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

+1  A: 

You shouldn't need dynamic mapfiles for this. The GetMap request has a parameter LAYERS.

LAYERS=layer_list: Comma-separated list of one or more map layers. Optional if SLD parameter is present. (http://mapserver.org/ogc/wms_server.html)

Or are you doing anything else but selecting a subset of layers?

underdark