[Chameleon] Selectively displaying layers in a legend

Paul Spencer pspencer at dmsolutions.ca
Thu Oct 21 21:49:13 EDT 2004


Jennifer,

your best bet would be to create metadata in your MAP file on the layers 
that you want to appear in the legend, then add an [if] block to the 
legend template.  For instance, for each layer you want to show in the 
legend, add:

METADATA
   "show_in_legend" "1"
END

for clarity, you could add "show_in_legend" "0" to the layers you want 
to hide, but that would be superfluous.

In the legend template, you would put

[if name="show_in_legend" oper=eq value="1"]

... existing legend template stuff ...

[/if]

There is extensive documentation on the mapserver site 
(mapserver.gis.umn.edu) covering legend templates, I suggest that you 
look there for future information.  Also, the mapserver-users mailing 
list is perhaps a better place for questions like this.

Cheers,

Paul

Jennifer Zeisloft wrote:
> Hello All...
> 
> I am extremely new to MapServer, Chameleon, etc. (and web technology,
> for that matter), and I am wondering how I might show certain layers
> and not others in a legend.  I am working off of the sample_enhanced
> files in the Chameleon sample applications.  This uses the legend
> template widget, but if something else would work better for
> selectively showing layers, I'd be more than willing to attempt using
> another widget.
> 
> I am not all that familiar with the various code languages and I
> haven't a clue which file would be the best to alter.  Any help would
> be VERY much appreciated!  Thanks in advance.
> 
> Jennifer Zeisloft
> (UW-Madison, Sea Grant)
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 


More information about the Chameleon mailing list