maptiler / tileserver-php

MBTiles and MapTiler folder hosting with TileJSON, OGC WMTS, UTFGrid interaction and web interface. QGIS & ESRI ArcGIS compatible. Runs on any Apache+PHP webhosting. MapBox Studio Vector Tiles hosting.
http://tileserver.maptiler.com/
568 stars 163 forks source link

Bounds field not passed correctly to TileJSON #119

Closed ContourGeographic closed 6 years ago

ContourGeographic commented 6 years ago

Hello,

To start, I'm running tileserver.php on an Amazon EC2 Linux instance, with Apache installed. I've uploaded my sample .mbtiles file to the root directory where tileserver.php is stored. My version of PHP (5.6.32) is supported, and Mod_rewrite is enabled. Password protection is enabled using .htaccess with a username and password stored in .htpasswd. To view my server, go to: maptiles.cgwebmaps.com/tileserver.php and for both username and password, enter "user1"

The issue is that neither base layers nor my .mbtiles file render in the browser...

tileserver_snip

When clicking on the TileJSON link to view the metadata, I notice that only one of the bounds parameters is passed to the metadata...

{"name":"Block72_epsg3857.tif","description":"Block72_epsg3857.tif","version":"1.0.0","attribution":"","type":"overlay","format":"png","minzoom":14,"maxzoom":15,"bounds":[44.194526749399],"scale":"1","profile":"mercator","basename":"Block72","tiles":["http://maptiles.cgwebmaps.com/tileserver.php?/Block72.json?/Block72/{z}/{x}/{y}.png"],"tilejson":"2.0.0","scheme":"xyz","grids":["http://maptiles.cgwebmaps.com/tileserver.php?/Block72.json?/Block72/{z}/{x}/{y}.grid.json"]}

Similarly, when viewing the source code for a leaflet browser, only one of four bounds attributes is shown...

leaflet_code_snip

However, when using mbutil to dump the metadata from the .mbtiles file, the bounds attributes appear to be stored correctly...

{ "name": "Block72_epsg3857.tif", "description": "Block72_epsg3857.tif", "version": "1.0.0", "attribution": "", "type": "overlay", "format": "png", "minzoom": "14", "maxzoom": "15", "bounds": "44.19452674939861 -85.9844914240563 44.23075608828462 -85.92437433018117", "scale": "1", "profile": "mercator" }

I've successfully viewed the same unpacked tiles locally on my laptop with a leaflet viewer, so I don't believe it is an issue with my .mbtiles file. I've also tried editing the "bounds" attribute in the metadata table in the .mbtiles file, by switching the order of lat/long values to have longitude first (in the above metadata, the order is lat min/long min lat max/long max). That did not work.

Any idea what is going on here?

Thank you for your help!