cordova-plugin-mbtiles
cordova-plugin-mbtiles copied to clipboard
Regarding Cordova MBTiles Plugin Map View
Hi.
I am working on a project where I need offline Map for Androids. I know MBTiles is a very good offline Map hence while searching internet I found your Cordova MBTiles Plugin and feels great interest to use. I am very new in Cordova JS. I am facing a problem in the App and I'll be glad if you please give me a clue to overcome it.
I made a Cordova App and added this MBTIles Plugin. Then I replaced the default "www" folder with the "plugins\com.makina.offline.mbtiles\sample\www" and rebuild the app. When I loaded the App in my Android Device I can see the "Click Me" Button but after Click on it nothing happens.
However, I checked the code where by Click on "Click Me" button a MBTiles file should download from "http://cg44.makina-corpus.net/tmp/POSOW-19.04.2012.mbtiles" and view it?
Please advise.
Thanks in advance.
Regards.
Hi, that's a moment that not used this plugin !
Yeah that is, Actually the mbtiles files must be downloaded to be displayed on the map.
- Which version of your cordova do you use ?
- Can you download the mbtiles files ?
- If you pass in debug mode with Android Studio or Eclipse can you pass in native code ? FYI, you can debug the web code by Chrome Browser https://developer.chrome.com/devtools/docs/remote-debugging,
Thanks.
Hi.
Thanks for your reply.
I checked my Cordova Version and its 5.1.1. The build is OK. Anyhow the MBTiles I thin not downloading. But the URL for MBTIles download is Ok.
Is it possible to load the MBTiles directly from SD Card directory?
Regards.
Yes the sample use the plugin files to download the mbtiles file and load it in mbtiles plugin. You can load directly the file present on sdcard in mbtiles plugin. I dont remenber if you can give the path directly or if you need the format of file plugin. On 16 Jun 2015 13:59, "sakibnaz" [email protected] wrote:
Hi.
Thanks for your reply.
I checked my Cordova Version and its 5.1.1. The build is OK. Anyhow the MBTiles I thin not downloading. But the URL for MBTIles download is Ok.
Is it possible to load the MBTiles directly from SD Card directory?
Regards.
— Reply to this email directly or view it on GitHub https://github.com/ffournier/cordova-plugin-mbtiles/issues/31#issuecomment-112400360 .
you can pass the full path of file, just give the typepath:fullpath and in url:the path of file in sdcard when you call the method init
/** * open database or file with given name * @param data : the parameters (type:'type',optional typepath:('fullpath', 'cdvfle'), url:'cdvfile://url...') * @return the pluginResult
*/
On Wed, Jun 17, 2015 at 7:11 PM, Florian Fournier < [email protected]> wrote:
Yes the sample use the plugin files to download the mbtiles file and load it in mbtiles plugin. You can load directly the file present on sdcard in mbtiles plugin. I dont remenber if you can give the path directly or if you need the format of file plugin. On 16 Jun 2015 13:59, "sakibnaz" [email protected] wrote:
Hi.
Thanks for your reply.
I checked my Cordova Version and its 5.1.1. The build is OK. Anyhow the MBTiles I thin not downloading. But the URL for MBTIles download is Ok.
Is it possible to load the MBTiles directly from SD Card directory?
Regards.
— Reply to this email directly or view it on GitHub https://github.com/ffournier/cordova-plugin-mbtiles/issues/31#issuecomment-112400360 .
You need to install the plugin cordova-plugin-whitelist to can download a file. It's a problem since the cordova version 4.0.
I didn't check the plugin FileTransfer but since the 4.0 I know that we need this to can access to a HTTP request
Hi. I know that this issue is old, but I have a question. Which tool are you using to make this mbtiles file (POSOW-19.04.2012.mbtiles) ? The internal table structure (SQL) is not the same that my others mbtiles files. I try differents tools: all mbtiles types from Mobac (Mobile Atlas Creator http://mobac.sourceforge.net/) tool (Rmaps, OruxMaps,OSMand, standard, Maverick, etc), QmetaTiles plugin for Qgis
This is your SQL table structure: CREATE TABLE metadata ( name text, value text ); CREATE TABLE map ( zoom_level INTEGER, tile_column INTEGER, tile_row INTEGER, tile_id TEXT, grid_id TEXT ); CREATE TABLE keymap ( key_name TEXT, key_json TEXT ); CREATE TABLE images ( tile_data blob, tile_id text ); CREATE TABLE grid_utfgrid ( grid_id TEXT, grid_utfgrid BLOB ); CREATE TABLE grid_key ( grid_id TEXT, key_name TEXT ); CREATE VIEW tiles AS SELECT map.zoom_level AS zoom_level, map.tile_column AS tile_column, map.tile_row AS tile_row, images.tile_data AS tile_data FROM map JOIN images ON images.tile_id = map.tile_id; CREATE VIEW grids AS SELECT map.zoom_level AS zoom_level, map.tile_column AS tile_column, map.tile_row AS tile_row, grid_utfgrid.grid_utfgrid AS grid FROM map JOIN grid_utfgrid ON grid_utfgrid.grid_id = map.grid_id; CREATE VIEW grid_data AS SELECT map.zoom_level AS zoom_level, map.tile_column AS tile_column, map.tile_row AS tile_row, keymap.key_name AS key_name, keymap.key_json AS key_json FROM map JOIN grid_key ON map.grid_id = grid_key.grid_id JOIN keymap ON grid_key.key_name = keymap.key_name;
Regards
I remenber, i used landez
http://blog.mathieu-leplatre.info/landez-fabriquer-facilement-des-fichiers-mbtiles-en-python-fr.html
But you can change the request sql in the plugin if you want to change the structure :).