Type Alias 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);
}
Properties
Optionalfilter
OptionalgroupBy
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
Optionallayers
IDs of layers to query for vector features. Default: uses all the layers available
OptionalmarkerAnchor
Position of the marker relative to its anchor point.
Default: "center"
OptionalmarkerSize
Size of the markers on screen space [width, height].
Default: [150, 50]
Optionalmax
Maximum number of markers to keep. Default: no maximum
OptionalmaxNbFeaturesPerMarker
Markers can contain multiple features, this parameter can be set to have a strict limit.
Default: Infinity
OptionalmaxRatioUnitSize
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
Optionaloffset
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]
OptionalsortingOrder
Sorting order, only relevant if the option .sortingProperty is provided, or else will be ignored.
Default: "ascending"
OptionalsortingProperty
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
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) orfalse(the feature is discarded). Default: none