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!
- Login to OpenShift and create a new application (the free account will give you already a 1GB tileserver)
- Set Application Type as "NodeJS"
- Use
https://github.com/b-g/tilehut/
as source code for your Application - Connect via SFTP to OpenShift and drop a .MBtiles tileset into the folder
/app-root/data/
- Done!
Now you can inspect your map ...
{appname}-{youropenshiftdomain}.rhcloud.com/{tilesetname}/map
... and the tiles are ready to use via
{appname}-{youropenshiftdomain}.rhcloud.com/{tilesetname}/{z}/{x}/{y}.png
You can of course also install Tilehut.js on your local machine or to any other server which supports node.js.
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.
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 even vector tiles.
The tiles are served via server/{tilesetname}/{z}/{x}/{y}.png
Get the meta informations e.g. lat/lon bounds, min and max zoom level etc. via server/name_of_tileset/meta.json
Adding ?vectortileflag=true
to meta.json path (e.g. server/tileset/meta.json?vectortileflag=true
) adds the "tiles" array property to the json. This property includes the path to your tiles, which is necessary for using vector maps in Mapbox GL JS.
See MapBox' TileJSON reference for more information.
Check whether you server works by calling server/ping
. Server should respond: "tilehut says pong!"
- 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