Layer name in legend

Bart van den Eijnden (OSGIS) bartvde at OSGIS.NL
Fri Feb 23 13:17:43 EST 2007


I think the guy you are referring to was me :-)

Check for an example here:

make sure you use view source of your browser to see the actual php code.

Look especially at the part starting with:

$sTitle = getTitle($oLayer);

Best regards,

Ei Fujioka schreef:
> Hello Mapserver experts,
> I'm new to this mailing list.
> I'm wondering if there is a way to include layer names, in addition to
class symbols, in the legend.
> I searched the archives and found a thread regarding this (Dec 21, 2006).
> It seems there is no out-of-the-box solution and the guy mentioned he
created a PHP/Mapscript script to do this.
> Would someone be able to show me a sample script?
> I'm using Mapserver 4.2 with PHP/Mapscript.
> I would like to produce a legend with codes like:
> // $omap is a map object.
> $image = $omap->drawLegend();
> $image_url=$image->saveWebImage();
> // The resulting image includes class symbols/names only.
> Thank you very much.
> Ei

Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at

More information about the mapserver-users mailing list