Skip to content
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

Able to Ease-in to bookmark from full view? #4

Open
bdrichards opened this issue Mar 13, 2021 · 3 comments
Open

Able to Ease-in to bookmark from full view? #4

bdrichards opened this issue Mar 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@bdrichards
Copy link

A request:
Is there a way to have the bookmark plugin "ease-in" to the view coordinates from a home view upon loading?

thanks for any response...
BDR

@iangilman
Copy link
Member

This plugin does not support animating to the new location, but it would be quite straightforward to add that... basically you just need to replace the true at the end of:

self.viewport.zoomTo(params.zoom, null, true);

...and:

self.viewport.panTo(new $.Point(params.x, params.y), true);

...to a variable that's either true (for no animation) or false (for animation).

You can modify your own copy of the plugin for that purpose, but if you're up for making a pull request here to add that feature, that would be lovely!

@iangilman iangilman added the enhancement New feature or request label Apr 9, 2021
@bdrichards
Copy link
Author

bdrichards commented Apr 10, 2021 via email

@iangilman
Copy link
Member

I see! Well, the easiest way to change the animation speed is adjust the animationTime and springStiffness options when creating your OpenSeadragon viewer. They affect all animations, not just the starting animation, so you would probably want to update them after the initial load to get back to snappier response... that involves going into the viewport and modifying its springs... I can fill you in on that if that's the way you want to go. Anyway, animationTime defaults to 1.2 (seconds) and springStiffness defaults to 6.5... making the former bigger and the latter smaller should make things slower.

The springs always have an easeOut style to them... if you want easeInOut instead, you'll have to do your own animation loop, interpolating your target location and setting it per frame.

I guess I would suggest trying the options above and see if you can get the effect you want, and then I can help you with next steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants