API / filters.ts
Filters
Helpers that create and combine MapLibre filter expressions.
Functions
combineFilters function
import {
combineFilters
} from 'svelte-maplibre';
function combineFilters(join: 'all' | 'any', ...filters: (ExpressionSpecification | null | undefined)[]): ExpressionSpecification | undefined; isClusterFilter function
import {
isClusterFilter
} from 'svelte-maplibre';
Return an expression that returns a value based on whether the feature is a cluster or an individual point.
function isClusterFilter(matchClusters: boolean | undefined): ExpressionSpecification | undefined; hoverStateFilter function
import {
hoverStateFilter
} from 'svelte-maplibre';
Return an expression that returns a value based on whether the feature is hovered. Requires manageHoverState to be enabled for the layer.
function hoverStateFilter(defaultValue: string | number | boolean, hoverValue: string | number | boolean): ExpressionSpecification; Used in Examples
isTextLayer function
import {
isTextLayer
} from 'svelte-maplibre';
A function that returns if a layer is a text layer, and optionally if it belongs to a particular source.
function isTextLayer(layer: LayerSpecification, source?: string): boolean;