Configuring OMA Object Attribute Viewer
Overview
The OMA map selection attribute viewer (Attributes dialog box) allows you to view a selected object's attributes. By default, all of the object's attributes contained in the GeoJSON file will be shown. The GeoJSON file can be configured to include attributes on objects based on object class (see “GeoJSON Configuration File”). You can configure the presentation of the attributes in the Attribute dialog box; for example, you may set which attributes to display, their attribute names, and the order presented. The Show Source Attributes option on the Attributes dialog box allows you to see all of the attributes on an object, which may be needed for support or debugging.
Configuration
The attribute viewer configuration is defined in the OMA project's src/js/resources/config/map.js file where you can define the attribute labels and the order of objects. If a layout is not defined for a object, the default is to show all attributes on the object.
Use this definition to describe the attribute table layout:
self.tableViewerConfig = [
 
{
matchLayerNames: [<layer names to match> ],
matchAttributes: [ {name:<match-attribute-name>,values:[ <match-attribute-values>, .... ]},... ],
attributes: [
{attributeName: <attribute-name>, attributeLabel: <attribute-label>}, ....
]
}, ....
]
<layer names to match> will come from the feature.feature.feature_layer.name value from the map object.
<match-attribute-name> will come from the feature.feature.attributes list and the value must match one of the <match-attribute-values>.
 
If no matchingAttributes listed, it will be considered a match.
If more than one matchingAttributes are given, they all must match.
Available condition attributes can be configured using a view with the "_oma_view" suffix. For example, create a view called HOLDS_OMA_VIEW on the HOLDS table and join safety documents, sheet information, and device attributes as desired.
tableViewerConfigs will be processed in order, and the first match will be used.
 
Example
self.tableViewerConfig = [
{
matchingLayerNames: [
"Conditions"
],
matchingAttributes: [{name:"LINK_TYPE",values:["associated_document"]}],
attributes: [
{ attributeName: "LINK_TYPE", attributeLabel: "Condition Type" },
{ attributeName: "TEXT", attributeLabel: "File Name" },
{ attributeName: "TIME", attributeLabel: "Date/Time" },
{ attributeName: "OBJECT", attributeLabel: "Device" }
]
}
]