3.6 Fill Patterns

Fill patterns add hatch, grid, or point textures on polygon fill sub-layers in 2.3.1 Layer Symbology. Pantograf stores pattern metadata in pantograf_fill_pattern and registers a MapLibre fill-pattern image at runtime.

Configure patterns in Paint Properties for supported layer types (fill, gg_inverse-fill, and related fill types). See 3.2 Paint Properties for other paint keys.

A. Pattern modes

ModeDescription
GeneratedBuilt-in catalog: line hatches (diagonal, horizontal, vertical), point grids (grid, hex), and cross-hatch / brick grids. Each variant has thickness or size steps 1–5.
URLLoad a repeating image from a URL (must allow cross-origin use for preview).

B. Generated pattern options

  • Pattern color — stroke/dot color (generated mode).
  • Fill color — base fill from the sub-layer's fill-color paint (shown in preview).
  • Enable — turn pattern on or off without deleting settings.

Patterns compile to a unique image id per sub-layer style id so multiple sub-layers can use different hatches on the same map.

C. Storage shape

When enabled, the sub-layer style includes:

"pantograf_fill_pattern": {
  "enabled": true,
  "mode": "generated",
  "generated": { "category": "line", "variant": "diag", "size": 2 },
  "patternColor": "#333333"
},
"paint": {
  "fill-color": "#E8E8E8",
  "fill-pattern": "pantograf-fill-pattern-<styleId>"
}

URL mode stores mode: "url" and url instead of generated.

Keywords

fill, pattern, hatch, grid, hex, brick, polygon, paint, symbology, maplibre, generated, url, 3 6