[Mapserver-users] MapScript, help starting?

Junkmail Box junkmail at deathkeep.com
Wed Feb 26 23:07:16 EST 2003


I'm having trouble getting started using Perl MapScript. The doc at
ttp://mapserver.gis.umn.edu/doc36/perlmapscript-reference.html doesn't
give a lot for examples of getting started. They do give this, though:

#!/usr/bin/perl
use mapscript;
my $map = new mapObj('arcata.map') or die('Unable to open mapfile.');
my $img = $map->draw() or die('Unable to draw map');
my $void = $img->saveImage('example.png', $mapscript::MS_PNG, $map->{transparent}, $map->{interlace}, 0);

However, when I run it, example.png is an empty file.

arcata.map is a map file, and works with the mapserv CGI binary just fine.
And $map->{numlayers} properly says there are 3 layers in the map. So I
know the map file is reasonably valid.

Any ideas on what the problem could be?
Are there any tutorials on getting started using MapScript?

Thanks a lot!





More information about the mapserver-users mailing list