/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.

Methods

(inner) count(layer)

The count distribution method counts values in the featureFields.values[] array.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer object.

(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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp vector layer.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer object.

(inner) process(layer)

The featureFields.process(layer) method will calculate the distribution of featureFields fields.values[] for featureStyle methods.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer object.

Properties
NameTypeDescription
layer.stylelayer-style

The layer style configuration.

style.icon_scalingObject

Configuration to scale style icons for point features.

style.themeObject

The current theme to style features according to their properties.

(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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer object.

Properties
NameTypeDescription
layer.paramsObject
params.fieldsArray

Array of strings for feature property fields.