/layer/themes/graduated

The layer theme module exports a method for graduated themes.

Methods

(inner) graduated(theme, feature)

The graduated theme method iterates through the ordered categories array and compares a numeric feature field value with the category. The iteration will break if the field value exceeds the category value.

Parameters:
NameTypeDescription
themeObject

The theme configuration object.

featureObject

The feature object.

Properties
NameTypeAttributesDescription
theme.fieldstring

The field name used for determining the category.

theme.categoriesArray

An array of category objects.

theme.graduated_breaksstring

The comparison operator ("less" or "more").

feature.propertiesObject

The properties of the feature.

properties.featuresArray<optional>

An array of sub-features.