:sourcedir: ../..

=== Map

This is the top level tag / object in a mapnik setup,
it defines the map extent and global parameters / defaults.

TODO: contains ...

.Map Attributes
[options="header,unbreakable",cols="m,d,d,d"]
|===
| Attribute | Type | Default | Description
| base | string | none | name of a <FileSource> to find the input file in
| <<map-background-color,background-color>> | color | transparent | 
| <<map-background-image,background-image>> | file path | none |
| background-image-comp-op | SVG composition | none | 
| background-image-opacity | float | 1.0 | 
| srs | proj4 projection | +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs | 
| buffer-size | float | 0.0 | 
| maximum-extent | 4xfloat |  | 
| font-directory | directory path | none | 
| <<map-minimum-version,minimum-version>> | version string | none | 
| <<map-paths-from-xml,paths-from-xml>> | boolean | true | Whether relative paths are relative to the directory the XML file is in, or the current working directory.
|===

[#map-background-color]
==== `backgroud-color` attribute

.Map background-color
[#example-map-background-color]
====
[source,xml]
-----
include::{sourcedir}/examples/map/background-color.xml[]
-----
image::examples/map/background-color.svg[align="center"]
====

[#map-background-image]
==== `backgroud-image` attribute

Sets a background image for the map. The image is not scaled to the actual map output size, if the two sizes do not match it is either cropped or tiled.

.Map background-image
[#example-map-background-image]
====
[source,xml]
-----
include::{sourcedir}/examples/map/background-image.xml[]
-----
image::examples/map/background-image.svg[align="center"]
====

[#map-minimum-version]
==== `minimum-version` attribute

Specifies the minimum Mapnik version needed to process this stylesheet. 

Requires a three part version number, so `3.0.0` works but `3.0` or just `3` doesn't. (See also https://github.com/mapnik/mapnik/issues/4369)

TODO: wiki says it prints a warning only, but at least with the Python bindings it causes a hard runtime error instead.

.Map minimum-version
[#example-map-minimum-version]
====
[source,xml]
-----
include::{sourcedir}/examples/map/minimum-version.xml[]
-----
====

[#map-paths-from-xml]
==== `paths-from-xml` attribute

Specifies whether relative file paths are relative to the top level Mapnik XML file (`true`) or the local directory (`false`).
Defaults to `true`.
