-
Notifications
You must be signed in to change notification settings - Fork 48
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
help with adding annotations (button is empty and failing) #84
Comments
In fact there's no default button for adding annotations, as the idea was that most developers would want to embed the viewer into their own system. To do this there is a javascript function newAnnotation(), which you can be called to create a new empty annotation if you include the file src/annotations-edit.js. Double-clicking existing annotations allows you to edit also. In the example you found, the source code has been modified to add this new button, which is why it doesn't work for you. Maybe it would in fact be good to include such a button, as it's the only button you really need to be separate (edit and delete are attached to each annotation). If you have any suggestions for a nice icon for this, let me know! |
Thanks @ruven, I read all documentation and was aware of that. Sorry by my javascript ignorance but how can I make that button click - function launch happen? I would prefer a way to activate addAnotation functionality without touching the main iipmooviewer-2.0.js file (i.e. adding some javascript code directly in my .html file script). So I don't need to rewrite code when you update the script.
Sure. Either these pencil or edit incons ... but I'd prefer the capital "A" like in @jcupitt example, as he had already done the icon work: addAnnotation.png / addAnnotation.svg BTW. Using @jcupitt demo above I realized I cannot add annotations when using mobile phone. |
OK, I've just made a commit that adds this button and activates the functionality: 424f077 You need to add "newAnnotation" to the list of buttons, not "addAnnotation". I ended up using this icon: https://iconduck.com/icons/85125/annotation, but maybe your choices are better. Anyway, we can change this later. Here's an example demo: https://merovingio.c2rmf.cnrs.fr/iipimage/iipmooviewer/annotations.html Once you have your annotations working, you need to save them somewhere, so you'll need to integrate some javascript to save these on a server somewhere. This is left deliberately open as this kind of data will usually be stored in a database |
Thank you very much @ruven, that works !! I have a couple of questions:
Thanks. I am already working on that. Edit: I am opening an specific issue and closing this one. Thanks! |
Sorry if I am missing something already documented but I am having troubles for setting up basic annotation system.
I load
mootools-core-1.6.0.js, mootools-more-1.6.0.js, iipmooviewer-2.0.js, iiif.js, blending.js, navigation.js, scale.js, touch.js, annotations.js, annotations-edit.js, help.en.js
in that order, before my own script (which is basically the same described in #81 plus latest @ruven's corrections).I added a single annotation array to the IIPMooViewer object, and it works properly (I can double click the current annotation, edit / move / delete it):
But that's all I could do.
These are my troubles for adding annotations:
That's fine if we are supposed to add custom icons for non default buttons, but I suggest this to be documented.
It works but it doesn't seem to use the same approach documented in current iipmooviewer's version (it's 9 years old).
It initializes
var annotations = [ {} ]
instead ofvar annotations = {1: {}}
.I tried to do that too but no way ... I don't understand why its
addAnnotation
button works and mine doesn't.Looking to the comments, it seems @jcupitt added the missing icon and @ruven merged those changes, but for some reason they are gone again.
Thanks in advance for any help you can provide!
@abubelinha
The text was updated successfully, but these errors were encountered: