How to create a legend containing ONLY classes shown in current map?

Ken Lord kenlord at GMAIL.COM
Tue Nov 23 15:30:36 PST 2004


MapServer CGI will not hide individual classes based on map scale in
the way that you are hoping to do.

The way I have attacked this is to place the scale range at which the
class is visible within the name of the class, so that the name of the
class and its viewable scale range is listed in the legend.

hypothetical example of names given to classes in a layer that
displays highways/roads/trails at different scales:

Highway < 1:50,000
Local Roads < 1:20,000
Trails < 1:5,000

Cheers,
Ken Lord
Vancouver BC


On Tue, 23 Nov 2004 11:08:24 -0600, Daniele Margotti
<margottid at comune.lugo.ra.it> wrote:
> Hi,
> I have another question about the legend...
>
> How can I tell CGI Mapserver to create a legend containing ONLY classes
> that are visible in the current map?
>
> Now I get a legend that contains ALL classes of the selected layer, even
> if I have zoomed to a very close scale (and I view only one class in the
> map).
>
> Can you help me?
> Is it possible?
>
> Thank you,
>  Daniele
>



More information about the MapServer-users mailing list