@@ -320,7 +320,6 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
320320
321321 _createMVTBaseLayer ( layerInfo , addedCallback ) {
322322 let url = layerInfo . dataSource . url ;
323- const visible = layerInfo . visible ;
324323 if ( url . indexOf ( '/restjsr/' ) > - 1 && ! / \/ s t y l e \. j s o n $ / . test ( url ) ) {
325324 url += '/style.json' ;
326325 }
@@ -334,7 +333,7 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
334333 return ;
335334 }
336335 style . layers . forEach ( layer => {
337- layer . layout && ( layer . layout . visibility = visible ? 'visible' : 'none' ) ;
336+ layer . layout && ( layer . layout . visibility = this . _getVisibility ( layerInfo . visible ) ) ;
338337 } )
339338 this . map . addStyle ( style ) ;
340339 const layerIds = [ ] ;
@@ -2410,7 +2409,7 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
24102409 minzoom : minzoom || 0 ,
24112410 maxzoom : maxzoom || 22 ,
24122411 layout : {
2413- visibility : visibility ? 'visible' : 'none'
2412+ visibility : this . _getVisibility ( visibility )
24142413 }
24152414 } ,
24162415 parentLayerId
@@ -2981,5 +2980,10 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
29812980 _isDataflowLayer ( layerType ) {
29822981 return layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT' ;
29832982 }
2983+
2984+ _getVisibility ( visible ) {
2985+ const visibility = ( visible === true || visible === 'visible' ) ? 'visible' : 'none' ;
2986+ return visibility ;
2987+ }
29842988 } ;
29852989}
0 commit comments