new DynamicRecord(layerClass, esriRequest, apiRef, config, esriLayer, epsgLookup, configIsComplete)
- Source:
Create a layer record with the appropriate geoApi layer type. Regarding configuration -- in the standard case, the incoming config object will be incomplete with regards to child state. It may not even have entries for all possible child sub-layers. Given our config defaulting for children happens AFTER the layer loads, it means what is passed in at the constructor is generally unreliable except for any child names, and the class will treat that information as unreliable (the UI will set values after config defaulting happens). In the rare case where the config is fully formed and we want to take advantage of that, set the configIsComplete param to true. Be aware that if the config is not actually complete you may get a layer in an undesired initial state.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
layerClass |
Object | the ESRI api object for dynamic layers |
|
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) |
|
configIsComplete |
Boolean |
false
|
an optional flag to indicate if the config is fully flushed out (i.e. things defined for all children). Defaults to false. |
Methods
aliasedFieldName(attribName, childIndex) → {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 |
childIndex |
String | index of the child layer whos attributes we are looking at |
Returns:
resolves to the best available user friendly attribute name
- Type
- Promise
checkDateType(attribName, childIndex) → {Promise}
- Source:
Check to see if the attribute in question is an esriFieldTypeDate type.
Parameters:
Name | Type | Description |
---|---|---|
attribName |
String | the attribute name we want to check if it's a date or not |
childIndex |
String | index of the child layer whos attributes we are looking at |
Returns:
resolves to true or false based on the attribName type being esriFieldTypeDate
- Type
- Promise
getChildProxy(featureIdx) → {Object}
- Source:
Return a proxy interface for a child layer
Parameters:
Name | Type | Description |
---|---|---|
featureIdx |
Integer | index of child entry (leaf or group) |
Returns:
proxy interface for given child
- Type
- Object
getFormattedAttributes(childIndex) → {Promise}
- Source:
Retrieves attributes from a layer for a specified feature index
Parameters:
Name | Type | Description |
---|---|---|
childIndex |
String | index of the child layer to get attributes for |
Returns:
promise resolving with formatted attributes to be consumed by the datagrid and esri feature identify
- Type
- Promise