How can I browse my own tiles?

My (long-term) goal is to generate customized tiles and maps from OSM data. The main purpose of these maps will be the offline-usage on my smartphone so I have my customized maps always available.
With tiles I can feed OSM-Tracker which uses tiles generated by mapnik directly. Later I plan to use Navicomputer, here I need to contact a tile server to download the tiles into a database-fileformat for this tool.
So Mapnik is my only choice to generate tiles.

Currently I am able to generate tiles using mapnik on linux and I have made first modifications of the osm.xml. To test my settings with different zoom levels and areas I need a tool to browse my tiles similar to openstreetmap.org.

After searching the wiki and the web I found some tools like “renderd”, “OpenLayers” or “Slippy Map” which seem to have similar roles when it is about to access maps with a webbrowser. But I am not really sure about the right one.

My first configuration was:

  • Ubuntu Linux 9.10 (on a virtual box so I can play around and undo some actions)
  • PostgreSQL 8.4 with PostGIS extension
  • OSM2PSQL (latest from svn)
  • Mapnik 0.7.1
  • World boundaries and .osm data for my region

With this configuration I was able to create map images and tiles.
In the OSM forum I found the following instructions:
http://forum.openstreetmap.org/viewtopic.php?pid=32956#p32956

So I added some more tools:

  • Java (the package “sun-java6-jdk”)
  • Osmosis latest (I think it does a similar job as mapnik so I believe I don’t need it)
  • Apache (apache2 apache2-mpm-prefork apache2-prefork-dev apache2-utils apache2.2-common)
  • mod_tile

Currently I can open http://localhost/ and I see the default web page. So what I need now is something that takes my generated tiles and puts them together into a browsable map.

Openlayers is what you want.
You can start with the simple example here: http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example

Note the section for “Bespoke”. You need to add the layer for your tiles with code like this:


var newLayer = new OpenLayers.Layer.OSM("New Layer", "URL_TO_TILES/${z}/${x}/${y}.png", {numZoomLevels: 19});
map.addLayer(newLayer);

Changing the URL to point to wherever your tiles are, and change the name if you want. Then view it in a browser, and you should see your map.

Thanks this worked.

Currently my mapnik is rendering over the night and tomorrow I will browse my city at Zoom 22 :slight_smile: