defaultBackgroundLayerPredicate function
accepts layers that are:
- of type
background
- of type
fill
that use source layerlandcover
orwater
Implementation
bool defaultBackgroundLayerPredicate(Map<String, dynamic> layer) {
final type = layer['type'];
if (type == 'background') {
return true;
} else if (type == 'fill') {
final sourceLayer = layer['source-layer'];
return (sourceLayer == 'landcover' || sourceLayer == 'water');
}
return false;
}