/layer/featureStyle

This module exports a style function for a layer

Methods

(inner) Style()

Style functions process [vector] features and return an OL style to the layer render.

(inner) clusterStyle(feature)

Applies cluster style to the feature based on layer configuration.

Parameters:
NameTypeDescription
featureObject

The feature object.

(inner) featureProperties(layer, properties) → {Object}

Assigns feature properties based on layer configuration.

Features not in the layer featureSet, featuresObject, or featureLookup will not be displayed and return null.

Parameters:
NameTypeDescription
layerlayer

The decorated mapp layer.

propertiesObject

The feature properties.

Properties
NameTypeAttributesDescription
layer.featureSetSet<optional>

A set of feature IDs to be displayed.

layer.featuresObjectObject<optional>

MVT feature properties keyed by feature ID.

layer.featureLookupArray<optional>

An array of feature properties objects to be displayed.

Returns:

The feature properties or null if the feature is not displayed.

Type: 
Object

(inner) featureStyle(layer) → {function}

Returns a style function for OL vector layers.

Parameters:
NameTypeDescription
layerlayer
Properties
NameTypeAttributesDescription
layer.stylelayer-style

The layer style config.

style.cacheBoolean<optional>

The feature style should be retrieved from the feature 'Styles' property.

Returns:

The style function for the layer.

Type: 
function

(inner) highlightStyle(feature)

Applies highlight style to the feature based on layer configuration.

Parameters:
NameTypeDescription
featureObject

The feature object.

(inner) iconScalingStyle(feature)

Applies the icon scale based on the value of the field supplied in layer.style.icon_scaling.field

Parameters:
NameTypeDescription
featureObject

The feature object.

(inner) labelStyle(feature)

Applies label style to the feature based on layer configuration.

Parameters:
NameTypeDescription
featureObject

The feature object.

(inner) selectedStyle(feature)

Applies selected style to the feature based on layer configuration.

Parameters:
NameTypeDescription
featureObject

The feature object.