I'm struggling to work out how to use the XYZ tiles I've created in my QGIS project. I have managed to create the XYZ tiles and I know they have been created correctly as the index.htm file renders it correctly.

What I haven't been able to work out how to add the tiles to my project. I want it to sit on top of OSM as an additional base layer. I have tried a file reference to a place on my local drive and also tried uploading it to my GitHub space but, again, I can't seem to link to the tiles.

I have the tiles located here and this is the connection I'm using (it's a map of the Scottish rail network): C:/Users/Andrew/Documents/ScotRail220616/{z}/{x}/{y}.png

ScotRail220616 is the top folder within which the zoom level folders sit.

What am I missing? Am I getting the syntax wrong for the file location?

  • Thanks for the tip. Still hasn't resolved it for me. Anything else that I might be missing? I've tried turning it immediately into a webmap (as I've used some xyz tiles that don't show in the canvas but will render in a webmap) but nothing. Jun 21, 2022 at 15:11
  • 1
    It is still actual over time. I have got the same problem - QGIS window just leaves me a blank space. Syntax is the same, I'm using Windows 10 Pro. Anyone who did meet this issue before, what actions have you taken to overcome it?
    – vkrk
    Dec 7, 2022 at 7:18

1 Answer 1


I think the url needs a a file:// protocol and an extra slash before "C:/" i.e.


That works for me but I'm testing on Linux not Windows.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.