Skip to content

Commit

Permalink
Merge pull request #60 from go-spatial/issue-56
Browse files Browse the repository at this point in the history
fixed source-layer on layer add bug
  • Loading branch information
justenPalmer authored Apr 10, 2019
2 parents 632b03f + 7710a22 commit 9b5ced6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/view/Vlayer/VlayerAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -69,8 +69,6 @@ export default class VlayerAdd extends React.Component {
}
id = newId;
}

console.log('id:',id);
this.setState({id:id});
}
this.setState({
Expand All @@ -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
Expand All @@ -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;

Expand Down

0 comments on commit 9b5ced6

Please sign in to comment.