This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Change tiles of local Openstreetmap Website

1

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 '20, 02:29

carlosguedes's gravatar image

carlosguedes
9191016
accept rate: 0%

edited 12 Mar '20, 20:36


2 Answers:

1

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

answered 12 Mar '20, 20:57

carlosguedes's gravatar image

carlosguedes
9191016
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 '20, 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 '20, 15:52) carlosguedes

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

(27 May '20, 05:10) carlosguedes

0

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

answered 12 Mar '20, 10:58

H_mlet's gravatar image

H_mlet
5.4k1781
accept rate: 13%

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 '20, 15:18) carlosguedes

Source code available on GitHub .