[Mapserver-users] perl mapscript - progress...

Junkmail Box junkmail at deathkeep.com
Mon Mar 3 19:09:25 EST 2003


Thanks for the help so far, especially Lowell. I can get perl-mapscript to
draw a map that's already defined in a .map file, which is good progress.
I wanted to look at the quakes demo to see what else I could learn, but
I'm having a devil of a time trying to figure anything out.

Here's an attempt to draw a point on a map, that doesn't work. The
underlying map draws A-OK, but the point isn't drawing.


my $map = new mapscript::mapObj("arcata.map") or die "Cannot open map file\n";
my $img = $map->prepareImage();
my $layer = new mapscript::layerObj($map); $layer->{'name'} = 'points';
$layer->{'type'} = $mapscript::MS_LAYER_POINT;

my $point = new mapscript::pointObj();
# are these supposed to be lon/lat? arcata is 124W and 41N
$point->{'x'} = -124; $point->{'y'} = 41;
$point->draw($map,$layer,$img,undef,'HERE');
$map->drawLabelCache($img);

$img->saveImage("example.png",$mapscript::MS_PNG,0,0,0);


I gather from the quakes example that the pointObj's x and y are supposed
to be lon/lat? The perl-mapscript doc doesn't specify.

Is there a tutorial on perl-mapscript, or is that reference the only
document?








More information about the mapserver-users mailing list