Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a bit more documentation #1

Open
ndarilek opened this issue Feb 3, 2014 · 15 comments
Open

Provide a bit more documentation #1

ndarilek opened this issue Feb 3, 2014 · 15 comments

Comments

@ndarilek
Copy link

ndarilek commented Feb 3, 2014

Looks like an interesting project, but can I use it in the browser as well as on the server? If so, is there a process for minifying index.js plus all dependencies with the possible exception of Pouch which I'm fetching separately? I'd like a plugin like this but just don't know where it is intended to be used. An additional paragraph or two in the README would help, along with maybe a table listing supported geospatial operations.

@calvinmetcalf
Copy link
Member

so in theory this should work on the server, but that requires geocouch which I've been unable to get working on my current computer so haven't been able to test it on the server. Though in the mean time I can spruce up the repo.

@ndarilek
Copy link
Author

ndarilek commented Feb 3, 2014

Ah, OK, so it's server-only and requires Geocouch? Thanks, knowing that
helps.

@calvinmetcalf
Copy link
Member

no, server AND local, server requires geocouch, local doesn't

@ndarilek
Copy link
Author

ndarilek commented Feb 3, 2014

Sweet. Is there a minified version I can drop into my app? How about a
Grunt or other build process for building same?

This looks really awesome, I've been looking for in-browser syncable
geospatial support for quite some time!

@calvinmetcalf
Copy link
Member

the pull i just started as a build process, but not minified, you can checkout the other branch and run npm install and then npm run build which should build it, after you load the script add the code PouchDB.plugin('Spatial',geopouch);

@scubbx
Copy link

scubbx commented Dec 15, 2014

I tried to build a browser standalone version with the rtree branch - there seems to be a problem with the "inherits"module (TypeError: superCtor is undefined). There is a special version available for browsers at https://github.com/isaacs/inherits (inherits_browser.js) but I was unable to include it.

@calvinmetcalf
Copy link
Member

It should work with browserify

On Mon, Dec 15, 2014, 5:20 PM scubbx notifications@github.com wrote:

I tried to build a browser standalone version with the rtree branch -
there seems to be a problem with the "inherits"module (TypeError:
superCtor is undefined). There is a special version available for
browsers at https://github.com/isaacs/inherits (inherits_browser.js) but
I was unable to include it.


Reply to this email directly or view it on GitHub
#1 (comment).

@scubbx
Copy link

scubbx commented Dec 15, 2014

Here are some more details from a second try with a freshly cloned repository:

$ git checkout rtree
$ npm install

no problems

$ npm test --coverage

everything ok (7 passing (8s))

$ npm run build

no suspicious outputs, dist folder is created and the file geopouch.js has 714kB

$ npm run build-test

no suspicious outputs, test folder is created with 4 files.
When opening the index.html file in a browser, the error TypeError: superCtor is undefined in line 6933 appears.
The same happens when manually loading pouchdb and than geopouch in an HTML file.

My npm version is 1.4.28,
the node version 0.10.32,
the installed browserify version is 7.0.1

Did I miss an important step?

@calvinmetcalf
Copy link
Member

That is an error related to inheriting something that doesn't exist
possibly related to crypto browserify but I thought I fixed that bug.

On Mon, Dec 15, 2014, 5:51 PM scubbx notifications@github.com wrote:

Here are some more details from a second try with a freshly cloned
repository:

$ git checkout rtree
$ npm install

no problems

$ npm test --coverage

everything ok (7 passing (8s))

$ npm run build

no suspicious outputs, dist folder is created and the file geopouch.js
has 714kB

$ npm run build-test

no suspicious outputs, test folder is created with 4 files.
When opening the index.html file in a browser, the error TypeError:
superCtor is undefined in line 6933 appears.
The same happens when manually loading pouchdb and than geopouch in an
HTML file.

My npm version is 1.4.28,
the node version 0.10.32,
the installed browserify version is 7.0.1

Did I miss an important step?


Reply to this email directly or view it on GitHub
#1 (comment).

@calvinmetcalf
Copy link
Member

I'll look into this tomorrow

@calvinmetcalf
Copy link
Member

Getting the same error, I fixed this in browserify crypto 3.6.1 but 3.6.0
is loading

On Mon, Dec 15, 2014, 5:55 PM Calvin Metcalf calvin.metcalf@gmail.com
wrote:

That is an error related to inheriting something that doesn't exist
possibly related to crypto browserify but I thought I fixed that bug.

On Mon, Dec 15, 2014, 5:51 PM scubbx notifications@github.com wrote:

Here are some more details from a second try with a freshly cloned
repository:

$ git checkout rtree
$ npm install

no problems

$ npm test --coverage

everything ok (7 passing (8s))

$ npm run build

no suspicious outputs, dist folder is created and the file geopouch.js
has 714kB

$ npm run build-test

no suspicious outputs, test folder is created with 4 files.
When opening the index.html file in a browser, the error TypeError:
superCtor is undefined in line 6933 appears.
The same happens when manually loading pouchdb and than geopouch in an
HTML file.

My npm version is 1.4.28,
the node version 0.10.32,
the installed browserify version is 7.0.1

Did I miss an important step?


Reply to this email directly or view it on GitHub
#1 (comment).

@calvinmetcalf
Copy link
Member

because it was never published browserify/crypto-browserify#85

@scubbx
Copy link

scubbx commented Dec 18, 2014

Thank you very much for looking into this, now it compiles all right. :-)

But I am a bit confused about the API:
When simply loading with PouchDB.plugin('Spatial',geopouch);, the geopouch plugin can be accessed by the keyword geopouch. But this stands in contrast to the way the API is explained in the readme.md ( db.spatial([xmin, ymin, xmax, ymax], [options, callback)]; ). Also, how would geopouch know which database to access?

When changing the way the module is loaded in index.js by the method explained on the PouchDB homepage (PouchDB.plugin({ spatial: function spatial(fun, bbox, ...) it can be called as an extension of each initialized PouchDB database. But in any way, I don't receive results.
Also, shouldn't the correct way to call geopouch be like db.spatial( designdoc/spatialview, [bbox], ... ) ? (in contrast to the explanation in the readme.md)

@calvinmetcalf
Copy link
Member

the readme is out of data look at the tests for now

@calvinmetcalf
Copy link
Member

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

No branches or pull requests

3 participants