-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
preserveOverlays now handles both this.overlays and addOverlay() #580
base: master
Are you sure you want to change the base?
Conversation
Tests for overlay are easy to fix, but it seem that I havn't taken in consideration viewers with multiple pages I've never used pages and so I'm not sure what it is the expected behavior for overlays in the case of multiple pages, any ideas on how to go about this? |
@@ -523,13 +523,11 @@ | |||
* position. If preserveViewport is set to true, then the viewport position | |||
* is preserved when navigating between images in the sequence. | |||
* | |||
* @property {Boolean} [preserveOverlays=false] | |||
* @property {Boolean} [preserveOverlays=true] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change changes how the overlays
option behaves as well as how Viewer.addOverlay()
behaves; please update their documentation as well.
It's possible to include overlays for each tile source in the I suppose one solution would be to go through the currentOverlays on close and pull out any that came from the current tile source. As for the tests, they'll probably need to be updated...they're testing the old behavior, and this patch changes that behavior. Another thing to include in this patch is clearing out all of the overlays in Viewer.destroy(). |
About Viewer.destroy() I will do this next, for now i will work the overlay/pages issue first, i think i've understood it behavior. Some thoughts: And so if we apply this to pages then we should 'hide' and not 'destroy' the overlays between pages switches. one way would be to set |
I agree with that principle for overlays added to the viewer in general, but I think it may be different for overlays provided with the individual tile sources. Imagine you have fifty pages, and they each have twenty overlays associated with them. That's 980 hidden overlays for any page you're on (since only 20 of them will be relevant on any page). At any rate, you certainly wouldn't want to just do |
He could set preserveOverlays to false to avoid this issue, we could also 'force' preserveOverlay to false between page switches, but we will sacrifice the flexibility of being able to choose... I will do some tests to confirm all this. |
Well, I think it's our responsibility to make the scenario work if we're going to default to having preserveOverlays on. If we leave it defaulted to off, then it's ok that it's not compatible with the tile source overlays option. Just so we're on the same page, let's see if I can summarize where we've been and where we're going: Original
After #561, with preserveOverlays = falseSame as original. After #561, with preserveOverlays = true
Current state of #580, with preserveOverlays = falseSame as original, except:
Current state of #580, with preserveOverlays = true
Possible future, with preserveOverlays = falseSame as original, except:
Possible future, with preserveOverlays = true
Does all that seem right? |
I will work on the possible future with preserveOverlays = true |
Sounds good. How would you feel about my merging #446 into master? It's getting about time to do that. That branch has some changes in how we deal with overlays, but whatever you do with this patch will have to be merged into it eventually anyway. Sound fair? |
Yeah, please do, I will have to adapt to it so the sooner the better. |
Right on. :) |
Thanks, Noted. |
This is way above my js skills and understanding of openseadragon code base. The IDEA-Overlays if preserveOverlays is set to true, need to be kept alive (not destroyed then recreated) while switching between pages, or loading a new image. Feedback-I guess when switching to a different page, the previous page overlays visibility should change to collapsed, while on ConclusionsI think we should rollback, to the original state meanwhile, but i would love to see this implemented. Open For Grabs! |
@ShadOoW Cool, thank you for trying, and thank you for passing it on so gracefully. I think I'll leave #561 in but add a little more in the way of docs (not to be mixed with other overlay techniques) and take care of the leak on destroy(). Beyond that, we'll see if someone else wants to pick up this thread and take it further. |
Minor cleanup done (#601) |
Hello,
Following 561 pull request discussion.
Please review and let me know if any modification are needed.
Edit: the test is failling probably because this.preserveOverlays is set to true.