0

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!

Tobrun
  • 18,291
  • 10
  • 66
  • 81
  • Hi. I known it's an old answer but can I ask you, where you generate that .db file? I'm looking where can I generate this file for a Flutter mapbox offline project – djose90 Apr 24 '22 at 01:22
  • You have to clone the c++ library (mapbox-gl-native) then use cmake (make) to build the project (if you are not familiar I strongly suggest to read about it, cause might need to do some adjustments) after that you will be able to generate those .db files. It worked at the end for me. Good Luck! – Daniel Alexander Apr 27 '22 at 20:49

1 Answers1

1

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

Moritz
  • 1,710
  • 1
  • 8
  • 13