Back

Stipple attribute

DEPRECATED - removed from FIRDEF SDK: April 2015

To draw stippled (dotted or dashed) lines, use the stippled attribute to define the stipple pattern.

The pattern argument is a 16-bit series of 0s and 1s, and it's repeated as necessary to stipple a given line. A 1 indicates that drawing occurs, and 0 that it does not, on a pixel-by-pixel basis, beginning with the low-order bits of the pattern.

  <line stipple="16135">
      <point lon="E0042957" lat="N0511059"/>
      <point lon="E0044324" lat="N0510755"/>
  </line>

where 16135 = 0011111100000111 in binary

With the preceding example and the pattern 16135 (which translates to 0011111100000111 in binary), a line would be drawn with 3 pixels on, then 5 off, 6 on, and 2 off. (If this seems backward, remember that the low-order bits are used first.) If factor had been 2, the pattern would have been elongated: 6 pixels on, 10 off, 12 on, and 4 off.

The figure below shows lines drawn with different patterns and repeat factors. If you don't specify line stippling, drawing proceeds as if pattern were 0xFFFF (hexadecimal) or 65535 (decimal).

Also note that stippling can be used in combination with wide lines to produce wide stippled lines.

Some examples of what is possible using the stipple attribute:

One way to think of the stippling is that as the line is being drawn, the pattern is shifted by one bit each time a pixel is drawn. When a series of connected line segments is drawn, the pattern continues to shift as one segment turns into the next. This way, a stippling pattern continues across a series of connected line segments.

When a new line (or other map element) is defined, the pattern is reset, and - if more lines are drawn before stippling is disabled - the stippling restarts at the beginning of the pattern. If you're drawing lines with <line>, the pattern resets for each independent line.

The example below illustrates the results of drawing with a couple of different stipple patterns and line widths. It also illustrates what happens if the lines are drawn as a series of individual segments instead of a single connected line strip.