From 7710a224e8c47e398cf6f6aa8abe9b4627ae0492 Mon Sep 17 00:00:00 2001 From: jPalmer Date: Wed, 10 Apr 2019 12:30:44 -0700 Subject: [PATCH] fixed source-layer on layer add bug --- src/view/Vlayer/VlayerAdd.jsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/view/Vlayer/VlayerAdd.jsx b/src/view/Vlayer/VlayerAdd.jsx index c1dd4c6..998321b 100644 --- a/src/view/Vlayer/VlayerAdd.jsx +++ b/src/view/Vlayer/VlayerAdd.jsx @@ -36,15 +36,15 @@ export default class VlayerAdd extends React.Component { //return; //} - const rec = { + let rec = { id:this.state.id, source:this.state.source, type:this.state.type, - 'source-layer':this.state['source-layer'] }; + if (this.state['source-layer']) rec['source-layer'] = this.state['source-layer'] + Mlayer.add(rec).then((layer)=>{ - console.log('added:',layer); handle.route('layer/'+layer.id); }).catch((e)=>{ this.setState({error:e}); @@ -69,8 +69,6 @@ export default class VlayerAdd extends React.Component { } id = newId; } - - console.log('id:',id); this.setState({id:id}); } this.setState({ @@ -86,7 +84,6 @@ export default class VlayerAdd extends React.Component { if (this.state['source-layer']) parts.push(this.state['source-layer']); if (this.state.type) parts.push(this.state.type); const id = parts.join('.'); - console.log('id:',id); this.setState({ id:id, error:null @@ -102,8 +99,6 @@ export default class VlayerAdd extends React.Component { const typeOptions = Mlayer.getTypes(); const sourceOptions = Msource.getOptions(); - console.log('source:',this.state.source); - const sourceLayerOptions = (this.state.source)? Msource.getLayerOptions(this.state.source): null;