/layer/themes/distributed

The layer theme module exports a method for distributed themes.

Methods

(inner) distributed(theme, feature)

The distributed theme method assign a style to a feature from the themes categories array.

The method will iterate of features which intersect the bounding box of the current feature and attempts to assign a category style which isn't used by any intersecting feature.

Parameters:
NameTypeDescription
themeObject

The theme configuration object.

featureObject

The feature object.

Properties
NameTypeAttributesDefaultDescription
theme.categoriesArray

An array of category objects.

feature.propertiesObject

The properties of the feature.

theme.fieldstring<optional>
'id'

The field name used for determining the unique value.

theme.lookupObject<optional>
{}

An object mapping unique values to their assigned styles.

theme.boxesArray<optional>
[]

An array of bounding boxes for the features.

theme.indexnumber<optional>
0

The current index for assigning styles.