[Mapserver-users] scale bar

Nick Petersen-Bergeron bergeron at zedxinc.com
Thu Nov 13 16:34:21 EST 2003


Hi,

I'm drawing to draw a scale bar as a seperate image, but the draw command 
doesn't seem to be working the way I expect it to.

Here's my code:

my $map = new mapscript40::mapObj("/home/httpd/html/flash/mang.map") or 
die("Unable to open mapfile. $!");
$map->{scalebar}->{status} = $mapscript40::MS_ON;

$scaleImg = $map->drawScalebar();
$map->drawLabelCache($scaleImg);
my $scaleImagename = "/home/httpd/html/dy_images/".$t."_scale.jpg";
$scaleImg->save($scaleImagename);


And here's the scalebar declaration in my map file

SCALEBAR
         INTERVALS 7
         STATUS OFF
         TRANSPARENT TRUE
         POSITION lc
         STYLE 1
         SIZE 300 5
         BACKGROUNDCOLOR -1 -1 -1
         POSTLABELCACHE FALSE
         OUTLINECOLOR -1 -1 -1
         #OUTLINECOLOR 255 255 255
         COLOR 0 0 0
         LABEL
              COLOR 0 0 0
              BACKGROUNDCOLOR -1 -1 -1
              OUTLINECOLOR 255 255 255
              SIZE tiny
         END
END

Now, the image object is being created, but the actual save command doesn't 
seem to be actually saving the image to disk.  Any ideas?



Nick Petersen-Bergeron
Developer

ZedX Inc.
369 Rolling Ridge Drive
Bellefonte, PA. 16823




More information about the mapserver-users mailing list