Changes between Initial Version and Version 1 of Usage


Ignore:
Timestamp:
Jan 29, 2009, 9:52:06 AM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Usage

    v1 v1  
     1= Usage =
     2
     3Here is a simple perl example that loads a mapfile,
     4creates an image and saves it:
     5{{{
     6#!perl
     7#!/usr/bin/perl -w
     8use mapscript;
     9#
     10# Include XBase for access to XBase/DBF files.
     11use XBase;
     12#
     13# Include DBI so XBase files can be queried in an SQL manner.
     14use DBI;
     15#
     16# Start the map.
     17my $map = new mapscript::mapObj('boundary.map') or die('Unable to open mapfile.');
     18#
     19# Render the map.
     20my $img = $map->draw() or die('Unable to draw map');
     21#
     22# Save the rendered image.
     23my $void = $img->saveImage('example.png', $mapscript::MS_PNG, $map->{transparent}, $map->{interlace}, 0);
     24}}}