Layer name in legend

Ei Fujioka efujioka at DUKE.EDU
Fri Feb 23 13:57:07 EST 2007


Bart, thank you very much for your instant reply.

Yes, you were the guy. (smile)

At a glance, it looks promising, though I need to dig into it to tweak 
for my program.

I have a mapfile with a lot of shapefiles in it, instead of WMS layers. 
So probably I will need to turn them off first, turn on a layer at a 
time, get the legend for that layer, append layer name and repeat this 
process through all the layers, gluing them together.

You saved my time!

Thanks a lot.

Ei


Bart van den Eijnden (OSGIS) wrote:
> Hi,
> 
> I think the guy you are referring to was me :-)
> 
> Check for an example here:
> 
> http://www.osgis.nl/download/Legend.html
> 
> 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,
> Bart
> 
> 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
>>
> 
> 

-- 
======================
   Ei Fujioka
   Research Associate
   Duke University

   (919) 613-8021
   efujioka at duke.edu
======================



More information about the mapserver-users mailing list