File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,15 @@ export default class VlayerAdd extends React.Component {
3636 //return;
3737 //}
3838
39- const rec = {
39+ let rec = {
4040 id :this . state . id ,
4141 source :this . state . source ,
4242 type :this . state . type ,
43- 'source-layer' :this . state [ 'source-layer' ]
4443 } ;
4544
45+ if ( this . state [ 'source-layer' ] ) rec [ 'source-layer' ] = this . state [ 'source-layer' ]
46+
4647 Mlayer . add ( rec ) . then ( ( layer ) => {
47- console . log ( 'added:' , layer ) ;
4848 handle . route ( 'layer/' + layer . id ) ;
4949 } ) . catch ( ( e ) => {
5050 this . setState ( { error :e } ) ;
@@ -69,8 +69,6 @@ export default class VlayerAdd extends React.Component {
6969 }
7070 id = newId ;
7171 }
72-
73- console . log ( 'id:' , id ) ;
7472 this . setState ( { id :id } ) ;
7573 }
7674 this . setState ( {
@@ -86,7 +84,6 @@ export default class VlayerAdd extends React.Component {
8684 if ( this . state [ 'source-layer' ] ) parts . push ( this . state [ 'source-layer' ] ) ;
8785 if ( this . state . type ) parts . push ( this . state . type ) ;
8886 const id = parts . join ( '.' ) ;
89- console . log ( 'id:' , id ) ;
9087 this . setState ( {
9188 id :id ,
9289 error :null
@@ -102,8 +99,6 @@ export default class VlayerAdd extends React.Component {
10299 const typeOptions = Mlayer . getTypes ( ) ;
103100 const sourceOptions = Msource . getOptions ( ) ;
104101
105- console . log ( 'source:' , this . state . source ) ;
106-
107102 const sourceLayerOptions = ( this . state . source ) ? Msource . getLayerOptions ( this . state . source ) :
108103 null ;
109104
You can’t perform that action at this time.
0 commit comments