Skip to content

Latest commit

 

History

History
112 lines (94 loc) · 9.11 KB

mapnik-2.2.creole

File metadata and controls

112 lines (94 loc) · 9.11 KB

This is the list of properties when using Mapnik 2.2 (use -t mapnik-2.2 when loading mapcss file).

  • properties marked in the "support Mapnik 2.0" with "no eval" can't be evaluated by an eval statement. A warning will be issued when compiling.

Rendering order

In contrast to the MapCSS 0.2 specification the following rendering order is used:

  1. Objects with lower layer (see below) should always be rendered first.
  2. Within a layer, first all fills are rendered, then all casings, then all strokes.
  3. Within each of those categories, objects are ordered according to z-index.
  4. If all of the above are equal, the order is undefined.

Finally:

  1. By default, all icons are rendered as if they are on layer 100 (defined by property 'point-layer')
  2. By default, all labels with text-position!=line are rendered as if they are on layer 101 (defined by property 'point-text-layer')
  3. By default, all labels with text-position=line are rendered as if they are on layer 102 (defined by property 'line-text-layer')
  4. By default, all shields are rendered as if they are on layer 103 (defined by property 'shield-layer')

General properties

CSS parameter Description Default value Compatibility MapCSS 0.2
layer the highest level of ordering objects the value of tag 'layer' (or 0) see below
[style_element]-layer] override layer property for a specific style_element the value of property 'layer' or the values as described under 'Rendering order' NO
z-index specify the order of objects in each layer: The objects with higher z-index are drawn on top of objects with lower z-index 0 YES
  • Property 'layer': MapCSS 0.2 does define the rendering order dependend on the layer-tag of the objects, but does not define a way to change that order from the stylesheet.

Canvas properties

CSS parameter Description support Mapnik 2.2 Compatibility MapCSS 0.2
fill-color The color of the background (default: fully transparent) no eval YES
fill-image use an image for the background instead of a color fill no eval YES
buffer set the buffer-size of the Map (default: 0) no eval no standard
  • MapCSS 0.2 properties not (yet) supported: antialiasing (always fully antialiased), fill-opacity (use alpha-channel on fill-color instead)

Point properties

CSS parameter Description Mapnik parameter support Mapnik 2.2 Compatibility MapCSS 0.2
icon-image URL (absolute or relative) of an image to use as an icon, e.g. url('img/foo.svg'). Icons from Mapbox Maki project can be included via their ID, e.g. parking-garage. file yes YES
icon-color Only for icons from Mapbox Maki project! Change color of icon to given color. Default: #444444. no eval no standard
icon-opacity Opacity of the icon image opacity no eval YES
icon-width Width of image. Ignored for custom images. For icons from Mapbox Maki project values 12, 18 or 24 (default) have to be used. - automatic PARTLY
icon-height Height of image. Ignored for custom images. - automatic NO

Line properties

CSS parameter Description Mapnik parameter support Mapnik 2.2 Compatibility MapCSS 0.2
color Colour of the line. stroke no eval YES
width The line width in pixels. stroke-width no eval YES
offset Pixels to offset the line to the left or right (default: 0). offset no eval no standard
opacity How transparent the line is, from 0 (transparent) to 1 (opaque). stroke-opacity no eval YES
image The URL of an image to use for filling the line yes YES
linejoin The style for line corners: 'round' (default), 'miter' or 'bevel'. stroke-linejoin YES
linecap The style for the end of the line: 'none' (default), 'round' or 'square' stroke-linecap Mapnik uses 'butt' instead of 'none'; will be automatically mapped. YES
dashes An array of alternating on/off lengths stroke-dasharray no eval YES
casing-color Colour of the casing (border) of a line. stroke no eval YES
casing-width Width of the casing (border) of the line (added to 'width' of the line). stroke-width no eval YES
casing-offset Pixels to offset the casing of the line to the left or right (default: same as 'offset'). offset no eval no standard
casing-opacity How transparent the casing is, from 0 (transparent) to 1 (opaque). stroke-opacity no eval YES
casing-linejoin The style for casing corners: 'round' (default), 'miter' or 'bevel'. stroke-linejoin YES
casing-linecap The style for the end of the casing: 'none' (default), 'round' or 'square' stroke-linecap see 'linecap' YES
casing-dashes An array of alternating on/off lengths stroke-dasharray no eval YES
  • MapCSS 0.2 properties not (yet) supported: extrude, extrude-*

Area properties

CSS parameter Description Mapnik parameter support Mapnik 2.2 Compatibility MapCSS 0.2
fill-color Colour in which to fill the area. fill no eval YES
fill-opacity How transparent the fill is, from 0 (transparent) to 1 (opaque) fill-opacity no eval YES
fill-image The URL of an image to use for filling the area yes YES

Label properties

CSS parameter Description Mapnik parameter support Mapnik 2.2 Compatibility MapCSS 0.2
max-width The maximum width of a text label for a point, after which it should wrap onto the next line. wrap-width no eval YES
text-offset The vertical offset from the centre of the way or point. dy no eval YES
text-position Whether the text follows the path of the way ('line') or is centred on the area ('center', default) placement YES
font-family Name of the font to use (default: "DejaVu Sans") see 'Fonts' below YES
font-weight 'bold' or 'normal' (default) YES
font-style 'italic' or 'normal' (default) YES
font-size Size of the text size YES
text-color Colour of text fill no eval YES
text-halo-color The colour (hex or CSS) of the 'halo' or 'pull-out' used to make the text stand out from features underneath it. halo-fill no eval YES
text-halo-radius The radius of the halo halo-radius YES
text A tag from which text for label will be read, or (if quoted or an eval-statement) the text for the label yes YES
text-spacing Space between repeated labels. If spacing is 0 only one label is placed (default). spacing yes no standard
text-transform 'none' (default), 'uppercase', 'lowercase', 'capitalize' YES
text-opacity How transparent the text is, from 0 (transparent) to 1 (opaque) opacity YES
wrap-character Use this character instead of a space to wrap long names wrap-character no standard
character-spacing Additional horizontal spacing between characters. character-spacing no standard
  • MapCSS 0.2 properties not (yet) supported: font-variant, text-decoration

Fonts

There's a fontset for each font-family / font-weight / font-style combination, defined in default-template.mapnik. There's a default fallback to unifont too (which might change in the future). The name of the fontsets is "font-family - font-weight - font-style", e.g. "DejaVu Serif Condensed - bold - italic".

Also all possible font-families are defined in default.mapcss in the @values font-family clause.

Shields

CSS parameter Description Note Mapnik 2.2 Compatibility MapCSS 0.2
shield-placement Whether the shields follows the path of the way ('line', default for lines) or is centred on the area ('point', default for other features) no standard
shield-font-family Name of the font to use (default: same as font-family) no eval no standard
shield-font-weight 'bold' or 'normal' (default: same as font-weight) no eval no standard
shield-font-style 'italic' or 'normal' (default: same as font-style) no eval no standard
shield-font-size Size of the text (default: same as font-size) no eval no standard
shield-text-color Colour of text (default: #000000) no eval no standard
shield-text-halo-color The colour (hex or CSS) of the 'halo' or 'pull-out' used to make the text stand out from features underneath it. no eval no standard
shield-text-halo-radius The radius of the halo no eval no standard
shield-text A tag from which text for label will be read, or (if quoted or an eval-statement) the text for the label YES
shield-spacing Space between repeated shields. If spacing is 0 only one label is placed (default: 196px). no eval no standard
shield-opacity How transparent the shield is, from 0 (transparent) to 1 (opaque) (default: 1) no eval YES
shield-image The URL (absolute or relative) of an image to use as a background for text. YES
shield-text-transform 'none' (default: same as text-transform), 'uppercase', 'lowercase', 'capitalize' no standard
  • MapCSS 0.2 properties not (yet) supported: shield-color, shield-frame-color, shield-frame-width, shield-casing-color, shield-casing-width, shield-shape.
  • Currently a shield-image is mandatory.