Mapbox Studio Classic source manual | Mapbox

With Mapbox Studio Classic, you can import custom sources. This manual will take a deep dive into important features and recommendations for preparing your sources. A Mapbox Studio Classic source project is stored in a single directory with a .tm2source file extension. A typical source project directory looks like this: If your upload is rejected then the next step is to optimize your source to ensure the vector tiles are smaller. There are many ways to do this. Below are several workflows for how to do this with specific considerations for geometry type - point, line, or polygon: In the Settings panel, you can change the minzoom and maxzoom for the source. These values define which zoom levels will be included in your source. The ability to display data at higher zoom levels is referred to as overzooming. Overzooming allows for great efficiency in creating and storing vector tiles by reducing the number of tiles required by several orders of magnitude. As a general rule, vector tiles are useful for about 4-6 levels of overzooming. For example, the data in a zoom level 14 tile can be stretched out and look great up to zoom level 18 or 20. When you import a data source using Add layer, you can set the buffer for the source. A buffer on a layer allows you to include extra data around the outside of each tile. Depending on the data and desired styles this can be necessary to ensure seamless rendering across tile boundaries. Tile buffers are set individually for each layer, different layers have different requirements and it’s important to make boundaries no larger than necessary in order to keep the size of your vector tiles to a minimum. The value for the buffer setting is in pixels (assuming that the vector tile is rendered at 256×256 pixels). Also note that tile buffers get stretched along with the rest of the tile when overzooming. A z14 layer with an 8 pixel buffer will actually have a 16 pixel buffer if shown overzoomed at z15, 32 pixels at z16, and so on. Placing text labels on polygons doesn’t work quite like in TileMill. With vector tiles, a polygon might be split across many vector tiles, so if you use text-placement: point, you will end up with lots of duplicate labels. As a workaround, you will need to create a layer containing the centroid of each polygon, and use that for polygon labeling. If your polygons are saved as Shapefile or GeoJSON then you can use QGIS, an open source desktop GIS tool, to generate an additional layer. Using PostGIS you can perform the centroid computation on the fly using ST_PointOnSurface(). Create a new layer, with an SQL query such as: In Mapbox Studio Classic’s source editor, you can drag and drop layers in the layer list to reorder them. This is helpful when you’ve added multiple layers to single source project. The order they’re listed here will be the order they’re stored in the vector tiles and the default order styles will use to draw. Layers at the top of the list will be drawn on top of layers further down. Check out our PostGIS Manual for more details on how to use PostGIS + SQL with Mapbox Studio Classic to create fast, performant vector tiles. The Natural Earth Mapbox Studio Classic project is a great example of a full Mapbox Studio Classic source and includes advanced PostgreSQL tricks like having multiple tables in one layer and scale-aware queries. Source.

Яндекс.Метрика Рейтинг Free Web Counter
page counter
Last Modified: April 18, 2016 @ 8:11 pm