[Mapserver-users] Q: Dynamic Legends

Martin, Daniel A Daniel.A.Martin at erac.com
Thu Jan 29 13:02:57 PST 2004


I do exactly the same thing.  The way I do it, I have two layers
pointing at the same data.  One has only the highway class, and the
other has all street types.  But, here's the trick.  Name both layers
the SAME exact name.  Now, have the range set where the minscale of the
highway layer is the maxscale of the detailed street layer.

As the user zooms in and out, MapServer will naturally transition from
highways to detailed streets.  However, the legend will show exactly
what you are asking for.  And, by naming both layers the same name, the
status (on/off) will carry over as the user zooms.  If the highway layer
was on, the street layer will also be on when the user zooms in.

I know it may sound strange, but I promise it works beautifully.

-Dan

> -----Original Message-----
> From: Jean-Henry Berevoescu [mailto:bjh at globexplorer.com] 
> Sent: Thursday, January 29, 2004 2:51 PM
> To: Martin, Daniel A
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] Q: Dynamic Legends
> 
> 
> 
> No. I have, for example, one of the layers with a number of classes 
> (say, streets, with
> each type of street having its own class). In a certain area, at a 
> certain scale, one could
> get, for example, only highways. What I want is to have the legend 
> showing only the
> symbols/definitions for what is actually in the map at a 
> certain moment.
> 
> Jean
> 
> 
> Martin, Daniel A wrote:
> 
> >Do you mean layers that are on, and within range, but are 
> not visible 
> >because of your current location?  I don't believe that is possible. 
> >However, the default is to hide layers that are not visible 
> or have a 
> >status of OFF.  However, if you have layers that have a status of 
> >DEFAULT, then those are going to show no matter what.
> >
> >Am I misunderstanding you?
> >
> >-Dan
> >
> >  
> >
> >>-----Original Message-----
> >>From: mapserver-users-admin at lists.gis.umn.edu
> >>[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of 
> >>Jean-Henry Berevoescu
> >>Sent: Thursday, January 29, 2004 1:16 PM
> >>To: mdoggett at coas.oregonstate.edu
> >>Cc: mapserver-users at lists.gis.umn.edu
> >>Subject: Re: [Mapserver-users] Q: Dynamic Legends
> >>
> >>
> >>
> >>I tried that one and all the possible combinations (and their
> >>sum). Nothing works.
> >>
> >>Thanks,
> >>Jean
> >>
> >>
> >>Matt Doggett wrote:
> >>
> >>    
> >>
> >>>I believe HTML legends will do the trick. In the
> >>>      
> >>>
> >>legend_template.html
> >>    
> >>
> >>>file you could specify [leg_class_html opt_flag=12] for 
> example. see
> >>>the HTML legend How-To for more details about the opt_flag 
> bit mask.
> >>>
> >>>http://mapserver.gis.umn.edu/doc40/html-legend-howto.html
> >>>
> >>>MD
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: mapserver-users-admin at lists.gis.umn.edu
> >>>>        
> >>>>
> >[mailto:mapserver-users-
> >  
> >
> >>>admin at lists.gis.umn.edu] On Behalf Of Jean-Henry Berevoescu
> >>>Sent: Wednesday, January 28, 2004 8:12 PM
> >>>To: mapserver-users at lists.gis.umn.edu
> >>>Subject: [Mapserver-users] Q: Dynamic Legends
> >>>
> >>>
> >>>Hi,
> >>>Is there a way to have the legend dynamically show only 
> the classes 
> >>>of
> >>>   
> >>>
> >>>      
> >>>
> >>a
> >> 
> >>
> >>    
> >>
> >>>layer actually
> >>>shown in a map (not the whole defined set in the mapfile)?
> >>>
> >>>Jean
> >>>
> >>>_______________________________________________
> >>>Mapserver-users mailing list Mapserver-users at lists.gis.umn.edu 
> >>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >>>   
> >>>
> >>>      
> >>>
> >> 
> >>
> >>    
> >>
> >
> >_______________________________________________
> >Mapserver-users mailing list
> >Mapserver-users at lists.gis.umn.edu
> >http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
> >  
> >
> 
> 




More information about the MapServer-users mailing list