Creating your MapServer .MAP file

In MapServer the .MAP file is a workspace or project of layers that will be available.  This is the base that iShare then performs queries against via the MapSource (XML) file.

This is a brief overview of how to create a .map file and also to test it to ensure that it is correctly configured.

The .MAP file is a text file that describes a variety of items or objects.  Each object has a keyword to open it and a corresponding END to close it.  

Comments are used with a #.

ObjectDescriptionMandatory
MAPThis is the all encompassing object.Yes
QUERYMAPThis is required if you wish to perform a Zoom to Polygon for My Area.Yes
OUTPUTFORMAT

Defines the output image type.

This is optional UNLESS you are using ANTIALIASING / TRANSPARENCY – also for image quality we normally suggest this is implemented.

It will increase the size of the output image but there is a trade off between quality and size.

 

More information can be found at the MapServer website: http://www.mapserver.org/mapfile/outputformat.html.

No
WEBDefines output paths required by iShare.Yes
LAYERMost common object iShare use defining what data to show.Yes
LAYER -> CLASSAllow classifications against datasets.Yes
LAYER -> CLASS -> STYLEDefine styles for features.No
LAYER -> CLASS -> LABELThe Label class can allow for multiple columns to form an Expression for the label.No
LAYER -> CLASS -> EXPRESSIONIf you wish to use more complicated styles for say OS MasterMap layers then you can use the following which will colour according to the value of a field name using EXPRESSION.No
LAYER -> FILTERThe Filter class allows you to split out data from your source map files.No

From version 5.2.0 you can edit your .map file directly from within Studio using the Map Editor .

For details of on how to configure your MapServer .MAP file please refer to the MapServer Mapfile documentation.