[Mapserver-users] How to make a legend

Lowell Filak lfilak at medinaco.org
Mon Jan 27 12:30:59 EST 2003


I'm not sure if this is exactly what your looking for but to generate the simplest legend you just need to adjust the settings for the legend of an existing mapObj, create the temporary file name, and save the image.
Example:
$map->{legend}->{label}->{color} = $map->addColor(0, 0, 89);
$map->{legend}->{label}->{size} = $mapscript::MS_MEDIUM;
$map->{legend}->{width} = 18;
$map->{legend}->{height} = 12;
($sec,$min,$hr,$mdy,$mnth,$yr,$wdy,$ydy,$isdst) = localtime;
$spid = $$;
$img = $map->drawLegend();
$img->saveImage("<temp_directory>/keys/$hr$min$sec$spid.png",$mapscript::MS_PNG,$map->{transparent},$map->{interlace},0);
HTH
Lowell F.

The following message was sent by pia rose trias <pia_rose.trias at up.edu.ph> on Mon, 27 Jan 2003 19:09:30 +0800.

>   
> hi! i am a new to webserver. I have already made my maps using mapscript,could 
> someone help me about making legends. How can I make legends using mapscript. 
> I also want to know how can I make a legend tempfile. 
> _______________________________________________
> 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