Skip to content

Configuring plugins

To configure the plugins used by your application, a dedicated section is available in the localConfig.json configuration file:

1
2
3
"plugins": {
  ...
}

Inside the plugins section, several modes can be configured (e.g. desktop or mobile), each one with its own list of plugins:

1
2
3
4
"plugins": {
  "mobile": [...],
  "desktop": [...]
}

Each plugin can be simply listed (and the default configuration is used):

1
2
3
4
"plugins": {
  ...
  "desktop": ["Map", "MousePosition", "Toolbar", "TOC"]
}

or fully configured:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
"plugins": {
  ...
  "desktop": [{
    "name": "Map",
       ...
    }
  },
  ...
  ]
}

Dynamic configuration

Configuration properties of plugins can use expressions, so that they are dynamically bound to the application state.

An expression is anything between curly brackets ({...}) that is a javascript expression, where the monitored state of the application is available as a set of variables.

To define the monitored state, you have to add a monitorState property in localConfig.json.

1
2
3
4
5
{
  ...
  "monitorState": [{"name": "mapType", "path": "mapType.mapType"}]
  ...
}

Where: * name is the name of the variable that can be used in expressions * path is a javascript object path to the state fragment to be monitored (e.g. map.present.zoom)

When you have a monitored state, you can use it in configuration properties this way: Be sure to write a valid javascript expression.

1
2
3
4
5
"cfg": {
  ...
  "myProp": "{state('mapType') === 'openlayers' ? 1 : 2}"
  ...
}

Expressions are supported in cfg properties and in hideFrom and showIn sections.

In addition to monitored state also the page request parameters are available as variables to be used in expressions.

Look at the plugin reference page for a list of available configuration properties.