Skip to content

ubccalp/tileserver

Repository files navigation

Energy Explorer Tileserver

The tilesever for the energy explorer project is running on Tilehut.js. For details on Tilehut.js please refer to the documentation below. To setup your tileserver on DigitalOcean please see the README-DigitalOcean-Setup.md.

Setup:

See README-DigitalOcean-Setup.md

Data:

You will need to grab the data for the project from an external link. Please see data/README.md for details.

Running locally:

the default port is set to 80 which is used for production, so when testing locally run with the PORT specified like so:

PORT=8000 node server.js

OR

use pm2 locally

npm run-script pm2local

should be running at: localhost:8000

Running on server:

You will be using PM2 to run the project on the server. See README-DigitalOcean-Setup.md for details.

basically:

npm run-script pm2remote

Tilehut.js

A modest, but cozy home for your map tiles

Tilehut.js is a project by:

Introduction

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!

Your Own Hosted Tileserver in 5 Minutes

  1. Login to OpenShift and create a new application (the free account will give you already a 1GB tileserver)
  2. Set Application Type as "NodeJS"
  3. Use https://github.com/b-g/tilehut/ as source code for your Application
  4. Connect via SFTP to OpenShift and drop a .MBtiles tileset into the folder /app-root/data/
  5. 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.

Tutorial: Getting Started with 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.

Examples

See the examples folder for how to use the tilset (raster, utf-8 grid and vector tiles) in your own projects.

API

Inspector

Visit server/{tilesetname}/map to inspect a tileset. This works for raster, utf-8 and vector tiles.

ZXY

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

Meta Information

Get the meta informations e.g. lat/lon bounds, min and max zoom level etc. via server/{tileset-name}/meta.json

Ping (is my server running?)

Check whether you server works by calling server/ping. Server should respond: "tilehut says pong!"

Development

$ npm run watch

Acknowledgments

About

CALP Slippy Web Map Tileserver running on Tilehut.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published