Skip to content
russellporter edited this page Nov 2, 2012 · 8 revisions

Types

color

  • Similar to CSS color, hex values represented as #RRGGBB or #RGB.

integer

  • Integer value, e.g. 0, 1, etc.

float

  • Floating point value, e.g. 0.0, 0.1, 1, etc.

string

  • String with mandatory single or double quotes.

boolean

  • Simple true or false, without quotes.

url

  • Link to an external resource, e.g. url('http://example.com/image.png'). file:// and filesystem paths accepted. As in CSS, relative paths are always relative to the file containing the property.

numbers

  • List of numbers used for dasharray properties, e.g. 2, 4, 2, 4

Properties

General

display

  • "none" or "map", default "map".

Map

map-bgcolor color

  • Also accepts transparent

Example:

Map
{
    map-bgcolor: #6699FF;
}

Polygon Symbolizer

polygon-fill color

polygon-opacity float

  • default 1.0

Example:

Layer
{
    polygon-fill: #6F9;
    polygon-opacity: 0.3;
}

Line Symbolizer

line-color color

  • default #000000

line-width float

  • 0.0 - n (default 1.0)

line-opacity float

  • 0.0 - 1.0 (default 1.0)

line-join miter, round, bevel

  • default miter

line-cap butt, round, square

  • default butt

line-dasharray numbers

  • d0,d1, ... (default none)

Example:

Layer
{
    line-color: #696;
    line-width: 1;
    line-cap: butt;
    line-join: miter;
    line-dasharray: 4,4;
}

Outline Line Symbolizer

Outlines are only applied when associated line properties are defined.

outline-color color

  • default #000000

outline-width float

  • 0.0 - n (default 1.0)
  • This width represents the extra casing added to an existing line, not the total width.

outline-opacity float

  • 0.0 - 1.0 (default 1.0)

outline-join miter, round, bevel

  • default miter

outline-cap butt, round, square

  • default butt

outline-dasharray numbers

  • d0,d1, ... (default none)

Example:

Layer
{
    /* 4 pixel base line */
    line-color: #696;
    line-width: 4;

    /* additional 1 pixel line casing */
    outline-color: #000;
    outline-width: 1;
}

Inlines are an additional line symbolizer overlaid on regular lines.

inline-color color

  • default #000000

inline-width float

  • 0.0 - n (default 1.0)

inline-opacity float

  • 0.0 - 1.0 (default 1.0)

inline-join miter, round, bevel

  • default miter

inline-cap butt, round, square

  • default butt

inline-dasharray numbers

  • d0,d1, ... (default none)

Example:

Layer
{
    /* 4 pixel base line */
    line-color: #696;
    line-width: 4;

    /* 1 pixel dashed center line */
    inline-color: #fff;
    inline-width: 1;
    inline-dasharray: 3,6;
}

Text Symbolizer

text-face-name string

  • Font name

text-size integer

  • Font size

text-ratio (?)

text-wrap-width integer

  • length before wrapping long names

text-spacing integer

  • space between repeated labels

text-label-position-tolerance ?

  • allow labels to be moved from their point

text-max-char-angle-delta integer

  • Maximum angle (in degrees) between two consecutive characters in a label allowed (to stop placing labels around sharp corners)

text-fill color

  • Color of the fill eg. #FFFFFF

text-halo-fill color

  • Color of the halo

text-halo-radius integer

  • Radius of the halo in whole pixels, fractional pixels are not accepted

text-dx integer text-dy integer

  • displace label by fixed amount on either axis.

text-avoid-edges boolean

  • whether to avoid labeling near intersection edges.

text-min-distance integer

  • Minimum distance between repeated labels such as street names or shield symbols

text-allow-overlap boolean

  • Allow labels to overlap other labels

text-placement point, line

  • Default point
  • Use line to label along lines

Example:

/* text style to apply to NAME column in geo data */
Layer NAME
{
    text-face-name: "DejaVu Sans Book";
    text-size: 10;
    text-fill: #000;
    text-halo-fill: #9ff;
    text-halo-radius: 2;
    text-placement: point;
    text-wrap-width: 50;
    text-avoid-edges: true;
}

Point Symbolizer

point-file url

  • path to image file

point-width integer

point-height integer

  • Default: 4
  • In pixels, generally omit this and let PIL handle it

point-allow-overlap boolean

Polygon Pattern Symbolizer

polygon-pattern-file url

  • path to image file (default none)

polygon-pattern-width integer

polygon-pattern-height integer

  • Default: 4
  • In pixels, generally omit this and let PIL handle it

Line Pattern Symbolizer

line-pattern-file url

  • path to image file (default none)

line-pattern-width integer

line-pattern-height integer

  • Default: 4
  • In pixels, generally omit this and let PIL handle it

Shield Symbolizer

shield-face-name string

shield-size integer

shield-fill color

shield-min-distance integer

  • Minimum distance between repeated labels such as street names or shield symbols

shield-file url

  • path to image file (default none)

shield-width integer

shield-height integer

  • Default: 4
  • In pixels, generally omit this and let PIL handle it