Hatch

data class Hatch(val pattern: HatchPattern, val color: ColorRgba, val backgroundColor: ColorRgba? = null, val spacing: Int = 12, val thickness: Float = 2.0f) : ShapeStyle

The shape is filled with a hatching: lines, a cross or dots in color, one tile of spacing pixels repeated across it, with backgroundColor (when set) behind them. The gaps stay empty otherwise, so the map shows through, which is what makes it fit for marking an area (disputed, occupied, restricted) without hiding what is under it.

Like an ImagePattern, which is what it is drawn as, the tile is laid out in screen pixels: zooming the map doesn't change the hatching's size or spacing, only the shape under it. So spacing and thickness are pixels of the display, not of a map scale; a host that wants the same look on every screen density scales them by its density.

spacing is the tile's side: along a horizontal or vertical line it is the distance to the next line, along a diagonal one the distance measured along an axis (the lines themselves are spacing / sqrt(2) apart). thickness is a line's width, or the diameter of a dot. On a line or a marker the hatching has nothing to fill, so color is used as a plain colour there.

Constructors

Link copied to clipboard
constructor(pattern: HatchPattern, color: ColorRgba, backgroundColor: ColorRgba? = null, spacing: Int = 12, thickness: Float = 2.0f)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard