I did setup locally a OpenStreetMap Website and a Tile Server, but my OSM Website is getting the tiles from the regular OSM. I would like to know what files I need to change in my OSM Website server in order to make it get the tiles from my local tile server. I tried to search in internet but it isn't clear which files i need to change nether which lines need to be changed.

Here follows an image of my tile server, with data of Brazil country.

alt text

Here follows what appears in my Rails application, showing that the tiles used by the application are from OSM. alt text

Thanks in advance.

UPDATE 1: I suspect the file to be changed is the openstreetmap-website/vendor/assets/leaflet/leaflet.osm.js at line 17, because when I overwrite the IP of my tile server over the tile.openstreetmap.org it gave me a gray screen like there were no tile server attached to the app.

asked 12 Mar, 02:29

carlosguedes's gravatar image

carlosguedes
865815
accept rate: 0%

edited 12 Mar, 20:36


The file that needs to be changed is the openstreetmap-website/vendor/assets/leaflet/leaflet.osm.js exactly in the line 17 which is

url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',

needs to be changed to

url: 'https://IP/osm/{z}/{x}/{y}.png',

Of course if 'osm' is what you put in renderd.conf URI path.

That {s} before IP was the problem.

alt text

permanent link

answered 12 Mar, 20:57

carlosguedes's gravatar image

carlosguedes
865815
accept rate: 0%

Glad you found the solution ! I think you can mark your own answer as accepted, so that the question won't stay unsolved.

The {s} resolve to a, b or c, to share the load on different servers, or trick the browser in doing parallel requests.

Regards

(13 Mar, 15:01) H_mlet

Still didn't appeared the option to accept the answer. I think it need to wait some time to be able to accept.

(13 Mar, 15:52) carlosguedes

For some reason I can't mark this answer as accepted.

(27 May, 05:10) carlosguedes

This search should be a starting point. I guess it's Leaflet you'll want to change.

permanent link

answered 12 Mar, 10:58

H_mlet's gravatar image

H_mlet
1.7k731
accept rate: 14%

Actually, in other tutorial that I saw (https://gis.stackexchange.com/questions/336151/data-is-not-appearing-in-a-local-osm-server-after-applying-changes-to-it) it says to change a line that I only found at OpenLayers folder. And it says to substitute https://a.tile.openstreetmap.org/${z}/${x}/${y}.png but says nothing about https://b.tile.openstreetmap.org/${z}/${x}/${y}.png or https://c.tile.openstreetmap.org/${z}/${x}/${y}.png so it stills confusing.

(12 Mar, 15:18) carlosguedes
Your answer
toggle preview

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:

×177
×90

question asked: 12 Mar, 02:29

question was seen: 475 times

last updated: 27 May, 05:10

powered by OSQA