Generating offline tiles - LB31/HikingForNerds GitHub Wiki
Sideloading explained in tobrun/flutter-mapbox-gl Repository. And look here for the mapbox guide to create offline tiles.
Mapbox restricts maximum tile count of 6.000 tiles. Berlin already has around 18k tiles for zoom level up to 14 so for generating offline tiles a local or alternative tileserver is required.
- Follow the get started example on on maptiler/tileserver-gl to install a tileserver which hosts vector tiles.
- Get mbtiles to host on the server. The number of sites that offer mbtiles to download is very limited. The only page we found offers free mbtiles from 2017 or paid up-to-date mbtiles. These mbtiles can be viewed at https://openmaptiles.org/ for different continents, contries, regions and subregions.
- Generate offline database with mbgl-offline guide by james ayvas
- git clone https://github.com/mapbox/mapbox-gl-native
- make offline
- uncomment -Werror flag if needed (so warnings will not be handled as errors)
- go into build/<os>/Debug/ and execute ./mbgl-offline --help for help
Style is specified by tile server itself.
./mbgl-offline --style http://localhost:8080/styles/klokantech-basic/style.json --north=5.98865807458 --west=47.3024876979 --south=15.0169958839 --east=54.983104153 --minZoom=8 --maxZoom=14 --output mapcache.db