Skip to content

Commit

Permalink
Refresh map tool can be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnafu committed Jul 18, 2017
1 parent 54e7606 commit be0f21b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions web/client/plugins/TOC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class LayerTree extends React.Component {
groups: PropTypes.array,
settings: PropTypes.object,
querypanelEnabled: PropTypes.bool,
refreshMapEnabled: PropTypes.bool,
groupStyle: PropTypes.object,
groupPropertiesChangeHandler: PropTypes.func,
layerPropertiesChangeHandler: PropTypes.func,
Expand Down Expand Up @@ -267,6 +268,7 @@ class LayerTree extends React.Component {
buttonSize: "small"
},
querypanelEnabled: false,
refreshMapEnabled: true,
layerOptions: {},
groupOptions: {},
spatialOperations: [
Expand All @@ -287,6 +289,16 @@ class LayerTree extends React.Component {
return group.name !== 'background';
};

renderRefreshMap = () => {
return (
<div>
<Button onClick={this.props.onRefresh} bsSize="xsmall"><Glyphicon glyph="refresh"/></Button>
<RefreshLayers/>
<RefreshLayer/>
</div>
);
};

renderTOC = () => {
const Group = (<DefaultGroup onSort={this.props.onSort}
{...this.props.groupOptions}
Expand Down Expand Up @@ -330,9 +342,7 @@ class LayerTree extends React.Component {
scales={this.props.scales}/>);
return (
<div className="mapstore-toc">
<Button onClick={this.props.onRefresh} bsSize="xsmall"><Glyphicon glyph="refresh"/></Button>
<RefreshLayers/>
<RefreshLayer/>
{this.props.refreshMapEnabled ? this.renderRefreshMap() : null}
<TOC onSort={this.props.onSort} filter={this.getNoBackgroundLayers}
nodes={this.props.groups}>
<DefaultLayerOrGroup groupElement={Group} layerElement={Layer}/>
Expand Down

0 comments on commit be0f21b

Please sign in to comment.