/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:
PropertiesName | Type | Description |
---|---|---|
theme | Object | The theme configuration object. |
feature | Object | The feature object. |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
theme.categories | Array | An array of category objects. | ||
feature.properties | Object | The properties of the feature. | ||
theme.field | string | <optional> | 'id' | The field name used for determining the unique value. |
theme.lookup | Object | <optional> | {} | An object mapping unique values to their assigned styles. |
theme.boxes | Array | <optional> | [] | An array of bounding boxes for the features. |
theme.index | number | <optional> | 0 | The current index for assigning styles. |