Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Not compatible with PouchDB v6.x.x #24

Open
piehei opened this issue Oct 19, 2016 · 13 comments
Open

Not compatible with PouchDB v6.x.x #24

piehei opened this issue Oct 19, 2016 · 13 comments

Comments

@piehei
Copy link

piehei commented Oct 19, 2016

Hey

The changes in PouchDB 6 have broken the plugin.
https://pouchdb.com/2016/09/05/pouchdb-6.0.0.html

Populating the cache works differently now as per the documentation:
Remove db.put(doc, id, rev)
Please use db.put({_id: id, _rev: rev, data: 'foo'}) instead

Thanks!

@IvanSanchez
Copy link
Contributor

Can you send a pull request instead?

@pcrombach
Copy link

pcrombach commented Nov 15, 2016

Here how I changed L.TileLayer.PouchDBCached,js for pouchDb 6.0.7 form line 155:

        var doc = {_id: tileUrl, dataUrl: dataUrl, timestamp: Date.now()};

        if (existingRevision) {
            this._db.get(tileUrl).then( function(doc) {
                return this._db.put({
                    _id: doc._id,
                    _rev: doc._rev,
                    dataUrl: dataUrl,
                    timestamp: Date.now()
                });
            }).then( function(response) {
console.log('_saveTile update: ', response);
            });

        } else {
            this._db.put(doc).then( function(doc) {
console.log('_saveTile insert: ', doc);             
            });
        }

        if (done) { done(); }

@robindierckx
Copy link

+1

1 similar comment
@nikolauskrismer
Copy link
Contributor

+1

@nikolauskrismer
Copy link
Contributor

PR is #32

@nikolauskrismer
Copy link
Contributor

Demo update PR is #33

@brotkiste
Copy link

+1

@nikolauskrismer
Copy link
Contributor

Hmm.... PRs were not merged for one year now.
If you want to use newer PouchDB versions (like PouchDB 6.x or PouchDB 7.x) check out my fork at:
https://github.com/nikolauskrismer/Leaflet.TileLayer.PouchDBCached/

@IvanSanchez
Copy link
Contributor

@nikolauskrismer How about I give you the npm privileges to publish this, and you send a PR to the main Leaflet repo to change the link for this plugin? I don't really have the time to maintain it.

@nikolauskrismer
Copy link
Contributor

@IvanSanchez: sounds great to me. I can send the PR to the leaflet repo this weekend...

@nikolauskrismer
Copy link
Contributor

@IvanSanchez: I guess you giving me the npm privileges goes first, doesn't it?

@nikolauskrismer
Copy link
Contributor

@IvanSanchez: any news on the npm privileges? I updated my repo and tested it with the new 1.3.4 version of leaflet (the plugin works fine again :-))

@claudep
Copy link

claudep commented Apr 15, 2021

@IvanSanchez It would be so great if you could transfer ownership of the project to nikolauskrismer!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants