I want to show secondary/tertiary roads at a zoom level like 10 or 11. At that zoom level I only see the primary roads, I did try to style it with carto css, but its not working.
Thank you
[class='secondary'][zoom>=11] {
line-color: red;
line-dasharray: 2,1;
line-width: 19.2;
}
It's not possible.
The mapbox-streets-v6 vector dataset that ships with Mapbox Studio Classic only has certain vector data layers at each zoom level. The waterway data does not appear in this dataset at any zoom lower than 8, which is why you can't style it at any other zoom level.
Fortunately, this data comes from OpenStreetMap, so you can add it as a custom source in Mapbox Studio Classic and style it along with the other data! There is even a guide on grabbing this data from OpenStreetMap with Overpass Turbo.
Related
GOAL
I'm using Mapbox to generate raster tilesets from raw GeoTIFFs. The GeoTIFFs have a resolution such that a single pixel represents roughly a 5km x 5km square on the map. The generated raster tilesets will be hosted on Mapbox and then displayed in a Mapbox GL JS application.
PROBLEM
The issue I'm running into is extreme blurriness at high zoom levels. Below is a section of central Nigeria at about a zoom level of 7 displayed in our Mapbox GL JS app vs. the raw GeoTiff viewed in QGIS. The blurriness is of course worse at even higher zooms.
I created this raster tileset by uploading a sample GeoTIFF into Mapbox Studio (I've also used the Uploads API). The Tileset viewer in Studio displays a footnote that reads:
Zoom Extent
z0 – z5. Data will be overzoomed to z22, but simplified past 5.
I can verify this by looking at the network requests in the dev tools as I zoom in on the map – it actually seems that no new tiles are requested above z4.
QUESTION
Does Mapbox have any way to manually configure the zoom extent (specifically, the max zoom) for which raster tilesets are generated?
WHAT I'VE TRIED/RESEARCHED
I’ve clicked through to the Adjust Tileset Zoom Extent help page, which states:
For raster tilesets, the uploaded image resolution sets the minzoom
and maxzoom levels. Higher resolution images will result in the
tileset rendering at more zoom levels.
Again, the data I'm working with is of fixed resolution so I'm hoping to find a way to have tilesets generated for higher zoom levels regardless of image resolution. Mapbox Tiling Service and Tippecanoe both have custom configuration rules for specifying the max zoom (past which, simplification occurs) when creating vector tilesets. However, neither seems to handle rasters. The Uploads API does handle raster tilesets, but doesn't seem to have any zoom extent configuration options.
I've also tried adjusting various frontend configuration options in the Mapbox GL JS client like the source tileSize and the raster-resampling paint property, but to little avail. I'm definitely open to other suggestions for how to get crisp pixels at higher zoom levels, but mostly hoping there's some simple method I'm missing for getting Mapbox to generate raster tiles past z4/z5. I think even z0-z7 would be sufficient.
I'm using mapbox studio to customize a map and I haven't found the way to display building-outline layer at any zoom level.
If I'm under of 16 zoom level, this layer disappears... even if I force opacity to 1.
Any idea ?
Thank you in advance
The minimum zoom level for the buildings layer in the current tileset (Mapbox Streets v8) is 13.
This means that if you zoom out further (from 12 to 0) the buildings layer will not be rendered on the map.
See documentation:
https://docs.mapbox.com/vector-tiles/reference/mapbox-streets-v8/#layer-reference
The reason for this restriction is that if you requested your browser to fetch and render every building polygon in a wider area (like an entire city or country), this would be more than a reasonable amount of data to render.
If you have your own buildings polygon data and you create a tileset from that, you could choose to include your data across more zoom levels. However, you might waste a lot of computing resources drawing shapes that are too tiny to understand at those further zoom levels.
I'm filtering on the 'poi-label' layer on the default Mapbox Streets V8 data source. What I'd like to have is that certain maki or class labels like 'fitness-centere' to always be visible (both icon and label) regardless of the zoom level.
I see no clear documentation on how to do this using Mapbox studio. Can it be done in that tool?
It is generally not possible to have layers in vector tile sources display at "all zoom levels" because they don't exist at all zoom levels within the vector tile sources.
Generally, the Mapbox tilesets are heavily optimised and only include data at the zoom levels that they are intended to display at in the corresponding Mapbox styles.
I've been working with a leaflet map using the mapbox outdoors raster tile server. Mapbox has a handful of ready-made styles, most of which are listed in this answer. The code / url for this is like so:
var mapBoxOutdoorsClassic = L.tileLayer('https://api.tiles.mapbox.com/v4/mapbox.outdoors/{z}/{x}/{y}.png?access_token={accessToken}', {
accessToken: '...',
attribution: '...',
maxZoom: 18,
}).addTo(map1);
I love this style. But my issue is that I'm trying to add an imageoverly. I want the imageoverlay to be above the map terrain graphics, but under the labels. So what I did was go into mapbox studio and create these two styles - basically the outdoors style, with the labels separated out:
Without Labels
Labels Only
Here's a codesandbox comparing the raster and mapbox studio styles
The old style is on the left, the new styles with the separated out layers is on the right. You can play with the layers in the upper right corner.
So separating the layers out has worked well, as you can see in the codesandbox. But the styles from the raster tiles are not really the same as the ones from mapbox studio! I'm guessing the raster tiles are from a few years ago, and the styles have been updated since. But I really like the older style - it has more of a colored pencil feel to it, more of a national parks map style, as opposed to the new style which has more of an OSM or google maps feel. Rather than spend hours in mapbox studio trying to recreate the old style, does anyone know if these styles exist somewhere within mapbox studio? Perhaps a 'mapbox outdoors classic'? I really just want the exact styles are show in the map on the left in my codesandbox, but with the ability to separate the labels layer from the rest.
With Mapbox Studio style components, it's actually pretty quick to recreate older Mapbox styles in the modern Mapbox Studio. In fact, here's a five minute video from Mapbox showing how to recreate the classic Mapbox Outdoors in modern Studio!
How to update a classic style in modern Mapbox Studio
I am working styling a map in MapBox studio. I am trying to make the road class path show up at a zoom level less than 14. As soon as I go to level 13 or less the paths all disappear. Does anyone know how to make the paths show up at levels 12 and 13?
I have tried this in my css.
[class='path'] {
::path[zoom>=10]['mapnik::geometry_type'=2] {
line-join: round;
line-width: 1.0;
}
}
The mapbox-streets-v5 vector dataset that ships with Mapbox Studio only has certain vector data layers at each zoom level. The path data does not appear in this dataset at any zoom lower than 14, which is why you can't style it at any other zoom level.
Fortunately, this data comes from OpenStreetMap, so you can add it as a custom source in Mapbox Studio and style it along with the other data! There is even a guide on grabbing this data from OpenStreetMap with Overpass Turbo.