Any data layer can be associated with one or several logical layers that describe how to the data layer is rendered. To define what data layer provides geometries for rendering, layer property of the data block is used. The following example demonstrates two logical layers that use the same data layer. The logical layers render geometry provided by the water data layer as polygons (water_area) and polylines (water_outline). Note that both logical layers use the same data layer provided by the data block layer property.
For the full list of the available data layers, refer to the HERE Vector Tile API documentation.
To narrow down how the logical layer is applied, you can include the filter block element into the logical definition. The filter block defines the features from the data layer that are rendered with the given style. In the following example, the filter block is not defined and, by default, all geometries of the roads data layer are rendered with the lines style.
Adding the filter to the example, above reduces the number of features that belong to this logical layer. The following example shows how to apply the filter block to the existing layer. The block contains the key-value pairs, where key is the name of the property used for filtering and the value is the data value against which the filter match is performed.
Single filter can perform matching against several different properties and follows the logical AND rules. The snippet, below adds a second property - is_tunnel - to select geometries for the logical layer more precisely.
The map with the "major_road" AND "is_tunnel" filter
Logical layers can be nested (filter blocks follow logical AND rules). Nesting in combination with filters provides a powerful tool that helps to express precisely how the feature should be rendered depending on its properties and enables reuse of draw instructions. In the example, below the road network from the roads data layer is rendered colored gray. Three nested logical layers show how filters are applied to highlight the bridges on the map. If a map feature represents:
a bridge (is_bridge == true) then feature color is red
a bridge (is_bridge == true) AND the road class is tertiary (kind_detail == tertiary) then feature color is green
a bridge (is_bridge == true) AND the road class is tertiary (kind_detail == tertiary) AND the road segment is marked as a one-way segment (oneway == true) then feature color is blue
The map with the nested logical layers and filters