The <line> section in a <layer> controls the drawing of lines, the most important of which are roads. Some attributes apply only to roads. The <line> attributes are

  • fill: the color used for the interior of the line
  • border: the color of the borders of the line
  • centerLine: (for roads only) the color of the center line of a road; used for major divided highways; center lines are drawn only if the road is marked as divided in the data
  • width: the width of the line
  • borderWidth: the width of the borders; percentage values refer to the width of the line
  • centerLineWidth: (for roads only) the width of the center line; percentage values refer to the width of the road
  • opacity: the opacity of all features - line, border and center line. To set opacity values separately use the #RRGGBB or #RRGGBBAA form for specifying the colors
  • antiAlias: (allowed values: "true" or "false") if true (the default value) use anti-aliasing to draw the line and its border more smoothly.
  • dashArray: a dashed line can be drawn by supplying a list of numbers giving the lengths of the filled-in sections and the gaps between them, in units of the width of the line. For example, the value '1,2' specifies dashes one unit long and gaps two units long. The list of numbers can be any length.

Example of a line that is not a road (in this case, a river):

<line width="20m" fill="lightblue"/>

Example of a line that is a road (in this case, a secondary road):

<line width="22m,2pt" fill="orange" border="black" borderWidth="5%" centerLine="white" centerLineWidth="5%"/>

Example of a railway drawn using white dashes with a grey border and background:

<line width='12m,2pt' border='grey' borderWidth='10%,0.7,2' fill='white' dashArray='5,5'/>

Style Sheets Directory