AttribRecord

AttribRecord

new AttribRecord()

Source:

Methods

aliasedFieldName(attribName) → {Promise}

Source:

Get the best user-friendly name of a field. Uses alias if alias is defined, else uses the system attribute name.

Parameters:
Name Type Description
attribName String

the attribute name we want a nice name for

Returns:

resolves to the best available user friendly attribute name

Type
Promise

attributesToDetails(attribs, fields, layerid) → {Array}

Source:

Transforms esri key-value attribute object into key value array with format suitable for consumption by the details pane.

Parameters:
Name Type Description
attribs Object

attribute key-value mapping, potentially with aliases as keys

fields Array

optional. fields definition array for layer. no aliasing done if not provided

layerid Integer

optional. specifies which sublayer is being transformed

Returns:

attribute data transformed into a list, with potential field aliasing applied

Type
Array

checkDateType(attribName) → {Promise}

Source:

Test if an attribute field has a date data type.

Parameters:
Name Type Description
attribName String

the attribute name to check if it's a date field

Returns:

resolves with a boolean indicating if attrib name is a date field.

Type
Promise

getFormattedAttributes() → {Promise}

Source:

Retrieves attributes from a layer for a specified feature index

Returns:

promise resolving with formatted attributes to be consumed by the datagrid and esri feature identify

Type
Promise

AttribRecord

new AttribRecord(layerClass, esriRequest, apiRef, config, esriLayer, epsgLookup)

Source:

Create a layer record with the appropriate geoApi layer type. Layer config should be fully merged with all layer options defined (i.e. this constructor will not apply any defaults).

Parameters:
Name Type Description
layerClass Object

the ESRI api object for the layer

esriRequest Object

the ESRI api object for making web requests with proxy support

apiRef Object

object pointing to the geoApi. allows us to call other geoApi functions.

config Object

layer config values

esriLayer Object

an optional pre-constructed layer

epsgLookup function

an optional lookup function for EPSG codes (see geoService for signature)

Methods

aliasedFieldName(attribName) → {Promise}

Source:

Get the best user-friendly name of a field. Uses alias if alias is defined, else uses the system attribute name.

Parameters:
Name Type Description
attribName String

the attribute name we want a nice name for

Returns:

resolves to the best available user friendly attribute name

Type
Promise

attributesToDetails(attribs, fields, layerid) → {Array}

Source:

Transforms esri key-value attribute object into key value array with format suitable for consumption by the details pane.

Parameters:
Name Type Description
attribs Object

attribute key-value mapping, potentially with aliases as keys

fields Array

optional. fields definition array for layer. no aliasing done if not provided

layerid Integer

optional. specifies which sublayer is being transformed

Returns:

attribute data transformed into a list, with potential field aliasing applied

Type
Array

checkDateType(attribName) → {Promise}

Source:

Test if an attribute field has a date data type.

Parameters:
Name Type Description
attribName String

the attribute name to check if it's a date field

Returns:

resolves with a boolean indicating if attrib name is a date field.

Type
Promise

getFormattedAttributes() → {Promise}

Source:

Retrieves attributes from a layer for a specified feature index

Returns:

promise resolving with formatted attributes to be consumed by the datagrid and esri feature identify

Type
Promise