@@ -320,7 +320,6 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
320
320
321
321
_createMVTBaseLayer ( layerInfo , addedCallback ) {
322
322
let url = layerInfo . dataSource . url ;
323
- const visible = layerInfo . visible ;
324
323
if ( url . indexOf ( '/restjsr/' ) > - 1 && ! / \/ s t y l e \. j s o n $ / . test ( url ) ) {
325
324
url += '/style.json' ;
326
325
}
@@ -334,7 +333,7 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
334
333
return ;
335
334
}
336
335
style . layers . forEach ( layer => {
337
- layer . layout && ( layer . layout . visibility = visible ? 'visible' : 'none' ) ;
336
+ layer . layout && ( layer . layout . visibility = this . _getVisibility ( layerInfo . visible ) ) ;
338
337
} )
339
338
this . map . addStyle ( style ) ;
340
339
const layerIds = [ ] ;
@@ -2410,7 +2409,7 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
2410
2409
minzoom : minzoom || 0 ,
2411
2410
maxzoom : maxzoom || 22 ,
2412
2411
layout : {
2413
- visibility : visibility ? 'visible' : 'none'
2412
+ visibility : this . _getVisibility ( visibility )
2414
2413
}
2415
2414
} ,
2416
2415
parentLayerId
@@ -2981,5 +2980,10 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
2981
2980
_isDataflowLayer ( layerType ) {
2982
2981
return layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT' ;
2983
2982
}
2983
+
2984
+ _getVisibility ( visible ) {
2985
+ const visibility = ( visible === true || visible === 'visible' ) ? 'visible' : 'none' ;
2986
+ return visibility ;
2987
+ }
2984
2988
} ;
2985
2989
}
0 commit comments