ui/locations/entries/layer

The entries layer module exports the default layer method.

Methods

(inner) checkData(entry) → {HTMLElement}

The value from a [dependent] entry field will override the entry.data when the layer location entry method is called from the infoj entries iteration.

Empty array data of no features will be assigned as null.

The entry and the display_toggle checkbox will be disabled if the layer entry should use a featureSet or featureLookup array with no query and no [feature] data.

Parameters:
NameTypeDescription
entryinfoj-entry

type:layer entry.

Properties
NameTypeAttributesDescription
entry.valueobject<optional>

Value assigned from a field in the get feature response.

entry.dataobject<optional>

An array of feature id or objects for the featureSet or featureLookup.

entry.querystring<optional>

A query to execute to populate the entry.data.

entry.featureSetobject<optional>

A set of feature ID to filter the layer features.

entry.featureLookupobject<optional>

Feature objects as lookup to filter the layer features.

Returns:

Node element to hold the layer view drawer.

Type: 
HTMLElement

(async, inner) decorateLayer(entry)

The infoj layer entry provided as argument will be decorated to become a mapp layer.

Parameters:
NameTypeDescription
entryinfoj-entry

type:layer entry.

(inner) hideLayer()

A custom hide [layer] method bound to the [layer] entry which will not update the mapp.hooks.

(inner) layer(entry) → {HTMLElement}

The layer entry method attempts to lookup a layer from the locale and will spread the infoj-entry object into a structured clone of the locale layer.

The infoj-entry effectively becomes a JSON layer which will be decorated and add the mapview.

The layer.key is a concatenated from the entry.layer [key] and the entry.location.hook.

A layer.view will be created for the decorated layer and appended to the entry.node for the location view.

featureLookup is an array of properties objects which filter and style requested features.

When using query-based featureLookup the query should return unique indentifiers within their original layer and any relevant fields used for thematic styling.

A featureSet of featureLookup can be defined for the layer feature styling. The values for the featureLookup or featureSet can be defined as entry.data. The entry.data may be populated from the get feature field or queried from a parameterised entry.query [template]. A featureSet consists of an array of feature IDs. A featureLookup consists of an array of feature objects with the feature properties being assigned for styling in the featureProperties style method.

Parameters:
NameTypeDescription
entryinfoj-entry

type:layer entry.

Properties
NameTypeAttributesDescription
entry.layerstring<optional>

lookup layer key for locale.layers[].

entry.dataobject<optional>

An array of feature id or objects for the featureSet or featureLookup.

entry.querystring<optional>

A query to execute to populate the entry.data.

entry.featureSetobject<optional>

A set of feature ID to filter the layer features.

entry.featureLookupobject<optional>

Feature objects as lookup to filter the layer features.

Returns:

Node element to hold the layer view drawer.

Type: 
HTMLElement

(async, inner) showLayer()

A custom show [layer] method bound to the [layer] entry which will not update the mapp.hooks.

The showLayer method assigns the entry value as data property. A query will be executed to populate the data property otherwise. The entry will be disabled if the query does not return a response.

The features may be defined as an featureSet in which case the features whose ID is not in the featureSet will not be styled by the featureStyle method.

An array feature object can be assigned to featureLookup property. Feature properties found by their ID in the featureLookup array will be assigned to the feature.properties in the featureStyle method.