Name: MaLanterne
Owner: Makina Corpus
Description: null
Created: 2015-10-26 08:55:50.0
Updated: 2015-10-26 09:22:41.0
Pushed: 2015-12-02 12:19:05.0
Homepage: null
Size: 372
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Simple demo app using OSMDroid to display offline maps from MBTiles sources.
Install and run the application:
clone https://github.com/makinacorpus/MaLanterne.git
aLanterne
adlew clean assemble<Flavor>Debug
where Flavor is a variant chosen of the application to build (Camel case):
Ensure that you have a connected device with Android 2.3.x or higher running and execute the following command after build:
adlew install<Flavor>Debug
You can combine a full build and deploy the application in a same command:
adlew clean install<Flavor>Debug
MBTiles sources should be copied locally on the device.
First create a new directory inside /mnt/sdcard/Android/data/
according to the current flavor used
(lower case):
shell mkdir /mnt/sdcard/Android/data/com.makina.osmnav.<flavor>/
then copy all *.mbtiles
within this directory:
*.mbtiles -exec adb push {} /mnt/sdcard/Android/data/com.makina.osmnav.<flavor>/ \;
Create a new JSON
file within the assets/
folder named mbtiles.json
:
"name": "Paris Gare de Lyon",
"bbox": [
48.8487,
2.3866,
48.8368,
2.3664
],
"layers": {
"base": "gdl.mbtiles",
"layers": [
"gdl_2.0.mbtiles",
"gdl_1.0.mbtiles",
"gdl_0.0.mbtiles",
"gdl_-0.25.mbtiles",
"gdl_-0.5.mbtiles",
"gdl_-0.75.mbtiles",
"gdl_-1.0.mbtiles",
"gdl_-2.0.mbtiles",
"gdl_-3.0.mbtiles"
]
}
where:
name
: the name of this layers settingsbbox
: the global bounding box to use (used to limit and center the map): LatNorth, LonEast, LatSouth, LonWest
layers
: layers to usebase
: the main layer to use as base layerlayers
: a set of additional layers to display (used to display each level).
The naming of these layers must follow this rule to determine automatically the right level:
name_of_the_layer_<level>.mbtiles