-
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
External SVG loaded but not displayed #30
Comments
Seems like loading external SVGs is a popular feature request! We should definitely integrate some code for doing that. @vortice3D maybe that's something you can help with, based on the knowledge you've gained? @PlekszyGladz you might take a look at the threads for #29 and #28 for additional information. At any rate, I'm pretty sure you can't nest an SVG element inside of another SVG element, so what you'll need to do is pull all of the elements out of the external SVG element and place them in the overlay SVG element. With your above example, that would look something like this:
|
I tried to implement your advice resulting in the following, just like you predicted:
however the graphics still don't show. As for the nested SVG elements: this should be possible (see here for example). The graphics are displayed when I manually move the inner SVG out of the
The same holds in the first example: As soon as i manually move everything outside |
Hi PlekszyGladz: Nested svg can be "technically" possible but a non very good practice in terms of semantics (whether it can be applied to pure graphical items) and prone to reference/size errors for sure. I have experience with it. About the not shown circle usually is a problem of scales, too much large or too much small. |
@PlekszyGladz Keep in mind that the SVG overlay uses the OSD viewport coordinates. Have you done anything to change your viewport coordinates? If not, the width should go from 0 to 1, in which case your circle at 30 is way outside of the viewable space. Either change your viewport coordinates to fit or scale your circle down. For more information on viewport coordinates, see: http://openseadragon.github.io/examples/viewport-coordinates/ |
Hi,
I'm quite new to OpenSeadragon so I'm currently trying to set up a small example page with OpenSeadragon and SVG-Overlay to gain better understanding of it. Applying an overlay with d3 (like the one on the example page) works just as it should.
But the overlay does not show at all when I try and load a external file. It is correctly loaded and appended to the
<g>
-Element as seen here:I accidentally dragged and dropped the inner
<svg>
-Node out of the<g>
-Element and then it suddenly displayed the overlay, but of course it won't zoom and pan with the image like that. I tried the same with larger, more complex SVG-Files from across the internet and they all behave the same.Do you have any idea what I am doing wrong or what is causing this. There must be something I overlooked because the SVGs all seem to be OK...
Thanks in advance for any help!
The text was updated successfully, but these errors were encountered: