Tilehut.js is a project by:
Take all the best things about the interactivity of the web and couple it with the exploratory nature of maps, and you get the modern web map tile. Tiles are one of the fundamental building blocks of modern web maps, providing a clever solution to zoom, pan, click, and interact with the infinity of discoverable things living in geospace. Underlying map tiles is a tasty combination of awesome technologies like Mike Migurski's Tilestache and the brilliant tools being built by Mapbox.
Drawing from these inspiring developments in the web mapping world, we bring you Tilehut.js, a modest, but cozy home for your map tiles. Tilehut.js is built to serve the tiles for your average web mapping project and is essentially a simple wrapper around Mapbox's node-mbtiles. Tilehut.js is indeed a humble tile server and is certainly not a replacement for the all excellent support that comes with Mapbox hosting for those more demanding or bigger projects.
We're thrilled to bring you Tilehut.js and even more excited to see what projects you brew up! Happy mapping!
You can install Tilehut.js on your local machine or to any other server which supports node.js. This means we have a number of options - e.g. platforms as services (PaaS) - for deploying our tiles to the web.
We've tested a few services and have documented our methods as part of other tutorials. You're welcome to decide which service best fits your needs. So far we've tried/tested deployment to:
- Heroku // See Part 3+ in this tutorial on Vector Tiles: Your own Tilehut
- DigitalOcean // See documentation from the EnergyExplorer.ca project
After deploying to your chosen platform, you can inspect your data via:
Now you can inspect your map ...
{yourURL}.com/{tilesetname}/map
... and the tiles are ready to use via
{yourURL}.com/{tilesetname}/{z}/{x}/{y}.png
(for raster tiles) or {yourURL}.com/{tilesetname}/{z}/{x}/{y}.pbf
(for vector tiles)
We prepared quite a comprehensive tutorial which covers everything step-by-step. Starting from creating a tileset, to setting up OpenShift and finally using your own tileset.
- 1A. Create a Raster/Bitmap Tileset (in TileMill)
- 1B. Create Vector Tiles (with GeoJSON & Tippecanoe)
- 2. Run Tile Server
- 3. Use The Tileset
See the examples folder for how to use the tilset (raster, utf-8 grid and vector tiles) in your own projects.
Visit server/{tilesetname}/map
to inspect a tileset. This works for raster, utf-8 and vector tiles.
The tiles are served via server/{tileset-name}/{z}/{x}/{y}.{extension}
e.g.:
- bitmap e.g.
server/tiles-world-simple/4/7/7.png
- vector e.g.
server/tiles-world-vector/5/17/10.pbf
- utf-8 grid e.g.
server/tiles-world-utfgrid/4/10/6.grid.json
Get the meta informations e.g. lat/lon bounds, min and max zoom level etc. via server/{tileset-name}/meta.json
Check whether you server works by calling server/ping
. Server should respond: "tilehut says pong!"
$ npm run watch
$ docker build . -t tilehut/tilehut
$ docker run -p 8000:8000 -v path/to/tiles/data:/usr/src/app/data tilehut/tilehut:latest
NOTE: When no volume is provided Tilehut will use the tile data from /data
- Tilehut.js is just a wrapper of node-mbtiles by Mapbox
- Tilehut.js was inspired by Tilestache of Mike Migurski
- Tilehut.js was kicked off by Tobin Bradley's great tutorial on writing your own mbtiles-server