Closed akashlondhe4 closed 3 years ago
See documentation at: https://recogito.github.io/annotorious/api-docs/annotorious/
loadAnnotations
expects a URL to load annotations fromsetAnnnotations
which takes an array of annotationsReplacing loadAnnotations
with setAnnnotations
should do the trick.
thanks, it working
frappe.call({ method: "powerannotation.power_annotation.page.image_annotation.image_annotation.load_annotarious_json", args: { 'name': id, }, async: false, callback: function(r2) { // alert(r2.message) anno.loadAnnotations(r2.message); } });
// I got the JSON data from r2.massage -->
[{"type":"Annotation","body":[{"type":"TextualBody","value":"Damage Fiber","purpose":"tagging","creator":{"id":"http://www.example.com/rainer","name":"rainer"},"created":"2021-08-27T06:53:54.099Z","modified":"2021-08-27T06:53:55.867Z"}],"target":{"source":"http://0.0.0.0:8000/files/DJI_0766_R.JPG","selector":{"type":"FragmentSelector","conformsTo":"http://www.w3.org/TR/media-frags/","value":"xywh=pixel:177,43,250,40"}},"@context":"http://www.w3.org/ns/anno.jsonld","id":"#ca563799-d7b9-474d-8e27-bbc6fc67b26b"}]
But when I was in load data or using this code -->
anno.loadAnnotations(r2.message); I got error -->VM1623:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 What can I do plz provide any solution?