HTML Legend opt_flag=13 for Class block not working?

Daniel Morissette dmorissette at MAPGEARS.COM
Wed Jun 20 13:32:45 PDT 2007


Ei Fujioka wrote:
> 
> What I want to do is hide classes whose status is off.
> Based on the HTML legend reference 
> (http://mapserver.gis.umn.edu/docs/howto/html_legend), I set opt_flag=13 
> for [leg_class_html].
> However, all classes show up regardless of the status.
> How can I hide classes having status off?
> 

It seems that this flag only applies to the layer status, not the class 
status. Here is what the docs says, which was confirmed by reviewing the 
source:

"2: If set, show layer even if status is OFF (default: hide layers with 
STATUS OFF)."

There is currently no way to hide classes with status OFF. I am starting 
to wonder if this was intentional or if we just forgot to hide classes 
with status off by default in the initial implementation (with the 
option to set opt_flags|=2 to enable them).

> Another question related to this is that if I can do the same thing for 
> a traditional image legend.
> 

There is very little control on what is generated by the traditional 
image legend and none of the opt_flags stuff works there.

I just had a quick look at the image legend generation code and it also 
ignores the class status, so in this respect both legend types are 
consistent.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the MapServer-users mailing list