User:SomeoneElse/Your tiles from osm.org

From OpenStreetMap Wiki
Jump to navigation Jump to search

You've now got some something capable of creating tiles, and the next step is usually to set up a simple web site using them [1].

However, you might want to see your tiles in place of one of the layers on "OpenStreetMap.org". You can redirect requests to one of OpenStreetMap's tile layers to go to your server instead. It's possible to do this because when you're browsing the map at osm.org, it's your web browser, not the osm.org web server, that sends out requests for tiles. The layer that you replace should support the same zoom levels as your tile server, and obviously it helps if it's a layer that you don't use much. In my case I've replaced the Humanitarian tiles, which works for me because:

  • They are the layer I use least (now that MQ Open has gone).
  • The zoom levels are 0-20, the same as my tiles.

Probably the easiest way to do this is via a browser extension, such as "Switcheroo" [2] for Google Chrome or "Redirector" [3] for Firefox.

You need to find out the full path to a Humanitarian tile, which you can do from osm.org by turning off all overlay layers (anything showing a way, changeset, notes, data), right clicking on the map and selecting "view image". You'll get something like:

and something similar for https

With this tile layer there are currently 3 tile servers, "tile-a" through "tile-c". You'll need to make sure that tile requests from your web browser are rewritten into whatever format your web server is expecting. For https tiles to work, you'll need to enable https in Apache if not done already.

I actually took a slightly different approach and changed my PC's "hosts" file so that tile-X.openstreetmap.fr pointed at my tile server, and changed "URI" in my renderd.conf to match the path on openstreetmap.fr's servers:

  • URI=/hot/

In addition for https I needed to accept the "wrong" certificate in my web browser since I'm serving tiles from somewhere that isn't openstreetmap.fr but I'm pretending is.

However, a browser extension is definitely the recommended way to go, if you've not fiddled about with hosts files before.