OptionalbeforeLayerConfig?: GeometryBeforeLayerConfigLayer positioning configuration.
Controls where geometry layers appear in the map's layer stack.
Use 'top' to place above all layers, or specify a layer ID to place
below that layer.
Optionalcolor?: stringBase colour of the fill and the border, as a CSS colour string.
Precedence, highest first:
color property, fill.color, this field.color property, fill.color,
this field.'#0A3653' on light map styles, '#5FA8D8' on dark (custom styles count as light).With fillStyle: 'outline' the border ends its chain on a neutral grey instead of the accent or the default.
Optionalfill?: GeometryFillConfigFill color, opacity, and (optional) fill-layer positioning.
Controls the interior color and transparency of polygon geometries.
OptionalfillStyle?: GeometryFillStyleHow every feature shown by this module is filled.
'filled' — Colored fill with thin border (default)'outline' — Transparent fill with thick colored border'inverted' — Colors the area outside the polygon (donut geometry)Individual features can override this by setting fillStyle in their properties.
Optionallabel?: GeometryLabelThe label at each geometry's center: its text and styling.
Optionalline?: GeometryLineConfigBorder/outline configuration, and (optional) border-layer positioning.
Controls the outline appearance of polygon geometries.
OptionallineLabel?: GeometryLineLabelLabels along the polygon border lines, drawn only when this is set ({} for the defaults).
OptionaltransformFeaturesForDisplay?: (input: PolygonFeatures) => PolygonFeaturesTransform applied to features before rendering.
Receives the value passed to GeometriesModule.show and returns features ready for display. Useful for deriving labels or other display properties from domain data.
Used internally by reachableRangeGeometryConfig to generate budget
labels (e.g. '30 min') from feature properties. For most use cases,
the standard config fields (fill, label, fillStyle) suffice.
Optionalvisible?: booleanWhether the module draws anything: fills, borders, center labels and border labels.
show() and clear() never change it — a hidden module keeps its data until
GeometriesModule.setVisible shows it again. A border hidden through
line.layer.layout.visibility stays hidden while the module is shown.
// Basic styling
const config: GeometriesModuleConfig = {
fill: { color: '#FF5733', opacity: 0.3 },
line: { color: '#C70039', width: 2 },
};
// One colour for fill and border
const brandConfig: GeometriesModuleConfig = { color: '#E63312' };
// With labels and positioning
const advancedConfig: GeometriesModuleConfig = {
fill: { color: 'blue', opacity: 0.25 },
line: { color: 'darkblue', width: 3 },
label: {
text: ['get', 'name']
},
beforeLayerConfig: 'lowestLabel' // Below map labels
};
// Data-driven styling
const dynamicConfig: GeometriesModuleConfig = {
fill: {
color: ['match', ['get', 'category'], 'park', '#4CAF50', 'water', '#2196F3', '#9E9E9E'],
opacity: 0.4
},
line: {
color: '#000000', width: ['case', ['get', 'highlighted'], 4, 2],
},
label: {
text: ['concat', ['get', 'name'], '\n', ['get', 'area'], ' km²']
}
};
Configuration options for the GeometriesModule.
Controls the visual appearance and positioning of polygon geometries displayed on the map.