Use first vector source for OL3

This commit is contained in:
Lukas Martinelli
2017-01-10 14:05:25 +01:00
parent 7ff0ac9bb5
commit b470885263
3 changed files with 80 additions and 43 deletions

View File

@@ -66,7 +66,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]
'source-layer': this.state['source-layer'] || (nextProps.sources[sourceIds[0]] || [])[0]
})
}
}