4

I have installed the OSGeo4W web server tools on a Server 2008 machine, and I would like to serve MBTiles to Leaflet. I have tried these:

Zverik's mbtiles-php

Infostream's mbtiles-php fork

The required PHP files and .htaccess were placed in a directory under \htdocs and Apache happily serves files from there. However, I am unable to form any URL that retrieves tiles. Firebug shows a '200 OK' on the tile request, but no content.

Given that the mbtiles database and the script reside in a directory called 'mbtiles', can anyone inspect the scripts and explain how to properly form the URL? A proper L.tileLayer string for Leaflet would also be accepted.

Also, any other minimal configuration solution (that will run on the OSGeo4W install) that will serve my .mbtiles to Leaflet would be accepted.

til
8946 silver badges12 bronze badges
asked Nov 9, 2012 at 0:28

2 Answers 2

2

Given 'mbtiles' as the directory, the correct URL to get tiles with Leaflet js is:

.../mbtiles/[filename without extension]/{z}/{x}/{y}.png

As a side note for anyone attempting to use these on an OSGeo4W install, you may need to AllowOverride in httpd.conf and uncomment extension=php_gd2.dll in your php.ini file.

answered Nov 15, 2012 at 18:45
1

I recommend to try this project:

https://github.com/klokantech/tileserver-php/

It is very easy to install and comes with sample viewers (Leaflet, OpenLayers, OL3, Google Maps API, etc) - presenting JavaScript source code.

The server supports also OGC WMTS - so the maps can be opened in QGIS or ArcGIS for Desktop.

Here is a live demo: http://tileserver.maptiler.com/

answered May 30, 2014 at 21:59
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.