mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-30 21:50:32 +01:00
Fix for when 'layout.visibility' is undefined
This commit is contained in:
parent
b116eef147
commit
32edb48e16
1 changed files with 2 additions and 1 deletions
|
@ -209,6 +209,7 @@ export default class LayerEditor extends React.Component {
|
||||||
</LayerEditorGroup>
|
</LayerEditorGroup>
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const layout = this.props.layer.layout || {}
|
||||||
|
|
||||||
const items = {
|
const items = {
|
||||||
delete: {
|
delete: {
|
||||||
|
@ -220,7 +221,7 @@ export default class LayerEditor extends React.Component {
|
||||||
handler: () => this.props.onLayerCopy(this.props.layer.id)
|
handler: () => this.props.onLayerCopy(this.props.layer.id)
|
||||||
},
|
},
|
||||||
hide: {
|
hide: {
|
||||||
text: (this.props.layer.layout.visibility === "visible") ? "Hide" : "Show",
|
text: (layout.visibility === "none") ? "Show" : "Hide",
|
||||||
handler: () => this.props.onLayerVisibilityToggle(this.props.layer.id)
|
handler: () => this.props.onLayerVisibilityToggle(this.props.layer.id)
|
||||||
},
|
},
|
||||||
moveLayerUp: {
|
moveLayerUp: {
|
||||||
|
|
Loading…
Reference in a new issue