PHP/MapScript - Reference

Aaron Racicot aaronr at ECOTRUST.ORG
Mon May 16 16:51:52 EDT 2005


Bernardo,

You need a reference map definition in your mapfile that points to the reference image.  This can be done statically in your mapfile or you need to create one in php-mapscript as a referenceMapObj embedded in the mapObj.  Here is an example of a definition in a mapfile:

  #
  # Start of reference map
  #
  REFERENCE
    IMAGE "/var/www/html/apps/siuslaw_epa/data/ref/blue_marble_us_200_150.gif"
    EXTENT -170 10 -64 90
    SIZE 200 150
    STATUS OFF
    MINBOXSIZE 1
    MAXBOXSIZE 200
    COLOR -1 -1 -1
    OUTLINECOLOR 255 255 255
    MARKERSIZE 10
    MARKER 'star'
  END

In this example I then do the following in php-mapscript:

  $img_ref = $oMap->drawReferenceMap();
  $url_ref = $img_ref->saveWebImage();

Hope this helps... and try reading up on the php-mapscript class reference:

http://mapserver.gis.umn.edu/doc44/phpmapscript-class-guide.html 

Aaron


+----------------------------------------+
| Aaron Racicot  | aaronr at ecotrust.org   |
| GIS Programmer | 503.467.0759          |
+----------------------------------------+
| e c o t r u s t                        |
| Jean Vollum Natural Capital Center     |
| 721 NW Ninth Avenue                    |
| Suite 200                              |
| Portland, OR 97209                     |
| www.ecotrust.org                       |
+----------------------------------------+


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Bernardo Rocha
Sent: Monday, May 16, 2005 9:23 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] PHP/MapScript - Reference

Someone could help me drawing a reference map? 

I simple tried it:

$ref = $map->drawReferenceMap();
$image = $ref->saveWebImage(MS_PNG,1,1,0);

and it doesn´t works! What shoul I do? Any examples?

Thanks!

Bernardo M. Rocha
PLANGEO - Planejamento e Geotecnologia Ltda.



More information about the mapserver-users mailing list