[Mapserver-users] Q: Dynamic Legends

Eric Bridger eric at gomoos.org
Thu Jan 29 12:28:26 PST 2004


One option, which I've used quite a bit in Perl mapscript 3.6, but which
could be done using cgi is to set the CLASS NAME to the null string.
This prevents the class from being displayed in the legend.
Not sure of the syntax but something like:
/cgi-bin/mapserv?layer_0_class_0_name=&
might work.  

On Thu, 2004-01-29 at 14:18, Jean-Henry Berevoescu wrote:
> 
> Hi,
> I was afraid to get this kind of answer, but it seems that you are right
> (still hoping I miss something here and a quick way to fix this will
> somehow surface unexpectedly :-)
> 
> If I'll find something I will share with the list, of course :-)
> 
> Thanks,
> Jean
> 
> 
> 
> Liz Godwin wrote:
> 
> >I don't think actually that this is possible, at least not in the
> >current release.  
> >
> >The legend will show all classes that are capable of being drawn,
> >regardless of wether they are actually visible or not.  That is to say,
> >the opt_flags WILL allow you to specify to include layers/classes that
> >are within the scale (set min and max values) and if the layer is being
> >drawn (status IN/OFF/DEFAULT).
> >
> >I have seen postings in the past referring to this, and ways around it,
> >but they all involve some mapscript of some sort.
> >
> >If you do find an easy/rather quick way, be sure to share it with the
> >list.  I am sure there are many that would interested in finding a
> >solution, I know I am.
> >
> >Liz Godwin
> >
> >  
> >
> >>>>"Matt Doggett" <mdoggett at coas.oregonstate.edu> 01/29/04 11:29AM
> >>>>
> >>>>        
> >>>>
> >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
> 





More information about the MapServer-users mailing list