Skip to main content

Interface: VisualizationLayer

Defined in: spec/types.ts:439

Properties​

activeLegendId?​

optional activeLegendId?: string

Defined in: spec/types.ts:452

Id of the currently active legend from legends[].


click?​

optional click?: LayerClickConfig

Defined in: spec/types.ts:519

Spec-driven click reaction. When present, <GeoVisProvider> invokes click.onSelect for features clicked on this layer — without the consumer placing a component or calling useGeoVisClick() in the tree. Declaring click also opts the layer into click tracking, so activeLegendId is not required. Typed via a type-only import so the data-only spec layer keeps no runtime dependency on React (mirrors hoverTooltip).


clickAnchor?​

optional clickAnchor?: object

Defined in: spec/types.ts:476

Spec-driven click marker. When present, geovis automatically places a visual indicator on the clicked feature without requiring a <GeoVisMarker> component. Three rendering modes — see field descriptions.

color?​

optional color?: string

Accent colour for the built-in SVG pin. Applied when iconImage is not set. Default: '#3FB1CE'. For a custom HTML/React element, use <GeoVisMarker> instead.

iconImage?​

optional iconImage?: string

MapLibre sprite icon name. Renders a feature-state-driven companion symbol layer at the polygon label point.

iconSize?​

optional iconSize?: number

Scale factor for the sprite icon. Default: 1.

latKey?​

optional latKey?: string

Feature property key holding the latitude. Paired with lngKey, geovis reads the pin position from feature.properties instead of the tile geometry to avoid drift at high zoom.

lngKey?​

optional lngKey?: string

Feature property key holding the longitude. Must be paired with latKey.

offset?​

optional offset?: [number, number]

Pixel offset [x, y] applied to the DOM marker.


extrusion?​

optional extrusion?: PolygonExtrusion

Defined in: spec/types.ts:542

Renders a polygon layer in 3D, its features extruded by value — see PolygonExtrusion. Ignored on non-polygon geometries.

Example​

const layer: VisualizationLayer = {
id: 'districts',
sourceId: 'districts-src',
geometry: 'polygon',
mapDataId: 'rates',
activeLegendId: 'rates-legend',
extrusion: { maxHeight: 4000 },
};

filter?​

optional filter?: LayerFilter

Defined in: spec/types.ts:561

Declarative predicate that hides features not matching it, compiled to the engine's native filter expression (dispatch({ type: 'set-filter' }), PRD-002). Reads feature.properties[property] — the same direct-access path propertyName uses above, not the mapData-joined feature-state value. Gated by CapabilitySet.dataFeatures.filter per source type.


geometry​

geometry: GeoVisGeometryType

Defined in: spec/types.ts:442


hoverPaint?​

optional hoverPaint?: object

Defined in: spec/types.ts:464

Paint applied via MapLibre setFeatureState({ hover: true }) when the pointer enters a feature. When present, the adapter adds a companion line layer (<id>-hover-outline) driven by feature-state expressions.

lineColor?​

optional lineColor?: string

lineWidth?​

optional lineWidth?: number


hoverTooltip?​

optional hoverTooltip?: HoverTooltipConfig

Defined in: spec/types.ts:510

Spec-driven hover tooltip. When present, <GeoVisProvider> automatically renders a <GeoVisHoverTooltip> for features hovered on this layer — without requiring the component to be placed in the tree. Mirrors GeoVisHoverTooltipProps (render, formatValue, style, offset, emptyValueLabel, className). An empty object ({}) opts in to the default tooltip layout. Typed via a type-only import so the data-only spec layer keeps no runtime dependency on React.


id​

id: string

Defined in: spec/types.ts:440


legends?​

optional legends?: LegendSpec[]

Defined in: spec/types.ts:450

Optional alternative legend definitions presented as runtime toggles.


mapDataId?​

optional mapDataId?: string

Defined in: spec/types.ts:458

Optional reference to an entry in spec.mapData. When present, the layer can be styled/queried by per-feature values coming from the dataset (joined via feature.id or mapData.joinKey).


maxzoom?​

optional maxzoom?: number

Defined in: spec/types.ts:447


minzoom?​

optional minzoom?: number

Defined in: spec/types.ts:446


paint?​

optional paint?: LayerPaint

Defined in: spec/types.ts:448


propertyName?​

optional propertyName?: string

Defined in: spec/types.ts:553

GeoJSON feature property name for direct data access without mapData.

When set (and mapDataId is absent), the proportional circles expression reads values directly from feature.properties[propertyName] via MapLibre's ['get', propertyName] syntax — no feature-state join needed.

When mapDataId is also set, this field is ignored in favour of the standard feature-state resolution.


selectedPaint?​

optional selectedPaint?: object

Defined in: spec/types.ts:470

Paint applied via MapLibre setFeatureState({ selected: true }) when a feature is clicked. When present, the adapter adds a companion line layer (<id>-selected-outline) driven by feature-state expressions.

lineColor?​

optional lineColor?: string

lineWidth?​

optional lineWidth?: number


sizeBy?​

optional sizeBy?: SizeBy

Defined in: spec/types.ts:525

Proportional symbol configuration. When present on a point layer, circle-radius is driven by a data expression instead of a static value. Ignored on non-point geometries.


sourceId​

sourceId: string

Defined in: spec/types.ts:441


sourceLayer?​

optional sourceLayer?: string

Defined in: spec/types.ts:443


title?​

optional title?: string

Defined in: spec/types.ts:444


transition?​

optional transition?: LayerTransition

Defined in: spec/types.ts:579

Opt-in animated transition applied when this layer's source data changes between two specs. Only honoured for point (circle) layers backed by a geojson source; ignored otherwise. When declared, the adapter fades the OLD points out while the NEW points fade in, instead of swapping data instantly. Omit it to keep the instant setData behaviour.

Example​

const layer: VisualizationLayer = {
id: 'stores',
sourceId: 'stores-src',
geometry: 'point',
transition: { kind: 'crossfade', durationMs: 600, easing: 'ease-in-out' },
};

visible?​

optional visible?: boolean

Defined in: spec/types.ts:445