[Mapserver-users] Q: Dynamic Legends

Jean-Henry Berevoescu bjh at globexplorer.com
Thu Jan 29 19:29:56 EST 2004


This is actually the line I am trying to take right now, after
nothing else worked.

Thanks and best regards,
Jean


Matt Doggett wrote:

>It seems like you could just do some kind of spatial query on your
>"roads" (or land-use) layer based on the map extents. From the query
>determine which classes are present, then modify the class layers
>(dynamically w/ Perl/PHP mapscript of course) based on this information
>before rendering the legend.
>
>MD
>
>  
>
>>-----Original Message-----
>>From: mapserver-users-admin at lists.gis.umn.edu [mailto:mapserver-users-
>>admin at lists.gis.umn.edu] On Behalf Of Ed McNierney
>>Sent: Thursday, January 29, 2004 2:16 PM
>>To: Martin, Daniel A; Jean-Henry Berevoescu
>>Cc: mapserver-users at lists.gis.umn.edu
>>Subject: RE: [Mapserver-users] Q: Dynamic Legends
>>
>>Daniel -
>>
>>I don't think that's quite the scenario being described.  I have a
>>similar problem that is not soluble AFAIK with current MapServer
>>technology.
>>
>>I have a Land Use map that covers the state with polygons, each of
>>    
>>
>which
>  
>
>>is assigned one of 37 land use codes.  Any given map is unlikely to
>>display more than 3 or 4 different codes, but they all have a legend
>>with 37 entries in it, making the 3 that are actually ON the map hard
>>    
>>
>to
>  
>
>>find.
>>
>>It's not a matter of selecting features by spatial scale, but by
>>selecting legend symbology based on data that is actually in the
>>    
>>
>current
>  
>
>>view frame.
>>
>>	- Ed
>>
>>Ed McNierney
>>President and Chief Mapmaker
>>TopoZone.com / Maps a la carte, Inc.
>>73 Princeton Street, Suite 305
>>North Chelmsford, MA  01863
>>ed at topozone.com
>>(978) 251-4242
>>
>>-----Original Message-----
>>From: Martin, Daniel A [mailto:Daniel.A.Martin at erac.com]
>>Sent: Thursday, January 29, 2004 4:03 PM
>>To: Jean-Henry Berevoescu
>>Cc: mapserver-users at lists.gis.umn.edu
>>Subject: RE: [Mapserver-users] Q: Dynamic Legends
>>
>>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
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>      
>>>
>>_______________________________________________
>>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