Coder Social home page Coder Social logo

tilehut's Introduction

tile hut cover

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

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:

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)

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

Docker

Build Docker Image

$ docker build . -t tilehut/tilehut

Run Docker Image

$ 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

Acknowledgments

tilehut's People

Contributors

b-g avatar florianporada avatar joeyklee avatar slandsbek avatar stephanbogner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tilehut's Issues

some maps do not render properly

Env: OSX El Capitan, Chrome: Version 56.0.2924.87 (64-bit)

http://localhost:8000/tiles-world-simple/map works but http://localhost:8000/tiles-work-vector/map fails on error below

Error: Failed to initialize WebGL
_setupPainter — map.js:1100
e — map.js:168
createVectorMap — map:202
createMapFromType — map:155
init — map:142
(anonymous function) — map:236
j — jquery-2.1.1.min.js:2:26866
fireWith — jquery-2.1.1.min.js:2:27675
x — jquery-2.1.1.min.js:4:11132
(anonymous function) — jquery-2.1.1.min.js:4:14769

i have verified that Chrome WebGL flags are set to 'enabled'

This also failed on Safari.

Tiles not being supplied over HTTPS in node.js

Hello,

I have a set of maptiles that are properly being served up over http (both in localhost and by accessing remotely), but I can't for the life of me figure out how to get them to be served over https. I have a node.js server set up that has tilehut running, and supplied maptiles both over http and https. As you can guess, the http version serves them properly whereas the https version serves a blank page anytime I try to request a specific tile or preview a map. I have tried to find a solution for months but unfortunately, without success.

How to secure our tilehut server?

I am building the docker image and running the image to host the server. I have an attached EBS which is having the files from tippecanoe and same is linked as the volume.
My issue is that we don't want the server to be publicly available and only through our web application, our web application is also running on docker hence, we cannot take the IP approach. do we have some other way to have an authorization mechanism for access of the tiles?

Heroku tileserver not responding with tiles, but local does

Hi! First off, thanks for the wonderful bit of software!

I have a certain map in a .mbtile file that I would like to server to my app. After some fiddling around today, I got the map service running correctly on my local machine and could preview the app at localhost or a public IP if I configure my node.js server to do so. The next step was to transfer everything to Heroku, at which point the map tiles no longer seem to get served.

As far as I can tell, all the code is the same between the local version and the heroku version. I know that the server is at least somewhat functional, as I can access the metadata of the .mbtile file through the net without issue. When requesting specific map tiles however (or when trying to preview by going to [app url]/[filename]/map) my app gets a 404 response. Trying this in a browser simply returns an empty page with nothing on it. I am not sure why this happens, and unfortunately have not found much help by searching my issue. The only suspicion I have is that I may have to specify which layer to deliver the data from. Having said that, I can't explain why the local version runs fine.

UPDATE: I'm now one step closer to figuring out why this is happening. It has something to do with transmitting over https. Since yesterday I've set up my own node.js server running tilehut that is hooked up to a domain with an ssl certificate. After setting that up I confirmed the server is working as it is supposed to, since I can ping the server and request health status. I can even request and view the meta.json file of map files.

The problem comes when requesting the map tiles themselves (or trying to preview the map). When running this over the regular http server, everything works as you would expect. When running over https however, the server responds with 404 not found in my app and a blank screen in the browser. I imagine there is something in the configuration for tilehut that I need to change to properly work over https, but I'm afraid I can't quite work it out myself.

Choose a licence?

Hi, I think tilehut looks like a great tool for checking out tilesets and also for learning a bit about how things work by reading the code. But I can't find any mention of a licence anywhere in the repository. It would be very helpful if you chose a licence and applied it to the repository so that others can build on your great work!

Trouble reading mbtiles file

Hi there,

I've been trying to use tippecanoe to generate some vector tilesets. This process appears to be working because I can upload them to my Mapbox account.

However for some reason I'm having trouble getting tilehut to read them. In the console I get

Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8000/countries/4/7/8.vector.pbf Failed to load resource: the server responded with a status of 404 (Not Found)

I also get a similar error in my powershell window

tile rendering error Error: Tile does not exist

The schema of my mbtiles file appears to be correct according to the mbtiles spec although I notice it is quite different to the sample 'tiles-world-vector.mbtiles' file that you provide.

Do you have any tips or suggestions?

Thanks,
Rowan

PS Im just trying to use the http://localhost:8000/countries/map/ link which seems super handy (if I could get it to work!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.