Skip to content

Commit

Permalink
Merge pull request #330 from BenediktSeidlSWM/layertree-click
Browse files Browse the repository at this point in the history
Select layers when clicking on title
  • Loading branch information
manisandro authored Sep 24, 2024
2 parents 6a84c81 + 647ab3a commit 7841ec2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/LayerTree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class LayerTree extends React.Component {
<div className={classnames(itemclasses)}>
{showExpander ? (<Icon className="layertree-item-expander" icon={expanderstate} onClick={() => this.groupExpandedToggled(layer, path, group.expanded)} />) : (<span className="layertree-item-expander" />)}
<Icon className="layertree-item-checkbox" icon={checkboxstate} onClick={() => this.itemVisibilityToggled(layer, path, visibility)} />
<span className="layertree-item-title" title={group.title}>{group.title}</span>
<span className="layertree-item-title" onClick={() => this.itemVisibilityToggled(layer, path, visibility)} title={group.title}>{group.title}</span>
{LayerUtils.hasQueryableSublayers(group) && this.props.allowSelectIdentifyableLayers ? (<Icon className={"layertree-item-identifyable " + identifyableClassName} icon="info-sign" onClick={() => this.itemOmitQueryableToggled(layer, path, omitqueryable)} />) : null}
<span className="layertree-item-spacer" />
<Icon className={optMenuClasses} icon="cog" onClick={() => this.layerMenuToggled(group.uuid)}/>
Expand Down Expand Up @@ -315,7 +315,7 @@ class LayerTree extends React.Component {
if (layer.type === "separator") {
title = (<input onChange={ev => this.props.changeLayerProperty(layer.uuid, "title", ev.target.value)} value={sublayer.title}/>);
} else {
title = (<span className="layertree-item-title" title={sublayer.title}>{sublayer.title}</span>);
title = (<span className="layertree-item-title" onClick={() => this.itemVisibilityToggled(layer, path, sublayer.visibility)} title={sublayer.title}>{sublayer.title}</span>);
}
let queryableicon = null;
if (this.props.allowSelectIdentifyableLayers) {
Expand Down
1 change: 1 addition & 0 deletions plugins/style/LayerTree.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ img.layertree-item-legend-tooltip {
overflow: hidden;
text-overflow: ellipsis;
flex: 0 1 auto;
cursor: pointer;
}

#LayerTree div.layertree-item-noresults {
Expand Down

0 comments on commit 7841ec2

Please sign in to comment.