Personal tools
You are here: Home Documentation References

10. Map

Document Actions
Up one level
A MAP object defines the master object of the mapfile. It defines application/map wide parameters.
ANGLE [double]

Angle, given in degrees, to rotate the map. Default is 0. The rendered map will rotate in a clockwise direction. The following are important notes:

  • Requires a PROJECTION object specified at the MAP level and for each LAYER object (even if all layers are in the same projection).
  • Requires MapScript (SWIG, PHPMapscript). Does not work with CGI mode.
  • If using the LABEL object's ANGLE or the LAYER object's LABELANGLEITEM parameters as well, these parameters are relative to the map's orientation (i.e. they are computed after the MAP object's ANGLE). For example, if you have specified an ANGLE for the map of 45, and then have a layer LABELANGLEITEM value of 45, the resulting label will not appear rotated (because the resulting map is rotated clockwise 45 degrees and the label is rotated counter-clockwise 45 degrees).
  • More information can be found on the MapRotation Wiki Page.
CONFIG [key] [value]

This can be used to define the location of your EPSG files for the PROJ.4 library. Setting the [key] to PROJ_LIB and the [value] to the location of your EPSG files will force PROJ.4 to use this value. Using CONFIG allows you to avoid setting environment variables to point to your PROJ_LIB directory. Here are some examples:

  1. Unix

    CONFIG "PROJ_LIB" "/usr/local/share/proj/"
    
  2. Windows

    CONFIG "PROJ_LIB" "C:/somedir/proj/nad/"
    

Any other value will be passed on to CPLSetConfigOption(). This provides customized control of some GDAL and OGR driver behaviours. Details on such options would be found in specific GDAL driver documentation.

DATAPATTERN [regular expression]
This defines a regular expression to be applied to requests to change DATA parameters via URL requests (i.e. map_layername_data=...). If a pattern doesn't exist then web users can't monkey with support files via URLs. This allows you to isolate one application from another if you desire, with the default operation being very conservative. See also TEMPLATEPATTERN.
DEBUG [off|on|0|1|2|3|4|5]

Enables debugging of all of the layers in the current map.

Debugging with MapServer versions >= 5.0:

Verbose output is generated and sent to the standard error output (STDERR) or the MapServer errorfile if one is set using the "MS_ERRORFILE" environment variable. You can set the environment variable by using the CONFIG parameter at the MAP level of the mapfile, such as:

CONFIG "MS_ERRORFILE" "/ms4w/tmp/ms_error.txt"

You can also set the environment variable in Apache by adding the following to your httpd.conf:

SetEnv MS_ERRORFILE "/ms4w/tmp/ms_error.txt"

Once the environment variable is set, the DEBUG mapfile parameter can be used to control the level of debugging output. Here is a description of the possible DEBUG values:

DEBUG O or OFF - only msSetError() calls are logged to MS_ERRORFILE. No
                 msDebug() output at all. This is the default and
                 corresponds to the original behavior of MS_ERRORFILE in
                 MapServer 4.x

DEBUG 1 or ON  - includes all output from DEBUG 0 plus msDebug() warnings
                 about common pitfalls, failed assertions or non-fatal
                 error situations (e.g. missing or invalid values for some
                 parameters, missing shapefiles in tileindex, timeout
                 error from remote WMS/WFS servers, etc.)

DEBUG 2        - includes all output from DEBUG 1 plus notices and timing
                 information useful for tuning mapfiles and applications

DEBUG 3        - all of DEBUG 2 plus some debug output useful in
                 troubleshooting problems such as WMS connection URLs
                 being called, database connection calls, etc.  This is 
                 the recommended level for debugging mapfiles.

DEBUG 4        - DEBUG 3 plus even more details...

DEBUG 5        - DEBUG 4 plus any msDebug() output that might be more
                 useful to the developers than to the users.

You can also set the debug level by using the "MS_DEBUGLEVEL" environment variable.

The DEBUG setting can also be specified for a layer, by setting the DEBUG parameter in the LAYER object.

For more details on this debugging mechanism, please see RFC 28.

Debugging with MapServer versions < 5:

Verbose output is generated and sent to the standard error output (STDERR) or the MapServer logfile if one is set using the LOG parameter in the WEB object. Apache users will see timing details for drawing in Apache's error_log file. Requires MapServer to be built with the DEBUG=MSDEBUG option (--with-debug configure option).

EXTENT [minx] [miny] [maxx] [maxy]
The spatial extent of the map to be created. In most cases you will need to specify this, although mapserver can sometimes (expensively) calculate one if it is not specified.
FONTSET [filename]
Filename of fontset file to use. Can be a path relative to the mapfile, or a full path.
IMAGECOLOR [r] [g] [b]
Color to initialize the map with (i.e. background color). When transparency is enabled (TRANSPARENT ON) for the typical case of 8-bit pseudocolored map generation, this color will be marked as transparent in the output file palette. Any other map components drawn in this color will also be transparenct, so for map generation with transparency it is best to use an otherwise unused color as the background color.
IMAGEQUALITY [int]
Deprecated Use FORMATOPTION "QUALITY=n" in the OUTPUTFORMAT declaration to specify compression quality for JPEG output.
IMAGETYPE [gif|png|jpeg|wbmp|gtiff|swf|userdefined]
Output format to generate. See details in the OUTPUTFORMAT section for available formats. The name here must match the 'NAME' of a user defined or internally generated OUTPUTFORMAT section.
INTERLACE [on|off]
Deprecated Use FORMATOPTION "INTERLACE=ON" in the OUTPUTFORMAT declaration to specify if the output images should be interlaced.
LAYER
Signals the start of a LAYER object.
LEGEND
Signals the start of a LEGEND object.
MAXSIZE [integer]
Sets the maximum size of the map image. This will override the default value. For example, setting this to 2048 means that you can have up to 2048 pixels in both dimensions (i.e. max of 2048x2048).
NAME [name]
Prefix attached to map, scalebar and legend GIF filenames created using this MapFile. It should be kept short.
PROJECTION
Signals the start of a PROJECTION object.
QUERYMAP
Signals the start of a QUERYMAP object.
REFERENCE
Signals the start of a REFERENCE MAP object.
RESOLUTION [int]
Sets the pixels per inch for output, only affects scale computations and nothing else, default is 72.
SCALEDENOM [double]
Computed scale of the map. Set most often by the application. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000. Implemented in MapServer 5.0, to replace the deprecated SCALE parameter.
SCALE [double] - deprecated
Since MapServer 5.0 the proper parameter to use is SCALEDENOM instead. The deprecated SCALE is the computed scale of the map. Set most often by the application. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.
SCALEBAR
Signals the start of a SCALEBAR object.
SHAPEPATH [filename]
Path to the directory holding the shapefiles or tiles. There can be further subdirectories under SHAPEPATH.
SIZE [x][y]
Size in pixels of the output image (i.e. the map).
STATUS [on|off]
Is the map active? Sometimes you may wish to turn this off to use only the reference map or scale bar.
SYMBOLSET [filename]
Filename of the symbolset to use. Can be a path relative to the mapfile, or a full path.
SYMBOL
Signals the start of a SYMBOL object.
TEMPLATEPATTERN [regular expression]
This defines a regular expression to be applied to requests to change TEMPLATE parameters via URL requests (i.e. map_layername_template=...). If a pattern doesn't exist then web users can't monkey with support files via URLs. This allows you to isolate one application from another if you desire, with the default operation being very conservative. See also DATAPATTERN.
TRANSPARENT [on|off]
Deprecated Use FORMATOPTION "TRANSPARENT=ON" in the OUTPUTFORMAT declaration to specify if the output images should be transparent.
UNITS [feet|inches|kilometers|meters|miles|dd]
Units of the map coordinates. Used for scalebar and scale computations.
WEB
Signals the start of a WEB object.
by Jeff McKenna last modified 2008-07-16 17:13

DEBUG can corrupt output...

Posted by John Cole at 2007-08-24 08:29
If you set DEBUG ON (or the newer DEBUG [0-5] and MS_ERRORFILE "stderr" in MS5) your output can get corrupted if your using mode=map or getting a WMS or WFS dataset and are on IIS.

According to Daniel Morissette, IIS often appends stderr to the return stream which can result in a corrupt image or an invalid XML file.

In MS4, you can turn DEBUG OFF (the default, I believe) or set MS_ERRORFILE to a file and not direct it to stderr.

SIZE is necessary for WMS DescribeLayer

Posted by Tommi Schneider at 2008-07-29 05:27
If SIZE is not set, the WMS request DescribeLayer gets an errormessage if you do not specify width and height (I think that is not logical, because with this request you only want some first informations about a layer).

Powered by Plone