# Module: contribs/gmf/src/themes

### Type Definitions

#### GmfBaseNode

Contains the common element of all the elements of the GeoMapFish layer tree.

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`id` | number |
`metadata` | module:contribs/gmf/src/themes~GmfMetaData | The related metadata.
`name` | string |

#### GmfFunctionalities

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`default_basemap` | Array.<string> | <optional> | The default base map.
`open_panel` | Array.<string> | <optional> | When set, contains the name of the panel to open upon loading an application. Note: although this is a list, only one can be defined.
`preset_layer_filter` | Array.<string> | <optional> | Name of the layer (data source) that should be toggled in the filter tool upon loading an application. Note: although this is a list, only one can be defined.

#### GmfGroup

A GeoMapFish group not an OpenLayers group neither a WMS group. This represent « first level group » (Block in the layer tree), or all sub nodes that's not a leaf. extends GmfBaseNode

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | number |  | (GmfBaseNode)
`metadata` | module:contribs/gmf/src/themes~GmfMetaData |  | (GmfBaseNode)
`name` | string |  | (GmfBaseNode)
`children` | Array.<(module:contribs/gmf/src/themes~GmfGroup|module:contribs/gmf/src/themes~GmfLayer)> |  |
`dimensions` | module:ngeo/datasource/OGC.js~Dimensions |  | The dimensions managed by the OpenLayers layer, if the value is null we will take the dimension from the application. This is present only on non mixed first level group.
`mixed` | boolean |  | A mixed group is a group on which one the layers comes from different sources, then all the sub GeoMapFish layers (leaf) will be an OpenLayers layer. By opposition a non mixed first level group contains only GeoMapFish layers WMS from the same server, then we have only one OpenLayers layer for all the first level group. All the group child will have the same value of his parent, In other word, all the group of a first level group will have the same value.
`ogcServer` | string | <optional> | On non mixed first level group it is the ogc server to use.
`time` | module:ngeo/datasource/OGC.js~TimeProperty | <optional> | On non mixed first level group with more then one time layer, it is the time information.
`popupId` | string | <optional> | a popup identifier for the associate submenu.

#### GmfLayer

A GeoMapFish layer not an OpenLayers layer neither a WMS layer. This is also the leaf of the tree. extends GmfBaseNode

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | number |  | (GmfBaseNode)
`metadata` | module:contribs/gmf/src/themes~GmfMetaData |  | (GmfBaseNode)
`name` | string |  | (GmfBaseNode)
`dimensions` | module:ngeo/datasource/OGC.js~Dimensions |  | The dimensions managed by the layer, if the value is null we will take the dimension from the application. Present only on layer in a mixed group.
`dimensionsFilters` | module:ngeo/datasource/OGC.js~DimensionsFiltersConfig |  | The dimensions applied by filters on the layer configuration, if the value is null we will take the dimension from the application.
`editable` | boolean | <optional> |
`style` | string | <optional> |
`type` | string |  | WMS or WMTS.
`ogcServer` | string | <optional> |
`popupId` | string | <optional> | A popup identifier for the associate submenu.
`layerType` | string |  | The layer type.

#### GmfLayerAttributeValue

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`label` | string |
`value` | string |

#### GmfLayerAttributeValuesResponse

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`items` | Array.<module:contribs/gmf/src/themes~GmfLayerAttributeValue> |

#### GmfLayerChildLayer

Additional attributes related on a WMS layers (or WFS features type).

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`getData` | boolean | undefined | <optional> | If the layer is queryable and this property is set to false, then the layer won't be used in queries issued. Defaults to `true`.
`maxResolutionHint` | number |  | The min resolution where the layer is visible.
`minResolutionHint` | number |  | The max resolution where the layer is visible.
`name` | string |  |
`queryable` | boolean |  |

#### GmfLayerWMS

extends GmfLayer

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | number |  | (GmfBaseNode)
`metadata` | module:contribs/gmf/src/themes~GmfMetaData |  | (GmfBaseNode)
`name` | string |  | (GmfBaseNode)
`dimensions` | module:ngeo/datasource/OGC.js~Dimensions |  | (GmfLayer)
`dimensionsFilters` | module:ngeo/datasource/OGC.js~DimensionsFiltersConfig |  | (GmfLayer)
`editable` | boolean | <optional> | (GmfLayer)
`style` | string | <optional> | (GmfLayer)
`type` | string |  | (GmfLayer)
`childLayers` | Array.<module:contribs/gmf/src/themes~GmfLayerChildLayer> |  |
`layers` | string |  | The comma separated list of WMS layers or groups.
`maxResolutionHint` | number |  | The max resolution where the layer is visible.
`minResolutionHint` | number |  | The min resolution where the layer is visible.
`ogcServer` | string | <optional> |
`time` | module:ngeo/datasource/OGC.js~TimeProperty | <optional> | The time information if the layer directly manage it, see also `{GmfGroup.time}`.

#### GmfLayerWMTS

extends GmfLayer

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | number |  | (GmfBaseNode)
`metadata` | module:contribs/gmf/src/themes~GmfMetaData |  | (GmfBaseNode)
`name` | string |  | (GmfBaseNode)
`dimensions` | module:ngeo/datasource/OGC.js~Dimensions |  | (GmfLayer)
`dimensionsFilters` | module:ngeo/datasource/OGC.js~DimensionsFiltersConfig |  | (GmfLayer)
`editable` | boolean | <optional> | (GmfLayer)
`style` | string | <optional> | (GmfLayer)
`type` | string |  | (GmfLayer)
`imageType` | string |  | 'image/png' or 'image/jpeg'.
`layer` | string |  |
`matrixSet` | string |  |
`url` | string |  |

#### GmfMetaData

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`copyable` | boolean | <optional> | false | Whether the geometry from this data source can be copied to other data sources or not. For WMS layers.
`directedFilterAttributes` | Array.<string> | <optional> |  | List of attribute names which should have rules already ready when using the filter tools. For WMS layers.
`disclaimer` | string | <optional> |  | The disclaimer text for this element. For WMS and WMTS layers, layer groups and themes.
`enumeratedAttributes` | Array.<string> | <optional> |  | List of attribute names which have enumerated attribute values (for filters purpose). For WMS layers.
`exclusiveGroup` | boolean | <optional> | false | Whether the group contains children that have to be mutually exclusive, meaning that only one child may be ON at any time.
`iconUrl` | string | <optional> |  | The URL of the icon to display in the layer tree. For WMS and WMTS layers.
`identifierAttributeField` | string |  |  | The field used in the 'display query window' as feature title. For WMS layers.
`isChecked` | boolean | undefined | <optional> | false | Is the layer checked by default. For WMS and WMTS layers.
`isExpanded` | boolean | undefined | <optional> | false | Whether the layer group is expanded by default. For layer groups (only).
`printNativeAngle` | boolean | <optional> | true | Whether the print should rotate the symbols. For layer groups (only).
`isLegendExpanded` | boolean | undefined | <optional> | false | Whether the legend is expanded by default. For WMS and WMTS layers.
`legend` | boolean | <optional> | false | Display the legend of this layers. For WMS and WMTS layers.
`legendImage` | string | <optional> |  | The URL to the image used as a legend in the layer tree. For WMS and WMTS layers.
`hiDPILegendImages` | Object.<string, string> | <optional> |  | The URLs to the hi DPI images used as a legend in the layer tree. For WMS and WMTS layers.
`legendRule` | string | <optional> |  | The WMS 'RULE' parameter used to display the icon in the layer tree. "Short version" of the 'iconURL' metadata for WMS layers. For WMS layers.
`maxQueryResolution` | number | <optional> |  | The max resolution where the layer is queryable. For WMTS layers.
`maxResolution` | number | <optional> |  | The max resolution where the layer is visible. For WMS layers. On WMTS layers it will have an effect on the node in the layertree but not on the layertree directly.
`metadataUrl` | string | <optional> |  | The URL to the information on this layer. For WMS and WMTS layers.
`minQueryResolution` | number | <optional> |  | The min resolution where the layer is queryable. For WMTS layers.
`minResolution` | number | <optional> |  | The min resolution where the layer is visible. For WMS layers. On WMTS layers it will have an effect on the node in the layertree but not on the layer directly.
`queryIconPosition` | Array.<number> | <optional> |  | values to define the shape (bbox) to use to query the layer. The values are used like a padding in css with 1, 2, 3 or 4 comma separated values: all / top-bottom, left-right / top, right-left, bottom / top, right, bottom, left.
`ogcServer` | string | <optional> |  | The corresponding OGC server for a WMTS layer. For WMTS layers.
`opacity` | number | <optional> | 1.0 | Layer opacity. 1.0 means fully visible, 0 means invisible, For WMS and WMTS layers.
`printLayers` | string | <optional> |  | A WMS layers (comma separated) that will be used instead of the WMTS layer in the print. Used to increase quality of printed WMTS layer. An OGCServer metadata must be set with the name of the OGC server to use for these wms layers. For WMTS layers.
`queryLayers` | string | <optional> |  | Layers names separate by a comma. For WMTS layers: The WMS layers used as references to query the WMTS layers. An OGCServer metadata must be set with the name of the OGC server to use for this wms layer. For WFS GetFeature request: The WFS layers that should be queried.
`thumbnail` | string | <optional> |  | The icon visible in the background selector. For WMS and WMTS layers.
`timeAttribute` | string | <optional> |  | The name of the time attribute. For WMS(-T) layers.
`snappingConfig` | module:contribs/gmf/src/themes~GmfSnappingConfig | <optional> |  | The snapping configuration for the leaf. If set, the leaf's layer is considered to be "snappable", even if the config itself is empty. Example value: {'tolerance': 50, 'edge': false} For WMS layers.
`wmsLayers` | string | <optional> |  | A corresponding WMS layers (comma separated) for WMTS layer. Used to query the WMTS layer and to print them. See also printLayers and queryLayers metadata for more granularity. An OGCServer metadata must be set with the name of the OGC server to use for these wms layers. For WMTS Layers.
`customOpenLayersOptions` | Object | <optional> |  | The custom OpenLayers WMS layer options.
`timeout` | number | <optional> |  | The fetch capabilities timeout in seconds. For WMTS Layers.

#### GmfOgcServer

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`credential` | boolean |  |
`imageType` | string |  | 'image/png' or 'image/jpeg'.
`isSingleTile` | boolean |  |
`namespace` | string | <optional> | Namespace
`type` | string |  | 'mapserver', 'qgisserver', 'geoserver' or 'other'.
`url` | string |  |
`urlWfs` | string |  | The WFS URL.
`wfsFeatureNS` | string | <optional> | WFS feature namespace
`wfsSupport` | boolean |  |
`attributes` | Object.<string, Object.<string, module:contribs/gmf/src/themes~GmfOgcServerAttribute>> |  |

#### GmfOgcServerAttribute

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`alias` | string | <optional> | The attribute alias.
`minOccurs` | string | <optional> | If not '0', then the attribute is considered required.
`namespace` | string |  | The attribute namespace.
`type` | string |  | The attribute type (in namspace).

#### GmfOgcServers

##### Type:

- Object.<string, module:contribs/gmf/src/themes~GmfOgcServer>

#### GmfRootNode

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`children` | Array.<module:contribs/gmf/src/themes~GmfGroup> |

#### GmfSnappingConfig

##### Type:

- Object

##### Properties:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`activated` | boolean | <optional> | true | Determines whether the snapping on this layer is activated by default.
`edge` | boolean | <optional> | true | Determines whethers the edges of features from the node layer can be snapped or not.
`tolerance` | number | <optional> | 10 | The tolerance in pixels the snapping should occur for the node layer.
`vertex` | boolean | <optional> | true | Determines whethers the vertices of features from the node layer can be snapped or not.

#### GmfTheme

The element we can select in the theme selector. extends GmfBaseNode

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`id` | number | (GmfBaseNode)
`metadata` | module:contribs/gmf/src/themes~GmfMetaData | (GmfBaseNode)
`name` | string | (GmfBaseNode)
`children` | Array.<module:contribs/gmf/src/themes~GmfGroup> | The first level layer groups.
`functionalities` | module:contribs/gmf/src/themes~GmfFunctionalities |

#### GmfThemes

##### Type:

- Object

#### GmfThemesResponse

##### Type:

- Object

##### Properties:

Name | Type | Description
--- | --- | ---
`background_layers` | Array.<(module:contribs/gmf/src/themes~GmfLayer|module:contribs/gmf/src/themes~GmfGroup)> |
`errors` | Array.<string> |
`ogcServers` | module:contribs/gmf/src/themes~GmfOgcServers |
`themes` | Array.<module:contribs/gmf/src/themes~GmfTheme> |