NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

4
1

Hi, I have installed OSM server on Ubuntu. Now I want to use it in my applications. I want to use my local OSM server for map and not Openstreet map server.

How do I serve the tiles? Any sample HTML code? I have tried code where it is referring to Openstreet map server on openstreetmap.org. How do I change it to refer to localhost server?

asked 09 Oct '11, 11:49

Reshma%20Maner's gravatar image

Reshma Maner
235303136
accept rate: 0%

edited 11 Oct '11, 13:10

Jonas_'s gravatar image

Jonas_
662152233


To get your own map tile server, you want OSM in a Box - it does all the hard integration work for you :

  • Configures PostgreSQL/PostGIS server
  • Creates an empty database with geospatial features - keeps all attributes in hstore
  • Configures GeoServer and tries to keep osm2gis-configuration consistent with GeoServer styling rules
  • Loads OSM data into the database
  • Incrementally updates the database
  • Produces nice maps (tiles and cached through GeoWebCache)
permanent link
This answer is marked "community wiki".

answered 17 Nov '11, 15:35

Jean_Marc%20Liotier's gravatar image

Jean_Marc Li...
1616
accept rate: 0%

edited 17 Nov '11, 15:36

You can start with the OpenLayers simple example.

Note the section for "Other tile sets". You have to add this code to the layer definition section, instead of the two lines for Mapnik:

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

Just change the URL to the directory where your tiles are, and the zoom levels to how many you have. Then open it in your browser, and it should be showing your local tiles.

permanent link

answered 09 Oct '11, 12:45

Vclaw's gravatar image

Vclaw
9.2k895141
accept rate: 22%

hi, Thanks for the input. I have tried it with a single layer world tile. It is working. Now, I want to make india map tiles. Pls tell me how can I do it? I want to use India map from my server, not thro Openstreetmap.org server

(11 Oct '11, 08:08) Reshma Maner
1

Hi Reshma, when you have a chain of questions that go deeper in detail with each answer, you should better ask at forum.osm.org or one of the mailing lists ... maybe there you can get detailed answers beyond any FAQ like this site is.

(11 Oct '11, 16:38) stephan75

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×535
×123
×111

question asked: 09 Oct '11, 11:49

question was seen: 15,597 times

last updated: 17 Nov '11, 15:36

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum