fluttermapboxmapbox-glmbtilesmapbox-api-vectortiles

Convert mbgl-offline db to mbtiles


I'm trying to implement mapbox offline in my flutter application... until now I'm using the repository https://github.com/mapbox/mapbox-gl-native to get the map but this map comes in format *.db which is a SQLite format.

Now if I want to use that map (in format .db) in flutter I found the package https://github.com/tobrun/flutter-mapbox-gl where it has an instructions for loading the map (.db) ...

Now, that library is so basic .. I can't do more things like put markers or anything else.. that's why I'm trying to use the other library which is more common in fluter and is called 'flutter_map' and it has a way to load offline maps but the problem here is that I need '{x}{y}{z}.png' that's an image format.

Finally my question is: How can I pass from my map (.db) to that format ({x}{y}{z}.png) ??? or maybe ... how to convert (.db) to (*.mbtiles) ?? cause the last one is more common.

Thanks again!


Solution

  • Mapbox offers the Raster Tiles API which will serve map tiles in ({x}{y}{z}.png) format. https://docs.mapbox.com/api/maps/#raster-tiles These images will be satellite imagery though.

    Mapbox also offers the Vector Tiles API which serves map tiles in .mvt format. https://docs.mapbox.com/api/maps/#vector-tiles

    Conversion to .mbtiles