/layer/featureFields
The featureFields module exports methods to reset and process the layer.featureFields{} object.
The layer.featureFields{} object has field properties for each field in the layer.params.fields[] array.
The layer.params.fields[] array will be populated from the fieldsArray method prior to requesting features to be added to an Openlayers layer source.
The featureFields.process() method will be called from the featureFormats methods while creating Openlayers features.
- Source
Methods
(inner) count(layer)
The count distribution method counts values in the featureFields.values[]
array.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
- Source
(inner) fieldsArray(layer) → {array}
The fieldsArray method checks the layer params and style to create a Set of fields which are required as feature properties.
An array without duplicates or undefined fields is returned from the Set.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp vector layer. |
- Source
Array of feature fields.
- Type:
- array
(inner) jenks(layer)
The jenks distribution method requires the stats.jenks utility method to calculate natural breaks within the featureFields.values[]
array.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
- Source
(inner) process(layer)
The featureFields.process(layer) method will calculate the distribution of featureFields fields.values[] for featureStyle methods.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
Name | Type | Description |
---|---|---|
layer.style | layer-style | The layer style configuration. |
style.icon_scaling | Object | Configuration to scale style icons for point features. |
style.theme | Object | The current theme to style features according to their properties. |
- Source
(inner) reset(layer)
featureFields.reset(layer) method will reset the layer.featureFields{} object and create empty field.values[] arrays each field in the layer.params.fields[] array.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
Name | Type | Description |
---|---|---|
layer.params | Object | |
params.fields | Array | Array of strings for feature property fields. |
- Source