CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
187 stars 68 forks source link

Support custom URLs for backend #221

Closed jaakla closed 5 years ago

jaakla commented 6 years ago

Useful for on-premises, custom and staging backends.

mtehver commented 6 years ago

This is now implemented. Some notes:

jaakla commented 6 years ago

@Nikituh please test with staging backend server URL and share in advancedmap develop branch

mtehver commented 5 years ago

Closing this, this was implemented in 4.1.4.

farfromrefug commented 4 years ago

@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

mtehver commented 4 years ago

@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

farfromrefug commented 4 years ago

@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!

mtehver commented 4 years ago

@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.

farfromrefug commented 4 years ago

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!

farfromrefug commented 4 years ago

Found this https://github.com/mapbox/mbtiles-extracts

mtehver commented 4 years ago

@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.

farfromrefug commented 4 years ago

@mtehver thanks for the explanation. Will look a little bit deeper at the script.