Skip to main content

Module features

Module features 

Source
Expand description

Labels and map features: select parts of a style to stack basemaps.

Every style layer is either a label (a symbol layer: text and icons) or not, and belongs to one feature: water, roads, buildings, … (see FEATURES). labels keeps all layers, drops the labels or keeps only them; features keeps or drops features. The two combine: features = ["roads"] with labels only is the road names.

A layer’s feature comes from its vector tile source-layer, through tables for the common schemas (OpenMapTiles: OpenFreeMap, Stadia, MapTiler; Protomaps: CARTO; Shortbread: VersaTiles), then keywords that also cover Esri’s descriptive layer names ("Water area", "Road"), then keywords in the layer id. Raster tiles have their labels drawn in; catalogue basemaps with label-free or label-only tiles switch to those (see crate::providers).

Structs§

Selection
What select keeps of a style.

Enums§

Labels
Which labels to keep.

Constants§

FEATURES
The features layers are sorted into, with what each covers.

Functions§

is_label
Whether a style layer is a label (text or icons).
layer_feature
The feature a style layer belongs to (one of FEATURES).
select
style_json with only the layers labels and features select. A catalogue raster basemap switches to its label-free or label-only tiles instead. A selection may leave no layer (select_layers makes that an error).
select_layers
As select, with a selection that leaves nothing to draw an error that lists the style’s features.
validate_features
Check a features filter without applying it.