Closed jaakla closed 5 years ago
This is now implemented. Some notes:
CartoOnlineTileDataSource
, the source can be URL to custom tiles.jsonCartoPackageManager
the source can be URL to custom packages.json for country packages. For bbox based packages, the source should be an URL template with '{tilemask}' tagCartoOnlineRoutingService
the source can be an URL to OSRM-compatible 'viaroute' serviceCartoOnlineGeocodingService
with source id right now@Nikituh please test with staging backend server URL and share in advancedmap develop branch
Closing this, this was implemented in 4.1.4.
@mtehver i want to implement my custom PackageManager to download offline map packages. Can you guide me on how to make it work. I have the example JSON from your server here but i am not sure how to build it for me. I dont need encryption key. Thanks
@farfromrefug You should be able to use PackageManager
class directly, by using empty strings as encryption keys.
I have just published a repository containing scripts required for building offline packages: https://github.com/nutiteq/mobile-sdk-scripts
@mtehver that s pretty awesome. So this supposes you have a mbtiles for the whole planet? Like one generated by OpenMapTiles. Cause now i generate my own OpenMapTiles mbtiles (for france only right now).
So let me guess if i am correct:
Thank a lot for that sharing, it is pretty awesome!
@farfromrefug Yes, that's correct.
For map packages the input is a 'master' mbtiles file that has to contain all the tiles needed by the packages. If you just want to make packages for France, then only a small subset of the planet.mbtiles is actually required.
For routing and geocoding packages a corresponding .osm.pbf file is required (you can get one for France from Geofabrik, for example).
And to make packages for just France, use the 'packages-carto.json.template' file from the repo and simply keep the France packages, delete everything else.
OK though as I generate my own mbtiles it can only be France for now. Really to long to do the world on my machine ;). Will try your script with my mbtiles. Maybe tweak your script to work with it. BTw the script for offline is there to split the mbtiles right ? I wonder if there already existing tools somewhere which would do this faster using SQL requests. Thanks again!
Found this https://github.com/mapbox/mbtiles-extracts
@farfromrefug The splitting script does a bit more than just copying tiles. It cleans up 'empty' tiles and tiles filled with a single polygon. And it prunes unnecessary subtiles. But for dense areas none of these steps are essential and simply copying tiles should work fine.
@mtehver thanks for the explanation. Will look a little bit deeper at the script.
Useful for on-premises, custom and staging backends.