tangram-es icon indicating copy to clipboard operation
tangram-es copied to clipboard

MBTiles format

Open VincentBaillet opened this issue 2 years ago • 5 comments

I'm trying to use Tangram using mbtiles files for an offline iOS project. (latest version : 0.17.1) currently, I have no problem to display the slovakia map provided by @rwrx on a previous post : vector file for slovakia Il works well, it's fast... It's perfect !

Now, i'm trying to make my own mbtiles. -I used Tilemaker to create maps. This one for example: Vector file for Guadeloupe. This map looks good with the Qgis viewer, but i can't manage to display it with Tangram-ES. The console output does not show any problem. I can zoom and move the map, add markers... but the map is desperately uniformly white. -I've tried also to download some MBtiles maps from MapTiler, but I have the same problem displaying them.

So it looks like Tangram-ES is able to display some MBtiles files, but have some difficulties with some others. Or maybe there's something i've not fully understood.

My question is: Is there a tool or a process that I have to use in order to create MBtiles that are compatible with Tangram-ES ?

VincentBaillet avatar Mar 11 '22 18:03 VincentBaillet

Hello, mbtiles file for Slovakia was generated by https://github.com/tilezen/vector-datasource. When you want to use default Mapzen map styles you need to use the schema in which these map styles are written. Vector-datasource is using this scheme to generate mbtiles files.

rwrx avatar Mar 12 '22 13:03 rwrx

Thank you @rwrx for you answer. I am now able to get TangramEs mvt individual tiles from https://tile.nextzen.org. But how do you pack them in a mbtiles file ?

VincentBaillet avatar Mar 13 '22 16:03 VincentBaillet

Hi @VincentBaillet - glad to hear you're making progress with this issue! It looks like The MBTiles spec repo keeps a list of implementations here: https://github.com/mapbox/mbtiles-spec/wiki/Implementations (seems a bit out of date though). mbutil seems like it might do what you need.

If you are having trouble loading specific mbtiles files in Tangram ES, please share any logs or other errors that you encounter.

matteblair avatar Mar 14 '22 22:03 matteblair

thank you very much @matteblair for your reply. Mb-util is a brilliant tool.

-I'm able to display @rwrx slovakia's map. -I'm able to create a mbtiles file that is recognized by Tangram-es (tiles are loaded... by tangram-es). BUT, no map is displayed, and the log shows no error.

So I think the problem is that the scheme of my mbtiles files does not correspond to what the yaml file describes. The problem is certainly on my side. But i can't find a way to encode a mbtiles file that would be compatible with the client yaml file. I've spent several days on that issue, trying to understand what's happening (breakpoint... trace...)

Tangram's code is clean and efficient. It is certainly a good solution for what i want to achieve. Therefore, some explanations/examples are missing about how to create a production pipeline that starts from a map (TileZen, OSM...) and creates a displayable mbtiles (and the corresponding yaml). Such a description/example/clue would really help a newcomer like me to use your brilliant piece of code.

VincentBaillet avatar Mar 16 '22 09:03 VincentBaillet

Tilemaker生成的mbtiles里面的tile_data结构和tilezen的不一样,所以可视化不了,除非写个工具做个转换,我打印看了下layername差距都挺大的

KingKOl avatar Jan 31 '24 05:01 KingKOl