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

Hello I am very new to openstreetmap, I am building my own Tiles server by following this I belived , i have done all right, all matches. i see a Small world map when i browser but when i am trying to create some tiles by following switcheroo-configured Chrome. with link by selecting Humanitarian, Its blank I dont see any log when i do this tail -f /var/log/syslog | grep " TILE " does it mean its not tiling ? Can any one Please help me with this please . Please let me know if you need any out from my server.


asked 24 May '18, 14:15

fosiul's gravatar image

accept rate: 50%

Hello fosiul,

Could you give us more details on how you configured the “Switcheroo Redirector” extension ?

Thanks !

(24 May '18, 15:04) jbelien

Not sure if it's a cache problem, but I don't see an attached picture. Perhaps store it at an external image host and link to it from here?

(24 May '18, 16:04) SomeoneElse ♦

Hi here is the link

(24 May '18, 16:11) fosiul

Apart from that, Can i not just Generate Tiles from the DB? While reading , I understand, i can use ""

Since I have followed this tutorial

and if i want to generate my own tiles with "" what do i have to do ?

Thanks for the help

(24 May '18, 16:31) fosiul

Ok I am uploading anoter image.

if i Chose one option ( tick) then I can see map showing but they are broken, although i can map, but i dont think they actulling rendering in my disk . becuase the size of bellow it never increased.

renderaccount@opentile2:/var/www/html$ du -sh /var/lib/mod_tile 40K /var/lib/mod_tile renderaccount@opentile2:/var/www/html$

(24 May '18, 17:02) fosiul

I was just getting ready to write a similar post :-)

I've got what appears to be the same issue, but have looked in Chrome's console and found the Content Security Policy is blocking images from loading. @fosiul, have you used Chrome's developer tools to see if you have any errors/notices in the browser?

I've gone further and cobbled some html/css/javascript (leaflet) code on the server. I can show maps from there using the MapBox service, but the same code on my server shows a blank map canvas.

I will post a full write up here in a few moments.

(24 May '18, 17:34) tim_rohrer

@fosiul, You're seeing some maps load when you un-tick the parts of the redirector extension because the browser is going to to get the data.

(24 May '18, 17:37) tim_rohrer
showing 5 of 8 show 3 more comments

We now have a content security policy in place where the server indicates to the browser what sites we expect various sorts of resources to load from, so if you trick the browser into using a different source like this then it will get rejected by that policy.

If you look at the javascript console you should errors telling you the CSP is being violated by those load attempts.

permanent link

answered 24 May '18, 18:45

TomH's gravatar image

TomH ♦♦
accept rate: 20%

131Refused to load the image '<url>' because it violates the following Content Security Policy directive: "img-src 'self' data: <url>".

/#map=13/23.7498/90.4408&layers=H:1 Refused to load the image '' because it violates the following Content Security Policy directive: "img-src 'self' data:".

(24 May '18, 18:53) fosiul

@fosiul, Please let us know if putting your own leaflet-based website in place lets you render maps.

@tomh, Thank you for the confirmation.

(24 May '18, 18:56) tim_rohrer

It looks like someone has (very recently) changed something that's broken this use of switcheroo. My guess is that it's at the end rather than in Chrome or Switcheroo. For more background about what this particular bit of browser nannying is supposed to do, see here.

In the meantime, a simple leaflet-based website is probably the way to go. There are lots of leaflet examples around, and here is a simple one I created earlier.

permanent link
This answer is marked "community wiki".

answered 24 May '18, 18:30

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

edited 24 May '18, 18:41

@SomeoneElse, I will have a look at that one you mentioned, however ,

Can I not Generate tile from the Database ? Since I have followed this tutorial ,

what is the best way to Genrate tiles from DB ?

(24 May '18, 18:56) fosiul

If you want to generate lots of tiles then have a look at - there's a render_list example there and also a "just the tiles in one area" one.

(24 May '18, 20:42) SomeoneElse ♦

Hi , Regards to

I think, i am doing somethig silly , to make rendering, i typed this with bellow changles, but nothing happend. not sure if i am doing right.

renderaccount@opentile2:/var/www/html/map$ ls -lrt total 24
-rw-r--r-- 1 root root 1422 May 24 19:05 permalink.html drwxr-xr-x 4 root root 4096 May 24 19:12 leaflet-dist drwxr-xr-x 3 root root 4096 May 24 19:14 control drwxr-xr-x 2 root root 4096 May 24 19:27 Scripts
-rw-r--r-- 1 root root 1324 May 24 19:30 map.html renderaccount@opentile2:/var/www/html/map$

I Edited Scripts/leaflet_embed_small.js

var hetznerUrl='//{z}/{x}/{y}.png'; var osmUrl='//{z}/{x}/{y}.png'; var deUrl='//{z}/{x}/{y}.png'; var os201604Url='//{z}/{x}/{y}.png'; var wikiUrl='//{z}/{x}/{y}.png'; var gps2Url='//{z}/{x}/{y}.png'; var mapillaryUrl='//{z}/{x}/{y}.png'; var osdiffUrl='//{z}/{x}/{y}.png';

edited map.html

renderaccount@opentile2:/var/www/html/map$ cat map.html
<!--    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" /></meta> -->
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1" /></meta>
    <title>Useful Maps</title>
    <link rel="stylesheet" type="text/css" href="leaflet_dist/leaflet.css" />
    <script type="text/javascript" src="leaflet_dist/leaflet.js"></script>
    <script src="control/Permalink.js"></script>
    <script src="control/Permalink.Marker.js"></script>
    <script src="control/Permalink.Layer.js"></script>
    <script src="control/Permalink.Overlay.js"></script>
    <script type="text/javascript" src="Scripts/leaflet_embed_small.js"></script>
  <body onload="initmap();">
    <div id="rest" style="font-size:40%">
      <button id="button6" onclick="layers_on();" >Controls</button>
      <button id="button7" onclick="layers_off();" >Off</button>
      <button id="button1" onclick="pan_centre();" >Centre</button>
      <button id="button2" onclick="pan_legend();" >Legend</button>
      <button id="button3" onclick="show_changelog();" >Changelog</button>
    <div id="map" style="position:absolute;top:40px;left:0;right:0;bottom:0;font-size:30%">
permanent link

answered 24 May '18, 19:45

fosiul's gravatar image

accept rate: 50%


Before you added the files, did you get the Ubuntu/Apache "It Works!" page to show up?

Now, after you added the code, do you still get that page?

BTW, I suggest you post a new question for this issue. It isn't really an answer for your first question.

(24 May '18, 20:07) tim_rohrer

@tim_roher Yes, I agree with you, i will create a new question for this .


(24 May '18, 20:19) fosiul

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 24 May '18, 14:15

question was seen: 4,560 times

last updated: 24 May '18, 20:44

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