Need help with fitbounds event sequences.
See original GitHub issueI use the fitbounds method to direct the viewport to a set of coordinates via click(function) of a class. It works well. Now I want to apply a delay between a series of coordinates - creating an automatic chained set of movements. My lack of JavaScript proficiency has prevented me from figuring this out on my own.
In this case, I’m also using it as a background to a header and made it non-interactive.
Demo here that fires the event upon ‘open’. And two buttons that fire different viewport coordinates just for demonstration (will not want to use buttons). http://deepzoomchattanooga.com/dzdemo.php
Relevant code below for the open and click. Need to know how to open, then after a number of seconds, fire the next one, etc.
Thank you.
var box1 = new OpenSeadragon.Rect(0.13, 0.05, 0.03, 0.01);
var box5 = new OpenSeadragon.Rect(0.87, 0.05, 0.05, 0.02);
viewer.addHandler('open', function() {
viewer.viewport.zoomSpring.animationTime = 280.0;
viewer.viewport.zoomSpring.springStiffness = 5;
viewer.viewport.centerSpringX.animationTime = 280.0;
viewer.viewport.centerSpringX.springStiffness = 5;
viewer.viewport.centerSpringY.animationTime = 280.0;
viewer.viewport.centerSpringY.springStiffness = 5;
viewer.viewport.fitBounds(box5);
});
$('.loc1').click(function() {
viewer.viewport.zoomSpring.animationTime = 280.0;
viewer.viewport.zoomSpring.springStiffness = 5;
viewer.viewport.centerSpringX.animationTime = 280.0;
viewer.viewport.centerSpringX.springStiffness = 5;
viewer.viewport.centerSpringY.animationTime = 280.0;
viewer.viewport.centerSpringY.springStiffness = 5;
viewer.viewport.fitBounds(box1);
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:29 (14 by maintainers)
Top Results From Across the Web
Do not fire 'zoom_changed' event when calling fitBounds ...
I am having an issue where I need to do a search on the server from client when there is a zoom change...
Read more >leaflet - how does one reset map.fitbounds (zoomtofeature ...
I have a lovely map setup using Leaflet with MapBox tiles (only). It is a United States map with polygons for each state...
Read more >Fit a map to a bounding box | Mapbox GL JS
This example zooms and pans the map so the new visible area of the map fits within the specified geographical bounds.
Read more >Folium 0.12.1 documentation
Can choose from a list of built-in tiles, pass a custom URL or pass None to create a map without tiles. For more...
Read more >Upgrading Your Maps JavaScript API Application from V2 to V3
The event model for the Maps JavaScript API v3 is similar to that used in v2, though much has changed under the hood....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re one step ahead. I’m sure I would have asked about that next. And yes, I’ll do some testing and let you know if I do find a provable issue on the vars.
Thanks again.
I’ll ‘digest’ this and see what I can do. Thanks for the tip on the URL. I think I’ve made that mistake more than once.
I’ll follow up when progress is made (or not).