Skip to content

Commit

Permalink
Documented TOC plugin with legend style options (#1872)
Browse files Browse the repository at this point in the history
* Documented TOC plugin with legend style options
  • Loading branch information
offtherailz authored May 29, 2017
1 parent 399e62c commit 897288c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"web/client/plugins/ScrollTop.jsx",
"web/client/plugins/Search.jsx",
"web/client/plugins/SearchServicesConfig.jsx",
"web/client/plugins/TOC.jsx",
"web/client/plugins/ZoomIn.jsx",
"web/client/plugins/ZoomOut.jsx"
]
Expand Down
26 changes: 24 additions & 2 deletions web/client/plugins/TOC.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016, GeoSolutions Sas.
* All rights reserved.
*
Expand Down Expand Up @@ -284,7 +284,29 @@ const LayerTree = React.createClass({
return this.renderTOC();
}
});

/**
* TOC plugins
* @name TOC
* @class
* @memberof plugins
* @prop {boolean} cfg.activateQueryTool
* @prop {object} cfg.layerOptions: options to pass to the layer.
* Some of the layerOptions are: `legendContainerStyle`, `legendStyle`. These 2 allow to customize the legend:
* For instance you can pass some stying props to the legend.
* this example is to make the legend scrollable horizontally
* ```
* "layerOptions": {
* "legendOptions": {
* "legendContainerStyle": {
* "overflowX": "auto"
* },
* "legendStyle": {
* "maxWidth": "250%"
* }
* }
* }
```
*/
const TOCPlugin = connect(tocSelector, {
groupPropertiesChangeHandler: changeGroupProperties,
layerPropertiesChangeHandler: changeLayerProperties,
Expand Down

0 comments on commit 897288c

Please sign in to comment.