Skip to content

Commit 4b00bad

Browse files
[Maps] Only show legend when layer is visible (#53781)
1 parent 22b8335 commit 4b00bad

File tree

1 file changed

+4
-1
lines changed
  • x-pack/legacy/plugins/maps/public/connected_components/widget_overlay/layer_control/layer_toc/toc_entry

1 file changed

+4
-1
lines changed

x-pack/legacy/plugins/maps/public/connected_components/widget_overlay/layer_control/layer_toc/toc_entry/view.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export class TOCEntry extends React.Component {
4646
};
4747

4848
async _loadHasLegendDetails() {
49-
const hasLegendDetails = await this.props.layer.hasLegendDetails();
49+
const hasLegendDetails =
50+
(await this.props.layer.hasLegendDetails()) &&
51+
this.props.layer.isVisible() &&
52+
this.props.layer.showAtZoomLevel(this.props.zoom);
5053
if (this._isMounted && hasLegendDetails !== this.state.hasLegendDetails) {
5154
this.setState({ hasLegendDetails });
5255
}

0 commit comments

Comments
 (0)