Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented TOC plugin with legend style options #1872

Merged
merged 2 commits into from
May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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