[Qgis-developer] QgisServer: enabled layers from project not taken

Radim Blazek radim.blazek at gmail.com
Wed Oct 19 10:23:46 EDT 2011


On Wed, Oct 19, 2011 at 12:57 PM, Andreas Neumann <a.neumann at carto.net> wrote:
>> I noticed that QgisServer doen't take enabled layers from project file, but
>> the user should enable them in the web client.
>
> yes - it is on our todo-list. The idea would be to expose the
> information of layer visibility in the GetCapabilities response - but
> the hard thing is to do this in a way that is conformant with the WMS
> standard - it probably means to introduce another vendor-specific
> extension. Any ideas how to solve it?

I believe that GetCapabilities should only be used to describe what
layers are available on each server. For the definition of layers
which should be displayed in a client was defined ViewContext (Web Map
Context), from specification:

"There are several possible uses for Context documents:
- The Context document can provide default startup views for
particular classes of user. Such a document would have a long lifetime
and public accessibility.
- The Context document can save the state of a viewer client as the
user navigates and modifies map layers.
- The Context document can store not only the current settings but
also additional information about each layer (e.g., available styles,
formats, SRS, etc.) to avoid having to query the map server again once
the user has selected a layer.
- The Context document could be saved from one client session and
transferred to a different client application to start up with the
same context."

Each layer in ViewContext has 'hidden' attribute:

"6.4.1 Layer
Layers attributes are
- hidden : contains true if the layer should be hidden in the client
result map (required)"

BTW, this would be also probably the right way to give external URLs
for WMS layers to the client.

I am not big fan of standards and XML, but in this case it should be
probably at least considered. Sooner or later you reach a limit in
ViewContext.

Radim


More information about the Qgis-developer mailing list