I’m trying to set the zoom level for layers but can’t get the minzoom level attribute to work. I only want my layers to show up under a 14 zoom level.
layout = {
mapbox: {
center: {
lon: 0,
lat: 0
},
zoom: 15.8,
style: 'mapbox://styles/mapbox/streets-v9',
"layers": layers
}
}
where layers is an array with elements of the form
layerElement = {
"source": {
"type": "FeatureCollection",
"features": laneFeatures,
"minzoom": 14
},
"type": "fill",
"color": "darkgrey",
"fill": { "outlinecolor": "black" },
"opacity": .9,
"minzoom": 14
}
and lane features is an array with elements of the form
featureElement = { "type": "Feature", ''geometry' : geoJSON object, 'minzoom' : 14 }
I’ve tried setting the “minzoom” attribute in multiple places but none of them work, the mapbox specs specify that minzoom should be set on each layer https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-minzoom
From an example I’ve seen on this forum (http://rickyreusser.com/plotly-mock-viewer/#mapbox_layers ), plotly has the “below” attribute that provides similar functionality to minzoom but is tied to features, not a specific zoom level.
Also the red contour line layer given by
color:"red"
line:Object
source:"mapbox://mapbox.mapbox-terrain-v2"
sourcelayer:"contour"
sourcetype:"vector"type:"line"
seems to make use of the minzoom level attribute, unfortunately I tried searching and couldn’t find a way to view what was given by the source specified.