| 1 | = Usage = |
| 2 | == Optional New API Syntax== |
| 3 | Available by re-swigging(sp?) with NEXT_GENERATION_API swig -perl5 -shadow -DNEXT_GENERATION_API mapscript.i |
| 4 | |
| 5 | == Optional New Naming Convention == |
| 6 | Available by re-swigging(sp?) with NEXT_GENERATION_NAMES swig -perl5 -shadow -DNEXT_GENERATION_NAMES mapscript.i |
| 7 | |
| 8 | == Example == |
| 9 | Here is a simple perl example that loads a mapfile, creates an image and saves it: |
| 10 | {{{ |
| 11 | #!perl |
| 12 | #!/usr/bin/perl -w |
| 13 | use mapscript; |
| 14 | # |
| 15 | # Include XBase for access to XBase/DBF files. |
| 16 | use XBase; |
| 17 | # |
| 18 | # Include DBI so XBase files can be queried in an SQL manner. |
| 19 | use DBI; |
| 20 | # |
| 21 | # Start the map. |
| 22 | my $map = new mapscript::mapObj('boundary.map') or die('Unable to open mapfile.'); |
| 23 | # |
| 24 | # Render the map. |
| 25 | my $img = $map->draw() or die('Unable to draw map'); |
| 26 | # |
| 27 | # Save the rendered image. |
| 28 | my $void = $img->save('example.png'); |
| 29 | }}} |
| 30 | ---- |
| 31 | back to PerlMapScript |