Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1245 closed defect (invalid)

[layer_status] semantics

Reported by: pierrick.brihaye@… Owned by: sdlime
Priority: high Milestone:
Component: Documentation - MapServer Version: 4.0
Severity: normal Keywords:
Cc:

Description

Hi,

Given the following definition (from
http://mapserver.gis.umn.edu/doc44/html-legend-howto.html) :

[if name=layer_status value=...] ... [/if]
(value is the layer's status in integer format: 0=OFF, 1=ON, 2=DEFAULT)

Given the following snippet from my legend template :

<input type=checkbox name=layer value=[leg_layer_name]
                       [if name=layer_status value=2]CHECKED[/if]>

When I call mapserver with just a "map" parameter (i.e. without any
"layer" parameter), I would expect that the layers which are labelled
with "STATUS ON" in the mapfile were checked in the legend and visible on the
map... and vice-versa.

This is not the case. Am I missing something or is my Mapserver version :

<!-- MapServer version 4.4.0-beta3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG -->

... just too old ?

Change History (3)

comment:1 by sdlime, 19 years ago

Resolution: invalid
Status: newclosed
I'm assuming you're using the MapServer CGI program. If so, the behavior you 
describe means MapServer is working correctly. The CGI version turns all non-
DEFAULT layers off and then you must explicitly turn them on using the layer 
or layers CGI variables.

Steve

comment:2 by pierrick.brihaye@…, 19 years ago

Component: MapServer CGIMapServer Documentation
OK, So I've missed something :-)

Where is this behaviour documented ? I can only see :

The name of a layer as it appears in the map file. Sending mapserv a layer name
sets that layer's STATUS to ON

... in the CGI reference.

What are the rationale behing this choice ?

Cheers,

comment:3 by sdlime, 19 years ago

The rationale: it's simply easier (and more robust) this way. You don't have to 
store state for a layer since you know it's off by default (and you don't have 
to care about DEFAULT layers). It's much easier to build predictable interfaces 
this way. Once folks get the idea they like it.

Docs: I just looked at the CGI guide and, um, there seems to be no mention of 
it so I can see why you missed it. I've emailed the document maintainer to 
suggest more elaboration.

Steve
Note: See TracTickets for help on using tickets.