annotorious / annotorious-openseadragon

An OpenSeadragon plugin for annotating high-res zoomable images
https://annotorious.github.io
BSD 3-Clause "New" or "Revised" License
121 stars 43 forks source link

Display SVG text? #162

Closed Pixcell closed 1 year ago

Pixcell commented 1 year ago

Hello,

I'm using annotorious to display polygons on an OpenSeaDragon image. I'd like to display text directly on the image, in the same fashion than we display polygons.

I tried to create an annotation of type SvgSelector with a value of

<svg><text x="50" y="50">Hello</text></svg>

Nothing apart from a small white square in the top left is being displayed. The console shows an error

Uncaught Unsupported SVG shape type: text
TE @ AnnotationStore.js:103
(anonymous) @ AnnotationStore.js:142
(anonymous) @ AnnotationStore.js:134
(anonymous) @ OSDAnnotationLayer.js:135
(anonymous) @ OSDAnnotationLayer.js:266

Versions:

"@recogito/annotorious-openseadragon": "^2.7.10"
"openseadragon": "^4.0.0"

Thank you!

rsimon commented 1 year ago

Sorry, Annotorious doesn't support text overlays. If you need a solution to overlay generic SVG, this might be what you are looking for: https://github.com/openseadragon/svg-overlay