[mapserver-users] TIP: Dynamic Legend (I did it!)

Paul Spencer spencer at dmsolutions.ca
Wed Sep 11 18:51:31 EDT 2002


Chip, have you thought about what happens when layers turn on and off 
due to scales of visibility?  A pretty common problem we are seeing is 
that people set certain layers to appear as the user zooms in, but if 
the layer doesn't appear in the $_POST data then it is turned off.  I 
don't think that the code you wrote handles this case.  If you come up 
with an easy solution to this, please let me know and I'll put it in the 
next release of MapLab :)

Cheers,

Paul

Hankley, Chip wrote:
> OK... I figured out how to do this... and put the code in the Wiki at the
> following location:
> 
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPDynLegend
> 
> (There is a link under the Examples section of PHP MapScript)
> 
> Basically what it does is reads a mapfile, and creates a legend / layer
> control on the fly. Furthermore, it sets up the controls so that state is
> maintained with only a couple of lines of code... and any changes to the
> mapfile (i.e. additional layers, changes to layers) are automatically
> reflected in the application (i.e. there's no need to make changes to the
> PHP part of the application).
> 
> Hope this is useful to someone!
> 
> Chip Hankley
> 


-- 
Paul Spencer
Applications and Software Development
DM Solutions Group




More information about the mapserver-users mailing list