diff --git a/web/client/components/TOC/DefaultLayer.jsx b/web/client/components/TOC/DefaultLayer.jsx index bc03e21662..23bd42287a 100644 --- a/web/client/components/TOC/DefaultLayer.jsx +++ b/web/client/components/TOC/DefaultLayer.jsx @@ -54,7 +54,8 @@ var DefaultLayer = React.createClass({ groups: React.PropTypes.array, currentZoomLvl: React.PropTypes.number, scales: React.PropTypes.array, - additionalTools: React.PropTypes.array + additionalTools: React.PropTypes.array, + legendOptions: React.PropTypes.object }, getDefaultProps() { return { @@ -145,7 +146,7 @@ var DefaultLayer = React.createClass({ } return (
{tools}
-
+
); }, renderTools() { diff --git a/web/client/components/TOC/fragments/WMSLegend.jsx b/web/client/components/TOC/fragments/WMSLegend.jsx index 9d4517a8eb..2996fbf472 100644 --- a/web/client/components/TOC/fragments/WMSLegend.jsx +++ b/web/client/components/TOC/fragments/WMSLegend.jsx @@ -12,19 +12,24 @@ var Legend = require('./legend/Legend'); var WMSLegend = React.createClass({ propTypes: { node: React.PropTypes.object, + legendContainerStyle: React.PropTypes.object, + legendStyle: React.PropTypes.object, showOnlyIfVisible: React.PropTypes.bool, currentZoomLvl: React.PropTypes.number, scales: React.PropTypes.array }, getDefaultProps() { return { + legendContainerStyle: { + marginLeft: "15px" + }, showOnlyIfVisible: false }; }, render() { let node = this.props.node || {}; if (this.canShow(node) && node.type === "wms" && node.group !== "background") { - return
; + return
; } return null; }, diff --git a/web/client/components/TOC/fragments/legend/Legend.jsx b/web/client/components/TOC/fragments/legend/Legend.jsx index dc119d2081..d0bc34abb8 100644 --- a/web/client/components/TOC/fragments/legend/Legend.jsx +++ b/web/client/components/TOC/fragments/legend/Legend.jsx @@ -12,6 +12,7 @@ const Legend = React.createClass({ legendHeigth: React.PropTypes.number, legendWidth: React.PropTypes.number, legendOptions: React.PropTypes.string, + style: React.PropTypes.object, currentZoomLvl: React.PropTypes.number, scales: React.PropTypes.array }, @@ -19,7 +20,8 @@ const Legend = React.createClass({ return { legendHeigth: 12, legendWidth: 12, - legendOptions: "forceLabels:on;fontSize:10" + legendOptions: "forceLabels:on;fontSize:10", + style: {maxWidth: "100%"} }; }, render() { @@ -53,7 +55,7 @@ const Legend = React.createClass({ pathname: urlObj.pathname, query: query }); - return ; + return ; } return null; }