Skip to content

Commit

Permalink
Fix annotations layer state
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed May 26, 2024
1 parent 9e0ee87 commit 24a64e7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/static/app/js/components/LayersControlAnnotations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AnnotationLayer extends React.Component{
super(props);

this.state = {
visible: true
visible: !!props.layer._map
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ class AnnotationLayer extends React.Component{

return (<div className="layers-control-layer layers-control-annotations">
<div className="layer-control-title">
<Checkbox bind={[this, 'visible']}/> <a className="layer-label" href="javascript:void(0)" onClick={this.handleFocus}><div className="annotation-name">{meta.name}</div></a> <a href="javascript:void(0)" onClick={this.handleDelete}><i className="fa fa-trash"></i></a>
<Checkbox bind={[this, 'visible']}/> <a className="layer-label" href="javascript:void(0)" onClick={this.handleFocus}><div className="annotation-name">{meta.name}</div></a> <a href="javascript:void(0)" onClick={this.handleDelete} title={_("Delete")}><i className="fa fa-trash"></i></a>
</div>
</div>);
}
Expand All @@ -90,8 +90,16 @@ export default class LayersControlAnnotations extends React.Component {
constructor(props){
super(props);

let visible = false;
for (let i = 0; i < props.layers.length; i++){
if (props.layers[i]._map){
visible = true;
break;
}
}

this.state = {
visible: props.visible,
visible,
expanded: props.expanded
};

Expand Down

0 comments on commit 24a64e7

Please sign in to comment.