You are not logged in.

#1 2020-01-11 18:21:46

Registered: 2019-11-29
Posts: 5

Problems with serving vector tiles (Mapbox)

Hello everyone,

I am working on my own tile server. I have weird problems with displaying tiles in the correct order. Tiles were created using OSM data.
When I use tileserver-gl-light as a tiles server everything seems to be ok, but when I try to serve tiles by my own server they do not appear in correct order after zooming. I use the same page to render the map so I think the problem is connected with server.
The tiles look like this (Zoom 1):

I appreciate any help.
Best regards,

Last edited by siloam (2020-01-11 18:23:05)


#2 2020-01-11 21:37:34

Registered: 2019-11-29
Posts: 5

Re: Problems with serving vector tiles (Mapbox)

I don't know the reason why but there was a need for correction y axis value before fetching data from mbtiles database.

If your tiles url looks like:


you need to recalculate y value before fetching tile data in pbf format from database:

 y = pow(2, z) - 1 - y

There is no mention about this in mbtiles specification but I found the solution in Tileserver-PHP source code: … server.php


#3 2020-01-12 22:31:59

From: Charlbury, UK
Registered: 2007-04-24
Posts: 399

Re: Problems with serving vector tiles (Mapbox) … .3/ says

"Note that in the TMS tiling scheme, the Y axis is reversed from the "XYZ" coordinate system commonly used in the URLs to request individual tiles, so the tile commonly referred to as 11/327/791 is inserted as zoom_level 11, tile_column 327, and tile_row 1256, since 1256 is 2^11 - 1 - 791."


Board footer

Powered by FluxBB