Non-existant Legend Functionality?

Rob McCulley RMcCulley at COUNTY24.COM
Thu Sep 1 17:39:17 EDT 2005


This can be done using PHP, but it would be much better/faster if it were a feature in MapServer.

To perform this in PHP you would need to create a RectObj that corresponds with the current extent of the map, and then individually queryByRect each layer to see if any objects are within the current extent.  You would be able to reduce the number of querys by not running the query on layers that are not sparesly populated (like your parcels or roads etc.).

Cheers,
Rob

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Stephen Woodbridge
Sent: Thursday, September 01, 2005 3:20 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Non-existant Legend Functionality?


Abe,

I think this would be a very valuable extension and it would not be that 
hard to implement. All that you would need is a bit array that is zeroed 
before a draw request where each bit represents a unique layer-class, 
then as objects are drawn you would OR 1 into the bit array for the 
layer-class index if/when an object is drawn. Then you would need to be 
able to query the bit array for a given layer-class index to see if it 
was drawn.

-Steve W.

Abe Gillespie wrote:
> I build my legends by hand with PHP code because the native 
> functionality just isn't good enough for what I need.  Unfortunately I 
> still can't get it perfect because of what I think is missing MapServer 
> functionality.  Currently my legends are just too big for printing.  Is 
> there a way to tell whether a certain class is visible w/i the current 
> view?  Now I don't mean whether the class is within it's scale limits 
> (MIN or MAXSCALE).  Rather can one tell if a layer / class has any data 
> w/i the current view.  For instance, I may have a fire hydrant layer w/o 
> any scale dependencies.  But I might be zoomed into a field way out in 
> the country side.  So, yeah, technically the layer can be seen at that 
> scale, but no fire hydrants are actually in the view.
> 
> If this doesn't exist, shall I issue a feature request?
> 
> Thanks.
> -Abe



More information about the mapserver-users mailing list