When using this plugin on a page with more than one map (both maps have same bounds and tiles), on initial sync, it generates a lot of document update conflicts. This is because it is trying to put tiles from two sources at the same time (I think).
To get around it I use the pouchdb.upsert plugin and change the put code to following:
this._db.putIfNotExists(tileUrl, doc).then(function(res) {
// success, res is {rev: '1-xxx', updated: true}
}).catch(function(err) {
// error
});
I am not sure if this sort of thing should be in the core library but wanted to raise this.
When using this plugin on a page with more than one map (both maps have same bounds and tiles), on initial sync, it generates a lot of document update conflicts. This is because it is trying to put tiles from two sources at the same time (I think).
To get around it I use the pouchdb.upsert plugin and change the put code to following:
I am not sure if this sort of thing should be in the core library but wanted to raise this.