File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ MainTab {
5858 }
5959
6060 SolutionTabComponents .SolutionMapTab {
61+ visible: Globals .enableMap
6162 }
6263 }
6364 }
Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ function setupLayers() {
130130}
131131
132132function syncCrumbCoords ( ) {
133- map . getSource ( 'breadcrumb' ) . setData ( {
133+ let breadcrumb = map . getSource ( 'breadcrumb' ) ;
134+ if ( breadcrumb === undefined ) return ;
135+ breadcrumb . setData ( {
134136 type : 'Feature' ,
135137 geometry : {
136138 type : 'LineString' ,
@@ -142,10 +144,12 @@ function syncCrumbCoords(){
142144function syncLayers ( ) {
143145 // sync route datas with stored points
144146 for ( let i = 0 ; i < lines . length ; i ++ ) {
145- map . getSource ( `route${ i } ` ) . setData ( data [ i ] ) ;
147+ let route = map . getSource ( `route${ i } ` ) ;
148+ if ( route !== undefined ) route . setData ( data [ i ] ) ;
146149 }
147150 // clear protection, since its only one point and temporary
148- map . getSource ( 'prot' ) . setData ( {
151+ let prot = map . getSource ( 'prot' ) ;
152+ if ( prot !== undefined ) prot . setData ( {
149153 type : 'FeatureCollection' ,
150154 features : [ ]
151155 } ) ;
You can’t perform that action at this time.
0 commit comments