diff --git a/src/components/Toolbar.jsx b/src/components/Toolbar.jsx index 3425f86..e9d6c26 100644 --- a/src/components/Toolbar.jsx +++ b/src/components/Toolbar.jsx @@ -159,9 +159,9 @@ export default class Toolbar extends React.Component { 0) { this.state.source = Object.keys(this.props.sources)[0] + this.state['source-layer'] = this.props.sources[this.state.source][0] } } @@ -39,6 +59,7 @@ class AddModal extends React.Component { if(!this.state.source && sourceIds.length > 0) { this.setState({ source: sourceIds[0], + 'source-layer': this.state['source-layer'] || nextProps.sources[sourceIds[0]][0] }) } } @@ -68,6 +89,9 @@ class AddModal extends React.Component { value={this.state['source-layer']} onChange={v => this.setState({ 'source-layer': v })} /> + } }