annotorious / annotorious-v1

Project has moved to http://github.com/annotorious/annotorious
https://annotorious.com
MIT License
593 stars 142 forks source link

(OpenSeadragon) getAnnotations returning undefined obj #128

Closed meihuisu closed 9 years ago

meihuisu commented 9 years ago

We are incorporating Annotorious into our Openseadragon based 2D viewer. I am able to create annotations on the viewer but when I try to dump them with getAnnotations call, the returning array's content is 'undefined'. I grabbed the latest tar ball (annotorious-0.6.3) and inserted following code bits into both test/openseadragon/test.html (with some tweaking) and example/example.html. The example worked and returned correct info but the test failed just like our viewer.

Perhaps I am missing a step somewhere ?

thanks

rsimon commented 9 years ago

Hm - the OpenSeadragon code hasn't been looked at for quite a while... I set the example up myself and added a few fixes just now. Creating annotations and fetching them via anno.getAnnotations seems to work now. You'll need to grab the most up to date code from the Repo though. (I put a build annotorious.min.js up for download here.)

rsimon commented 9 years ago

Another thing: be advised though that the old code generally won't work with recent OpenSeadragon versions! (At least I assume that's the case.) So I strongly recommend to stick with the version of OpenSeadragon that's included with the test in Annotorious.

Hope this helps!

Cheers, R

meihuisu commented 9 years ago

Thanks for the quick response.

I just checked. It now returns the right objs in my 2D viewer. I will track the dev version on github and build against that. I was having problem using the min.js built from the dev couple weeks ago. I will double check.

Is this the way to build new js from the src directory?

java -jar plovr/plovr.jar build standalone.json > annotorious.js java -jar plovr/plovr.jar build standalone_min.json > annotorious.min.js

thanks, mei

----- Original Message ----- From: "Rainer Simon" notifications@github.com To: "annotorious/annotorious" annotorious@noreply.github.com Cc: "meihuisu" mei@isi.edu Sent: Wednesday, May 13, 2015 12:09:38 PM Subject: Re: annotorious getAnnotations returning undefined obj (#128)

Another thing: be advised though that the old code generally won't work with recent OpenSeadragon versions! (At least I assume that's the case.) So I strongly recommend to stick with the version of OpenSeadragon that's included with the test in Annotorious.

Hope this helps!

Cheers, R


Reply to this email directly or view it on GitHub: https://github.com/annotorious/annotorious/issues/128#issuecomment-101779930

rsimon commented 9 years ago

To build the minified version, use

java -jar plovr/plovr.jar build standalone.json > annotorious.min.js

With Closure, you can't build a completely unminified .js as far as I'm aware. But you can change the settings in the standalone.json file to give a more readable JavaScript result. (E.g. setting 'mode' to 'RAW' rather than ADVANCED, level to VERBOSE and 'pretty-print' to true works pretty well.) Things may have changed in the mean time with Closure, though. So perhaps there are better/easier ways now.

meihuisu commented 9 years ago

My 2D viewer can run with the js from source now. thanks

----- Original Message ----- From: "Rainer Simon" notifications@github.com To: "annotorious/annotorious" annotorious@noreply.github.com Cc: "meihuisu" mei@isi.edu Sent: Thursday, May 14, 2015 9:13:04 AM Subject: Re: annotorious getAnnotations returning undefined obj (#128)

To build the minified version, use

java -jar plovr/plovr.jar build standalone.json > annotorious.min.js

With Closure, you can't build a completely unminified .js as far as I'm aware. But you can change the settings in the standalone.json file to give a more readable JavaScript result. (E.g. setting 'mode' to 'RAW' rather than ADVANCED, level to VERBOSE and 'pretty-print' to true works pretty well.) Things may have changed in the mean time with Closure, though. So perhaps there are better/easier ways now.


Reply to this email directly or view it on GitHub: https://github.com/annotorious/annotorious/issues/128#issuecomment-102088432

meihuisu commented 9 years ago

I gave those option changes a try while working with addAnnotation() call. It seems when I changed those options, the resulting annotorious.js is looking for deps.js but the file is not being generated as the side-effect of the java -jar call.

mei

----- Original Message ----- From: "Rainer Simon" notifications@github.com To: "annotorious/annotorious" annotorious@noreply.github.com Cc: "meihuisu" mei@isi.edu Sent: Thursday, May 14, 2015 9:13:04 AM Subject: Re: annotorious getAnnotations returning undefined obj (#128)

To build the minified version, use

java -jar plovr/plovr.jar build standalone.json > annotorious.min.js

With Closure, you can't build a completely unminified .js as far as I'm aware. But you can change the settings in the standalone.json file to give a more readable JavaScript result. (E.g. setting 'mode' to 'RAW' rather than ADVANCED, level to VERBOSE and 'pretty-print' to true works pretty well.) Things may have changed in the mean time with Closure, though. So perhaps there are better/easier ways now.


Reply to this email directly or view it on GitHub: https://github.com/annotorious/annotorious/issues/128#issuecomment-102088432

rsimon commented 9 years ago

Hm, I think I remember the 'cleanest' way for the build was to keep mode to ADVANCED, but go with VERBOSE level, and prettyprint = true. RAW mode, as you say, I think only properly works in dev mode, when using plovr to serve the code live via the embedded server.