Simple example of use of the MBTilesDroidSpitter library reading the MBTiles format from Android.
Screenshots at: https://github.com/djcoin/MBTilesDroidSpitterExampleSimple/tree/master/assets/screenshots
- Load a database taken from /sdcard/map.mbtiles (change the path in source code to change the database to load, will be fixed soon)
- Load one tile at a time given its x/y/z taken from user input and display the matching tile or error message if none
- Display the metadata information of the table
Get an SQLite database in the MBTiles format.
- You may find some at http://mapbox.com/tileset/world-light.
- E.g.:
wget http://mapbox-tilesets.s3.amazonaws.com/mbtiles/World_Light.mbtiles.zip)
- Android requires any sqlite database to have an non-empty "android_metadata" table.
- E.g.:
sqlite3 <your_database> "CREATE TABLE IF NOT EXISTS android_metadata (locale TEXT DEFAULT 'en_US'); DELETE FROM android_metadata; INSERT INTO android_metadata VALUES ('en_US');"
- Load the database on your device.
- E.g.:
adb push path/to/your/sqlite_android_enabled_db /sdcard/map.mbtiles
If you load it in your sdcard base directory and name it "map.mbtiles" it will be loaded automatically. Otherwise, put it wherever you like and change the path of the sqlite database in the source code
- Simon Thépot aka djcoin <[email protected]> <[email protected]>. Work done while being at Makina Corpus