Map
Files
Map Object
Label Object
Defines how specific object, layer, scalebar or
legend is labeled. Starts with the keyword label and terminates
with the keyword end. Note that scalebars only support bitmapped
fonts.
Layer Object
Defines how an individual layer is handled. Starts
with the keyword
layer and terminates with the keyword end.
Layers are the basic tool for putting a map together. The order in the
map file is significant. The layers are drawn in the order they are defined
and are queried in reverse order. Labels are entered into the label cache
in the order the layers are processed as well. Most important annotation
should be listed first in the map file to ensure it is drawn if labeloverlap
is false.
Class Object
Used to define thematic classes for a given layer
and each (vector) layer must have at least one class. In cases with more
than one class, membership is determined using attribute values and regular
expressions. Starts with the keyword class and terminates with the
keyword end.
Feature Object
Used to define inline features. You can use inline
features when it's not possible (or too much trouble) to create a shapefile.
Inline features can also be built via urls or forms. Starts with the keyword
feature
and terminates with the keyword end.
points:
class [string]: String to use to classify
this feature. In cases where a layer has multiple classes defined the class
string is evaluated against the class expressions. This is effectively
the same as pulling data from an attribute in a shapefile (see classitem
in the class object).
text [string]: String to use for labeling
this feature.
Legend Object
Defines how a legend is to be built. Legned components
are built automatically from class object definitions
from individual layers. Starts with the keyword legend and terminates
with the keyword end. The size of the legend image is not
known prior to creation so be carefull not to hardcode width and height
in the img tag in the template file. Future versions will make the image
size available. Multiline labels are supported (see label
object), but do not render correctly in the current version.
embed [true|false]: Is the legend image to
be embeded. Default is false.
imagecolor [r] [g] [b]:
Color to initialize the legend with (i.e. background).
label: Signals the start of a label
object.
outlinecolor [r] [g] [b]: Color to use for
outlining symbol key boxes.
position [ul|uc|ur|ll|lc|lr]: Where to place
an embeded legend in the image. Default is lr.
size [x][y]: Size of symbol key boxes in pixels.
Default is 20 by 10.
spacing [x][y]: Spacing between symbol key
boxes (y) and labels (x) in pixels. Default is 5 by 5.
status [on|off]: Is the legend image to be
created. Default is off.
Query Object
Defines how a specific query is handled. Starts
with the keyword query and terminates with the keyword end.
expression [string]: Regular expression that
defines membership in this query.
join: Signals the start of a join
object.
template [filename|url]: Template
file or url to use in presenting the results to the user.
QueryMap
Object
Defines a mechanism to map the results of a query.
Starts with the keyword
querymap and terminates with the keyword
end.
Join Object
Defines how a specific join is handled. Starts
with the keyword join and terminates with the keyword end.
Joins are defined within a query object.
from [item]: Join item in the shapefile.
name [string]: Unique name for this join.
Required value.
table [file]: Name of XBase file (must be
fullpath) to join to.
template [filename]: Template to use with
one-to-many joins. The template is processed once for each record and can
only contain substitutions for items in the joined table.
to [item]: Join item in the table to be joined.
type [multiple|single]: The type of join.
Default is single (i.e. one-to-one).
Reference
Map Object
Defines how reference maps are to be created.
Starts with the keyword
reference and terminates with the keyword
end.
Three types of reference maps are supported. The most common would be one
showing the extent of an map in an interactive interface. It is also possible
to request reference maps as part of a query. Point queries will generate
an image with a marker (see below) placed at the query point. Region based
queries will depict the extent of the area of interest. Finally, feature
based queries will display the selection feature(s) used.
color [r][g][b]: Color that the reference
box is drawn in. Set any component to -1 for no fill.
extent [minx] [miny] [maxx] [maxy]: The spatial
extent of the base reference image.
image [filename]: Full filename of the base
reference image. Must be a GIF image.
outlinecolor [r][g][b]: Color to use for outlining
the reference box. Set any component to -1 for no outline.
size [cols] [rows]: Size, in pixels, of the
base reference image.
status [on|off]: Is the reference map to be
created. Default is off.
Scalebar
Object
Defines how a scalebar should be built. Starts
with the keyword scalebar and terminates with the keyword end.
Scalebars currently do not make use of TrueType fonts. The size of the
scalebar image is not known prior to creation so be carefull not
to hardcode width and height in the img tag in the template file. Future
versions will make the image size available.
backgroundcolor [r] [g] [b]: Color to use
for scalebar backgound, not the image background.
color [r] [g] [b]: Color to use for drawing
all features if attribute tables are not used.
embed [true|false]: Is the scalebar image
to be embeded. Default is false.
imagecolor [r] [g] [b]: Color to initialize
the scalebar with (i.e. background).
intervals [integer]: Number of intervals to
break the scalebar into. Default is 4.
label: Signals the start of a label
object.
outlinecolor [r] [g] [b]: Color to use for
outlining individual intervals. Set any component to -1 for none which
is the default.
position [ul|uc|ur|ll|lc|lr]: Where to place
an embeded scalebar in the image. Default is lr.
size [cols] [rows]: Size, in pixels, of the
scalebar. X secifies the rough width of the scalebar itself, so actual
width may vary a bit. Y specifies the thickness of the bar itself. Neither
takes into account labeling.
status [on|off]: Is the scalebar image to
be created? Default is off.
style [integer]: Chooses the scalebar style.
Valid styles are 0 and 1.
units [feet|inches|kilometers|meters|miles]:
Output scalebar units, default is miles. Used in conjunction with the map's
units to develop the actual graphic. Note that decimal degrees are not
valid scalebar units.
Web Object
Defines how a web interface will operate. Starts
with the keyword web and terminates with the keyword end.
footer [filename]: Template to use after
anything else is sent. Multiresult query modes only.
header [filename]: Template to use before
after everything else has been sent. This option is only available with
queries.
imagepath [path]: Path to the temporary directory
for writing temporary files and images. Must be writable by the user the
web server is running as. Must end with a / or \ depending on platform.
Previously set in the mapserv.ini file.
imageurl [path]: Base URL for imgpath. Not
really needed as you can address this easily in a template. Must end with
a /. Previously set in the mapserv.ini file.
log [filename]: File to log MapServer activity
in. Must be writable by the user the web server is running as. Previously
set in the mapserv.ini file.
maxscale [double]: Maximum scale at which
this interface is valid. When a user requests a map at a smaller scale
a generic MapServer error is returned. The maxtemplate could be used to
provide a more user-friendly message.
maxtemplate [filename|url]: Template
file or url to use in presenting the results to the user when above the
maxscale. Useful for nesting interfaces.
minscale [double]: Minimum scale at which
this interface is valid. When a user requests a map at a larger scale a
generic MapServer error is returned. The maxtemplate could be used to provide
a more user-friendly message.
mintemplate [filename|url]: Template
file or url to use in presenting the results to the user when below the
minscale. Useful for nesting interfaces.
template [filename|url]: Template
file or url to use in presenting the results to the user in an interactive
mode (i.e. map generates map and so on...).