Contents
Where can I find vector tiles in Mapbox?
Such vector tiles could be opened in the MapBox Studio as a source, or displayed with MapBox GL JS WebGL viewer.
How to read tiles from a.mbtiles file?
To read tiles from a .mbtiles source as exported by Mapbox Studio, you need the node-mbtiles tilelive module. Side note: Current Mapbox Studio has a bug under Windows and OS X that prevents an exported .mbtiles file to show up at your chosen destination.
How to create a virtual machine for tileserver?
Under Mac OS X and Windows it runs in a couple of minutes with the Kitematic graphical user interface: https://kitematic.com/. In Kitematic just search for “tileserver-php” and start the ready to use container/virtual machine with the project inside.
How to host your own vector tile server?
As pointed out by @Greg, instead of TileStream (my first attempt) you should use Tilelive to host your own vector tiles. Tilelive isn’t a server itself but a backend framework that deals with tiles in different formats from different sources.
What should the buffer setting be in Mapbox GL JS?
If you see rendering bugs around tile boundaries, increase the buffer setting to a value between 0 and 128, the default for a Mapbox GL JS GeoJSON source. Ultimately smaller buffers are faster because they make the vector tiles smaller. At low zoom levels, consider clustering dense point data sources.
How to cluster data sources in Mapbox GL JS?
At low zoom levels, consider clustering dense point data sources. This makes tiles smaller and faster to load, layers faster to render, and data easier to understand. For more information on how to cluster your data, explore the cluster documentation and the accompanying Mapbox GL JS example.
How to minify GeoJSON in Mapbox GL JS?
As a final step, minify your GeoJSON with a tool of your choice to remove whitespace and decrease the file size. If possible, consider loading your GeoJSON from a data URL instead of holding it in a JavaScript object and passing to a Mapbox GL GeoJSON Source.