[Mapserver-users] Q: Dynamic Legends

Martin, Daniel A Daniel.A.Martin at erac.com
Thu Jan 29 16:51:28 EST 2004


I'm pretty sure MapServer does not support that.  Currently legends only
check "Is this class/layer within range?".

I think (though I am not a dev) that the legend gets created without
even knowing the output on the map.  It simply checks the map file, and
knows immediately what layers are in range using the minscale/maxscale
settings, and knows what the status of the layers are.  You can request
a legend from mapserver without ever requesting a map.

-Dan

> -----Original Message-----
> From: Jean-Henry Berevoescu [mailto:bjh at globexplorer.com] 
> Sent: Thursday, January 29, 2004 3:34 PM
> To: Martin, Daniel A
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] Q: Dynamic Legends
> 
> 
> 
> Yes and no. Actually in your scenario I still will have some unsolved 
> issues.
> For example: let's say that at a certain scale, all the 
> layers are to be 
> shown
> so I can have Drives, Places, Streets, Roads, Highways and so 
> on - but on the actual map in the actual area it happens to 
> be a wasteland with only a Road in it. In this case what one 
> would expect from a classical map would be to only see that 
> symbol - the symbol of the Road type of streets. See 
> what I mean?
> Maybe the Streets example is not the best for the problem we 
> have here. Say, a vegetation zones map. One can have, say, 25 
> types of vegetation. 
> At a certain
> point and at a certain scale, on the map will only be 3 
> types. No matter how one will play with layering, this is not 
> exactly a scale-related 
> problem, but
> data-related problem. "Does the map shows now forest and 
> grassland now? Then the legend should not present all the 
> possible vegetation types".
> 
> Thanks for your answer,
> Jean
> 
> 
> Martin, Daniel A wrote:
> 
> >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