-
Notifications
You must be signed in to change notification settings - Fork 28
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
Typescript/Angular implementation #34
Comments
I don't think there is an npm package for the svg-overlay: https://www.npmjs.com/package/svg-overlay Did you not get an error when you tried to install it? At any rate, you may need to do some work to make it function with |
I referenced the package straight from github using the following:
I eventually got it working by adding the file to my vendor.ts and writing this inside the openseadragon-svg-overlay.js file:
and the import
|
Good to know! Is there anything we can do to the plugin to make that process easier for the next person? |
Have there been any updates on this in relation to React? I have been attempting to replicate this solution with a React/typescript app to be able to utilize the svg-overlay function with no luck. Any suggestions @iangilman or @daanvanrobays? |
No updates as far as I'm aware of. What issues are you encountering? Are you getting any errors? Can you tell which part is working? |
Thank you for the prompt response @iangilman! I had been trying to replicate the work done by daan and finally was able to get things working in React utilizing his suggestions. Below is how I setup the svg-overlay plugin within my repo.
I then import and call the function by passing in viewer from there I can treat it the same as if it Thanks again for the prompt response! |
Looks great! Do you think it might be possible to update this repository to support this modality but also still support the "old fashioned" loading technique? I don't have a lot of experience with creating code that supports both, but surely people do it! |
TBH I am not really sure how to go about doing that but if it would be helpful I would be more than happy to add a PR that adds a file of the overlay plugin configured in the way daan did it that I copied and then update the README with a section on implementation utilizing the new plugin. I don't know if that would be helpful or not but unfortunately that is probably the limit of what I would be able to do to help enhance the functionality. |
I wouldn't want a duplicate copy of the code, since it would be harder to maintain, but I suppose one option would be to introduce a build step that spits out two copies of the code, each with the right "framing" elements. I wonder if that's how people generally do it? No rush on this... Even having this conversation here is helpful to people! If you do run across any information on how to support both modalities, please let me know. And, of course, if you do have energy around implementing it, please do! We just need to make sure we're doing it cleanly :) |
Yeah I hear you loud and clean on the "clean" approach. I'll definitely think through it and see if I can come up with anything! |
Hello,
I am developing an angular application that uses openseadragon viewer and I'd like to place some svg overlays on this viewer.
However, I am having trouble getting the svg-overlay package initialized into the openseaviewer.
I've installed both npm packages and am importing them as shown below.
After this code executes it throws an error saying that '.svgOverlay is not a function'.
I've also tried declaring them in another way
But this throws the same error.
Is there something I am doing wrong here? Or can anyone who succesfully added this in a typescript / angular project share their expertise?
Thanks in advance!
The text was updated successfully, but these errors were encountered: