Replies: 2 comments
-
I just took another run at this and compared the above with the snippet provided in the documentation (bottom of page https://annotorious.dev/guides/annotating-images/). It appears that the bounds field is mandatory for the widget to display the annotation box, i.e. when ommitted, the annotation will not be displayed, despite being registered in the instance. If this is a bug, please let me know and I will file an issue. Best regards, and thanks again for this work! |
Beta Was this translation helpful? Give feedback.
-
Hi, that's right. The annotations need to follow the data format described in the docs. This is not a bug :-) If you are omitting the |
Beta Was this translation helpful? Give feedback.
-
Dear all,
I wish to have some annotations appended at run-time using my backend template engine. My annotation object is effectively added to the annotorious instance, but it is not rendered on the image.
I feel that I'm missing some kind of "render" method?
here is a MWE:
<img id="my-image" src="sample-image.png"> <script> window.onload = function() { var anno = Annotorious.createImageAnnotator('my-image', {userSelectAction: 'NONE'}); const myAnnotation = JSON.parse('{"id":"97d01785-bdc3-46ec-94d6-c03700c72d7c","target":{"id":"97d01785-bdc3-46ec-94d6-c03700c72d7c","selector":{"type":"RECTANGLE","geometry":{"x":273,"y":201,"w":83,"h":49}}}}'); anno.addAnnotation(myAnnotation); console.log(anno.getAnnotations()) } </script>
Beta Was this translation helpful? Give feedback.
All reactions