-
Notifications
You must be signed in to change notification settings - Fork 0
Stylesheets
This page describes the XML stylesheets used by FreePaperMaps.
A hexadecimal RGB color in the form of #?????? where ? is a hex digit.
A number that optionally has a decimal point. Default units are on-the-map millimeters. The following on-the-map units are also supported:
-
mm: millimeters -
in: inches -
ft: feet -
cm: centimeters -
m: meters -
px: pixels (1 px = (25.4 / 96) mm) -
pt: points
One of:
buttroundsquare
One of:
miterroundbevel
A positive integer value.
A number that optionally has a decimal point. Default units are degrees (deg). Radians are supported (rad). Example: 3.14rad.
top-lefttop-rightbottom-leftbottom-right
A sequence of any character.
Settings are written in key-value format:
<setting k="key" v="value"/><setting k="background-color" v="Hex color"/><setting k="attribution-font" v="String (a font installed on your system)"/>
<setting k="attribution-font-size" v="Length"/>
<setting k="attribution-bg-color" v="Hex color"/>
<setting k="attribution-text-color" v="Hex color"/>
<setting k="attribution-position" v="Attribution position"/>
<setting k="attribution-text" v="String"/><way id="Unique identifier">
... selectors (0 or more)
</way><node id="Unique identifier">
... selectors (0 or more)
</node>A selector is used to determine whether a style applies to a piece of geometry. For example, we can create a selector that only matches paved paths:
<!-- The outermost way tag is treated as an "and". -->
<way id="paved-paths">
<or>
<key k="highway" v="footway"/>
<key k="highway" v="path"/>
<key k="highway" v="cycleway"/>
</or>
<or>
<key k="surface" v="paved"/>
<key k="surface" v="concrete"/>
<key k="surface" v="asphalt"/>
</or>
</way>Specification:
- Direct children of
<selectors>should only be<node>and<way> -
<node>and<way>can have zero ore more direct children, known as expressions - An expression is one of:
-
<tag>(cannot contain children) - has a key and value-
Wildcard: the value of
""matches any value. For example:<tag k="building" v=""/>matches all building types
-
Wildcard: the value of
-
<and>(must contain one or more expressions) - logical AND -
<or>(must contain one or more expressions) - logical OR -
<not>(must contain one or more expressions) - logical NOT
-
- In the case of
<not>and the top-level<way>tag, if there is more than one expression as children of those tags, then it is implied that the expressions are within an<and>
Draws a way as a line, going from point to point in order. Can be used for both closed and unclosed ways.
<polyline ... />Options:
-
required
ref -
stroke(Hex color): line color -
fill(Hex color): fill color (if not specified, then no fill is used) -
thickness(Length): line thickness -
cap(Cap): line end cap -
join(Join): line join
Draws a polygon centered on a node.
<nodeshape ... />Options:
-
required
ref -
required
vertices(Count): the number of vertices of the polygon -
required
radius(Length): the distance from the node's coordinate position and each vertex -
stroke(Hex color): line color -
fill(Hex color): fill color (if not specified, then no fill is used) -
thickness(Length): line thickness -
cap(Cap): line end cap -
join(Join): line join -
angle(Angle): the angle in standard position from the x-axis of the first point in the polygon
Draws an SVG icon centered on a node.
<icon ... />Options:
-
required
ref -
required
path(String): path to an SVG icon file -
fill(Color): if specified, attempts to override the SVG's default colors to this color - best suited for simple, single-color SVGs -
width(Length): a maximum width for the icon -
height(Length): a maximum height for the icon