TileServer GL: Maps with GL JSON styles from your server
Published Aug 31, 2016 Updated May 25, 2023
New open-source project TileServer GL has just been released in version 1.0 at the FOSS4G conference and is available on our GitHub:
With TileServer GL you can host vector tile maps on your own infrastructure, under your control, or even completely offline. The software takes care of serving the vector maps (PBFs, GL JSON styles, and all the assets), but also provides server-side rasterized tiles as a fallback.
Raster tiles look exactly the same as vector maps and are generated from vector tiles and GL JSON style on the server side with the MapBox GL Native rendering core made in C++.
The vector tiles allow for nicer maps, with a higher degree of interactivity and also decrease bandwidth to your server. The vector maps can be used in several web mapping libraries such as Leaflet Vector Tile Basemaps, MapTiler SDK JS, Maplibre GL JS, Mapbox GL JS or OpenLayers as well as native mobile applications for Android or iOS. The raster tiles can be used in almost any software including Leaflet or GIS tools (via XYZ, TileJSON, WMTS).
This way you can transition to the vector tiles wherever possible, but still have the raster tiles with the same look & feel without the need to write the map style twice in a different format.
The server can be easily set up to provide several different styles (in a modern GL JSON format), so you can have multiple maps for different use cases served from a single set of vector tiles. There are also endpoints serving static raster maps with the possibility to add polygon overlays simply by adding parameters to the URL. All the endpoints support scaling parameters so you always have HiDPI/retina, print-ready maps at your disposal.
The TileServer GL relies on other open-source projects, which have been under development for years. Most notably mapbox-gl-native, which we use for the server-side rendering and MapTiler SDK JS which is default viewer for vector tiles.
This video shows in the first two minutes how easy it is to run your own map server using TileServer GL with open-data tiles downloaded from OSM2VectorTiles:
All what you need is a single docker command:
docker run -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl
Feel free to try our TileServer GL live instance at https://maps.klokantech.com/.
It’s also possible to combine multiple input sources (MBTiles; tiles from Amazon S3 or GCS; dynamic tiles from GeoServer, MapServer, …) to create complex or even hybrid maps (satellite maps with labels). The whole stack is usable with custom coordinate systems as well!
If you are interested to know more watch the complete video recording of our presentation from FOSS4G at https://youtu.be/rOg4VnSAnI4.
Considering transition to vector tiles? Do you want production deploy of TileServer GL? Need to render your own vector or raster tiles? Contact us at email@example.com!ible to combine multiple input sources (MBTiles; tiles from Amazon S3 or GCS; dynamic tiles from GeoServer, MapServer, …) to create complex or even hybrid maps (satellite maps with labels). The whole stack is usable with custom coordinate systems as well!