Is there an easy way to test (view on a map) my locally generated XYZ map tiles?

I've used OpenLayers and Leaflet to display non-local XYZ map tiles, and I could conceivably push these tiles to a remote server and test them that way. It just seems to me there should be an easier way...

2 Answers 2


Your browser can load your local XYZ tiles. Check this tutorial at BostonGIS which shows how to do this relative to OpenLayers. The thinking should transfer to Leaflet or whatever else you want to use.

You should install and setup Apache or IIS so that your development machine can behave like a server and serve itself the tiles in the same manner as any deployed website would, but I believe you can still use a local file path and the OpenLayers or Leaflet client will still consume the tiles without fuss.


This is trivial to do in Leaflet, just declare the path locally. No need to run a local server.


Be aware that you might need the tms: true option if you used gdal2tiles.py or Leaflet will try to look up different filenames.

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.