[mapserver-users] Map size question?

Chris Green chris.green at ibstv.co.uk
Mon Aug 22 09:15:32 EDT 2011


Hi David

 

That was very good advice. Thanks!

 

 

Regards,

 

 

 

Chris

 

From: Fawcett, David (MPCA) [mailto:david.fawcett at state.mn.us] 
Sent: 18 August 2011 18:38
To: Chris Green; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] Map size question?

 

Chris,

 

If you are in tile mode, I assume that you probably don't want an embedded
legend on each tile.  

 

Have you thought about doing a separate call/request/object for the legend?


 

If you were doing this via CGI, I would recommend doing a separate
mode=legend request.

 

David.

 

From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Chris Green
Sent: Thursday, August 18, 2011 12:04 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Map size question?

 

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/20110822/579e9c31/attachment.html


More information about the mapserver-users mailing list