DE:Deploying your own Slippy Map

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Verfügbare Sprachen
Deutsch English 日本語 Русский

Die Übersetzung ist noch nicht fertig und an manchen Stellen muss noch an der Formulierung gearbeitet werden.

Contents

Willst Du eine Karte von OpenStreetMap auf Deiner Webseite?

Du kannst unsere existierenden Karten in Deine Seite einbinden, genauso wie mit Google- oder Yahoo-Karten. Aber für absolute Flexibilität gibt es bei OpenStreetMap die Möglichkeit selbst generierte, und nach Deinen Vorgaben angepasste Karten aus den OSM-Daten einzubinden.

Wie kommt unsere Karte auf Deine Webseite?

Das ist der einfachste Schritt, aber Du solltest sicher sein, dass dieser Schritt bei Dir funktioniert, bevor Du andere Sachen ausprobierst.

Du hast folgende Möglichkeiten:

Deine interaktive Karte kann jeden OSM-Tile-Server verwenden. Beachte, dass es keine Garantie auf Verfügbarkeit der Server oder FÜR die Qualität der Karten gibt. Wenn Du viele Zugriffe auf Deine Seite erwartest, besprich das bitte vorher mit uns. Kontakt

Erstelle Deine eigenen Karten

Wenn Du die Ansicht der Karten anpassen möchtest - zum Beispiel mit anderen Farben für Straßen oder Linienbreiten - kannst Du die Karten auch selber erstellen. Dazu brauchst Du Mapnik oder Osmarender (der in den Scripts von Tiles@home enthalten ist).

Kartenkacheln mit Mapnik und generate_tiles.py erstellen

Diese Methode wird zum Beispiel von OSM cycle map verwendet. Der Hauptvorteil besteht darin, dass nichts auf dem Webserver laufen muss. Man braucht nur ein Verzeichnis für die Bilddateien. Du kannst alles auf deinem PC zu hause installieren und transferierst nur noch die Kartenkacheln auf Deinen Webserver wenn Du fertig bist.

Kartenkacheln mit Mapnik und mod_tile erstellen

Das ist das neue System, das seit 2008 für die Karte bei OSM verwendet wird. Es benutzt eine angepasste C-Implementierung um effizient Kacheln aus dem Dateisystem auszuliefern und Renderprozesse zeitlich zu planen.

Kartenkacheln mit Mapnik und Mysql/Ruby/Python erstellen

Dieses System wurde 2007 fast die ganze Zeit für die Karte bei OSM verwendet. Die Kartenkacheln wurden durch einen Ruby-Script, welcher die Kacheln aus einer MySQL Datenbank geladen hat, bereitgestellt. Im Falle von veralteten oder fehlenden Kacheln wurde die Kachel in der Datenbank zum erneuten Rendern vorgemerkt. Ein Script im Hintergrund hat dann diese Kacheln gerendert.

 RewriteRule ^//(-?[0-9]+)/(-?[0-9]+)/(-?[0-9]+).png  /ruby/cat_tile.rb?x=$2&y=$3&z=$1 [PT,T=image/png]

Kartenkacheln mit Mapnik and tilecache erstellen

This is the method lets you generate the map as you view it instead of requiring any pre-rendering. This method can struggle at higher load levels if too many people try to look at unrendered tiles simultaneously. You need pretty much full control over your webserver in order to install everything.

Creating tiles with Osmarender/Tiles@Home

Download the latest tiles@home client from SVN (it is called tilesGen.pl). Change the configuration file to include "LocalSlippymap=DirectoryName", and specify a DirectoryName that you want to contain the generated tiles. Whenever you now process a tileset (by running perl tilesGen.pl xy xxxx yyyy, where xxxx and yyyy are the x and y coordinates of the level-12 tile you want to render), tilesGen.pl will create the tiles under the DirectoryName in a directory structure suitable for serving the tiles through a web server. The first directory element will be the layer prefix (as configured in layers.conf, in case you have more than one layer!), then you'll have a zoom level, then the x coordinate, and then a file "y.png".

You will need the script lowzoom.pl to create tiles for zoom levels 11 and smaller from the tiles you have generated. Unsure whether/how this works with LocalSlippymap.

Map Application (UI)

Whether you use Mapnik or Osmarender to generate the tiles, you will need a web interface to browse them.

The logic that does the zooming and panning is usually implemented in Javascript. You can either use OpenLayers, or you could also use the Google API to access the tiles. In both cases you will have to somehow add your layer to the list of layers available for selection, and adding your layer will require specifying the web server and base path - the interface will then add /zoom/x/y.png depending on which tile it needs (See Slippy map tilenames)

We use the OpenLayers javascript for our our main map and also at informationfreeway.org. The OpenLayers 'Getting Started' doc explains how to initialize a 'map' object in javascript. To make this work with our tiling scheme, you need a 'TMS' layer and bit more javascript logic. See our OpenLayers Simple Example. For more slippy map features (supporting layer selector, permalinks, etc) you might like to poke around in the javascript source of informationfreeway.org

Using Kosmos Tile Map Server

If you need a lightweight and simple slippymap solution, you can use Kosmos tile map server to render maps of smaller areas. You just need an OSM file with the map data - you can use JOSM to download the data and then save it to the disk. Kosmos is able to generate tiles automatically on your computer and is also equipped with an OpenLayers-powered slippymap. See Kosmos#Tile_Map_Server for more information.

Notes

Fedora Users

Personal tools
Namespaces
Variants
Actions
site
Toolbox