ffournier / cordova-plugin-mbtiles Goto Github PK
View Code? Open in Web Editor NEWCordova Plugin MbTiles
License: Apache License 2.0
Cordova Plugin MbTiles
License: Apache License 2.0
Hi,
has anyone already integrated this plugin into a Win10-App? Are there any hints what I have to do to get it working?
As far as I could figure out, the plugin.xml references Windows Phone 8? (This plugin works great for iOS and Android!)
I have changed WP8 to windows in the plugin.xml. But I think, this is not enough ๐
When running the app, I get "Missing command error" - as I found this is thrown by Cordova if backend of a plugin is not well defined.
Any ideas what I have to change?
I am using Visual studio 2015 since I intend to create this app for Win8.1 and Win10. I have also installed the plugin cordova-sqlite-legacy, which provides an SQLite-DB for my data.
Best regards,
stihl-sicher
Implement Method to test if an sdcard is exist.
always true in ios --โฅ no sdcard
always true in wp8 --> sdcard not use (in read only)
test in android
test in blackberry
Maybe we can create a new value in method init where we'll have the possibility to choose between the fullPath or cdvfile.
Therefore we can use file or db with the value cdvfile, instead have just db currently.
si init({type: type (db, file), path: path (fullpath, cdvfile), url : url(optional)}, ...)
create branch for this !
See if we can thread action in BlackBerry with callback and onNotify
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.
Maybe we can remove the dependencies on file and/or file-transfert.
We use the Mbtiles plugin 1.0.0, to show up off-line maps in iOS. Our app worked fine till cordova ios version 4.0.1. WHen we downloaded version 4.1.1 and regerated the app with X-Code (same version 7.3.1) the off-line maps do not show up (they can;t be opened).
Thanks in advance,
--Dimitris Doukas
Must close database before to open a new.
The plugin kept throwing an 'SQLiteCantOpenDatabaseException' when I tried to use the application data directory. I ended up doing this to get it to work:
var store = cordova.file.dataDirectory;
var fpath = store.substring(7, store.length); //remove the 'file://' part
mbTilesPlugin.init({type: type, typepath: 'fullpath', url: fpath}, function(rinit) {
...
});
Implement the test by action
Need to put a text in index.html to show download progress
Hi There.
I am trying to make a Cordova Android App for MBTiles Map View. I am using Visual Studio 2015. I tried to add this plugin in my project with the git link "https://github.com/ffournier/cordova-plugin-mbtiles.git". I am getting Error in Visual Studio "Unable to parse plugin.xml".
Can you please advise?
Thanks in advance.
Regards.
I just tested this plugin using the sample. While verifying process an existing local mbtiles file was not fount. The app always downloaded the file from web.
I could solve this by changing following lines in file map.js:
function verifyingMap(localFileName, remoteFile){
// leaving out the first lines...
mbTilesPlugin.init({type: type}, function(rinit) {
mbTilesPlugin.getDirectoryWorking(function(r) {
// alert("getDirectoryWorking Verify : " + r.directory_working);
var absoluteLocalFileName = **"file://"+**r.directory_working + localFileName;
// check to see if files already exists
var file = **window.resolveLocalFileSystemURL(absoluteLocalFileName, function** (fileEntry) {
// skipping rest of function
The seems to be a change in the cordova file plugin. Hope this will help for others...
We used the following command to open an off-line map in iOS and Android but since our last upgrade in cordova it fails (only in iOS) returning null.
App.mbTilesPlugin.open({name: 'NoCloud/map/map.mbtiles'},.......
Maybe must be use the plugin file to find the right working directory in function of persistent , temporary, assets types of files provides by code JS.
This action will can synchronise the directory between the both plugin.
This plugin works great for Leaflet 0.7
There were major changes in the Leaflet TileLayer in Update to 1.0. Thus, this plugin is not working with Leaflet 1.0.1
I took a closer look to Leaflet and changed the file TileLayer.MBTilesPlugin.js
The function _loadTile is no longer in use. We have to change behaviour of loading tiles in the process of creating tiles.
Here is my working version for Leaflet 1.0.1
L.TileLayer.MBTilesPlugin = L.TileLayer.extend(
{
mbTilesPlugin : null,
mbTilesMetadata : null,
base64Prefix : null,
createTile: function (coords, done) {
var tile = document.createElement('img');
L.DomEvent.on(tile, 'load', L.bind(this._tileOnLoad, this, done, tile));
L.DomEvent.on(tile, 'error', L.bind(this._tileOnError, this, done, tile));
if (this.options.crossOrigin) {
tile.crossOrigin = '';
}
tile.alt = '';
tile.setAttribute('role', 'presentation');
tile.src = this.getTileUrl(coords,tile);
return tile;
},
initialize: function(mbTilesPlugin, options, callback)
{
try {
console.log("initialize");
this.mbTilesPlugin = mbTilesPlugin;
L.Util.setOptions(this, options);
var tileLayer = this;
var minZoom = 0;
var maxZoom = 0;
console.log("initialize2");
mbTilesPlugin.getMinZoom(function(result)
{
console.log("getMinZoom");
minZoom = result.min_zoom;
console.log(result);
console.log("getMinZoom --" + minZoom + "--");
mbTilesPlugin.getMaxZoom(function(result)
{
console.log("getMaxZoom");
maxZoom = result.max_zoom;
console.log("getMaxZoom --" + maxZoom + "--");
mbTilesPlugin.getMetadata(function(result)
{
console.log("getMetadata");
mbTilesMetadata = result;
console.log(result);
L.Util.setOptions(tileLayer,
{
minZoom: minZoom,
maxZoom: maxZoom
});
if (mbTilesMetadata.format)
{
base64Prefix = "data:image/" + mbTilesMetadata.format + ";base64,";
console.log("base64Prefix --" + base64Prefix + "--");
}
else
{
// assuming that tiles are in png as default format ...
base64Prefix = "data:image/png;base64,";
console.log("base64Prefix --" + base64Prefix + "--");
}
callback(tileLayer);
});
});
});
} catch(e) {
console.log("initialize "+e.message);
}
},
getTileUrl: function (tilePoint, tile)
{
try {
var z = tilePoint.z;
var x = tilePoint.x;
var y = this._globalTileRange.max.y - tilePoint.y;
console.log("getTileUrl");
console.log(this.mbTilesPlugin);
console.log("-----");
this.mbTilesPlugin.getTile({z: z, x: x, y: y},
function(result)
{
tile.src = base64Prefix + result.tile_data;
},
function(error)
{
console.log("failed to load tile " + JSON.stringify(error));
});
} catch(e) {
console.log("getTileUrl "+e.message)
};
return L.Util.emptyImageUrl;
}
});
Just as a reminder after our conversation yesterday :)
Before to read the file (metadata and other) test if the file exists.
If we don't have access to sdcard in Android , BB10, WP8, what we do ?
Treat the request invlid in execute statment.
Now we stock the data in context of application and not on sdcard, maybe in future we will need to stack the data on sdcard. The reason is due to the documentation of wp8 that it recommends to use sdcard only for MEDIA, PHOTO.
Implement New method init and update Documentation
Must close database before to open a new in all OS.
Implement the Async Sqlite in Windows Phone
Hi, Just a question out of curiosity.
Are there any native features needed by this library or could it be reimplemented as a JavaScript library utilising the CordovaSQLite plugin?
I couldn't see anything obvious, but I may very well have missed something.
Thanks.
Need to test the synchronise between this plugin with different path.
We have a bug on BlackBerry between the fileTransfert and the MbTiles Plugin, need to pass by the URL and not URI to download.
Currently, We not test on Windows Phone 8.
We 've got an exception in getTiles on ios platform when we ask a tiles out of bounds.
Need to think a solution on update and delete request
Need to push a javascript sample to use it. Just the www resource.
Update the documentation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.