Closed hsellik closed 2 years ago
Hi,
I like the idea - could be a really useful feature! As you say a fully complete implementation would have to check intersections between actual shapes (I guess by providing separate tests box/box, box/poly, poly/poly, and for point and line shapes). But this might be a nice first step. Would you mind sending a PR? I think I might tweak the plumbing a bit, but otherwise I'm happy to include this.
Two caveats:
Hi!
Made the pull request https://github.com/recogito/annotorious-openseadragon/pull/139.
Tried to make it work locally first, but couldn't. So as you said, it needs some tweaks, still.
Got it - many thanks! There were only two small issues:
getBounds
is not a method of the AnnotationStore. It is just a utility function for local use, not visible outside the AnnotationStore.js
source filegetAnnotationsIntersecting
, the ID wasn't actually resolved to an annotation.I made a handful of small tweaks to fix this. The feature should be good to go now. Thanks again - a nice addition!
Since you keep the spatial index for bounding boxes, would it be possible to expose a method to return other annotations whose bounding boxes are intersecting with the annotation specified?
It's not a perfect intersection match for the annotations, but at least the bounding boxes match and it's close enough for me.
It's not working for sure, but I was thinking roughly something like this: https://github.com/recogito/annotorious-openseadragon/compare/main...hsellik:annotorious-openseadragon:bounding-box
What do you think?