[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: [mapserver-users] HTML Legend with Status Checking...



Thank you, but this didn't change a thing. Actually, let me correct that...it had a negative effect because now all my layers show up too, even if they are not displayed in the map. I want only active layers to show in the legend and I want only IN-SCALE class symbols to show up in the legend, I don't want 4 symbols to show up in the legend for every layer that I have which has scale-specific classes...I just don't guess I can do that without converting everything over to Mapscript. X-(

Any other ideas?

Martin, Daniel wrote:

You probably want a bit mask of 2 in your opt_flag. Layers with STATUS off
still show, but layers out of scale don't show.
[leg_layer_html opt_flag=2]


Per http://mapserver.gis.umn.edu/doc36/html-legend-howto.html :

1: If set, show layer even if out of scale (default: hide layers out of
scale).
2: If set, show layer even if status is OFF (default: hide layers with
STATUS OFF).
4: If set, show layer even if type is QUERY (default: hide layers of TYPE
QUERY)
8: If set, show layer even if type is ANNOTATION (default: hide layers of
TYPE ANNOTATION)

In my experience, opt_flag=2 is the most intuitive.

-Dan



-----Original Message-----
From: Mike Smith [mailto:nospam@cnrit.tamu.edu]
Sent: Monday, September 30, 2002 5:06 PM
To: mapserver-users@lists.gis.umn.edu
Subject: [mapserver-users] HTML Legend with Status Checking...


Hello,

I've seen how you can make legends using PHP Mapscript that check to see whether a layer or class is in scale before displaying it in the legend, but no mention of how to do this if I'm not using Mapscript. I have sub-classed many of my layers so that symbols show up in different sizes depending on how far zoomed in you are. In other words, I'm using "MINSCALE" and "MAXSCALE" in my classes, but all of my classes show up in the legend and that's really annoying! I want ONLY the in-scale symbol to show up in the legend as it does in the map...any tips on how to do this without Mapscript? I see the "if" conditional statements in the HTML Legend How-to, but there's no status of "SCALE" to check with those statements... if I could put an if statement in my legend template that checked whether or not a class or layer was in scale, then I'd be in business...any way to do this?

Thanks!