Skip to content

Commit

Permalink
[Maps] Only show legend when layer is visible (elastic#53781)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck authored Dec 26, 2019
1 parent 22b8335 commit 4b00bad
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export class TOCEntry extends React.Component {
};

async _loadHasLegendDetails() {
const hasLegendDetails = await this.props.layer.hasLegendDetails();
const hasLegendDetails =
(await this.props.layer.hasLegendDetails()) &&
this.props.layer.isVisible() &&
this.props.layer.showAtZoomLevel(this.props.zoom);
if (this._isMounted && hasLegendDetails !== this.state.hasLegendDetails) {
this.setState({ hasLegendDetails });
}
Expand Down

0 comments on commit 4b00bad

Please sign in to comment.