Type Alias MarkerLayoutOptions

type MarkerLayoutOptions = {
    filter?: (feature: MapGeoJSONFeature) => boolean;
    groupBy?: string;
    layers?: string[];
    markerAnchor?: MarkerAnchor;
    markerSize?: [number, number];
    max?: number;
    maxNbFeaturesPerMarker?: number;
    maxRatioUnitSize?: number;
    offset?: [number, number];
    sortingOrder?: "ascending" | "descending";
    sortingProperty?: string | ((feature: MapGeoJSONFeature) => number);
}
Index

Properties

filter?: (feature: MapGeoJSONFeature) => boolean

A filter function can be provided. Each feature will be tested against this filter function, and the returned value can be true (the feature is kept) or false (the feature is discarded). Default: none

groupBy?: string

Property to group by. The property must be present in the properties object of the feature unless the value of groupBy is equal to "coordinates", then the geometry coordinates are being used. Default: no grouping

layers?: string[]

IDs of layers to query for vector features. Default: uses all the layers available

markerAnchor?: MarkerAnchor

Position of the marker relative to its anchor point. Default: "center"

markerSize?: [number, number]

Size of the markers on screen space [width, height]. Default: [150, 50]

max?: number

Maximum number of markers to keep. Default: no maximum

maxNbFeaturesPerMarker?: number

Markers can contain multiple features, this parameter can be set to have a strict limit. Default: Infinity

maxRatioUnitSize?: number

When a marker contains multiple features, its size can get bigger. This number is the max ratio applied to the defined markerSize. Intentionnaly non-integer so that the user can see there is still half an element to show at the bottom and undestand they can scroll for more. Default: 2.5

offset?: [number, number]

Offset to apply to the marker, in number of pixel, relative to its anchor position. First element of the array is the horizontal offset where negative shifts towards the left and positive shifts towards the right. Second element of the array is the vertical offset where negative shifts towards the top and positive shifts towards the bottom. Default: [0, 0]

sortingOrder?: "ascending" | "descending"

Sorting order, only relevant if the option .sortingProperty is provided, or else will be ignored. Default: "ascending"

sortingProperty?: string | ((feature: MapGeoJSONFeature) => number)

Property to sort the features by. If not provided, the features will not be sorted. Alternatively, the sorting property can be a function that takes the feature as argument and returns a number, aka. the sorting value (or rank) Default: not provided

Was this helpful?

SDK JS
Modules
Reference
types
MarkerLayoutOptions