Semantics of [layer_status]

Bart van den Eijnden bartvde at XS4ALL.NL
Tue Feb 15 09:21:07 EST 2005


Hi,

value 2 is status DEFAULT so only that one will be checked in the legend.

If you also want status ON to be checked you should use a double [if]:

[if name=layer_status value=2]CHECKED[/if]
[if name=layer_status value=1]CHECKED[/if]

But then again, status DEFAULT layers cannot be changed by the user so
maybe you should add DISABLED in that case?

[if name=layer_status value=2]CHECKED DISABLED[/if]
[if name=layer_status value=1]CHECKED[/if]

Hope this helps.

Best regards,
Bart

> 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 thus
> 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 ?
>
> Cheers,
>
> --
> Pierrick Brihaye, informaticien
> Service régional de l'Inventaire
> DRAC Bretagne
> mailto:pierrick.brihaye at culture.gouv.fr
> +33 (0)2 99 29 67 78
>



More information about the mapserver-users mailing list