[mapserver-users] Map size question?
Chris Green
chris.green at ibstv.co.uk
Thu Aug 18 10:04:16 PDT 2011
After quite a while thinking I could not produce a legend I have realised
that the legend is actually there, just off the edge of my map.
Now I see that although my map file specifies a map size of 640 x 480
pixels, if in single tile mode the map image being produced is actually
1110 x 660 pixels. Alternatively with multiple tiles I get 12 tiles of 250 x
250 pixels which is 1024 x 768 pixels.
It seems that the size parameter in the map file is being ignored (even
setting the values to 0 0 or omitting the SIZE parameter altogether makes no
difference). MAXSIZE doesn't seem to help either.
I can't find a way to get the image size that I want, can anyone help?
Chris
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Chris Green
Sent: 18 August 2011 08:02
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] mapsript legend
Hi all
I have a map created via Mapscript under Mapserver 6.0 but I can't find a
way to add a legend. Recent examples are hard to find but I found the
following dating from 2002 which seemed simple enough:
$legend = $map->legend;
$legend->set(width,40);
$legend->set(height,100);
$legend->imagecolor->setRGB(240,220,200); # tan
$legend->outlinecolor->setRGB(1,1,1); # black
$legend->set(status, MS_EMBED);
$legend->set(position, MS_UL);
// SET LEGEND LABEL PROPERTIES
$lg_label = $legend->label;
$lg_label->set(font, "arial");
$lg_label->set(type, MS_TRUETYPE);
$lg_label->set(size, 10);
$lg_label->set(minsize, 6);
$lg_label->set(maxsize, 12);
$lg_label->color->setRGB(100,100,100);
$legend->set(postlabelcache, MS_TRUE);
// DRAW LEGEND
$legendImage=$map->drawLegend();
Unfortunately this produces no output. Can anyone give me any clues why?
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110818/34d68651/attachment.htm>
More information about the MapServer-users
mailing list