Comments (2)
Yes -- adjusting the animation speed is simple:
var animation = new aeris.interactive.animations.AnimationSync([radarLayer], {
// set the initial animation speed
speed: 60
});
// Change the animation speed
animation.setSpeed(120);
The speed
number represents how many minutes of weather data will be displayed in a second. So for example, a speed of 60
means that your animation will play from 1pm to 2pm in one second.
By the way, the animations are set up so you can "lazy-load" tiles images, without making the user wait for everything to load. The tile images are loaded in such a way that you can immediately start the animation, without waiting for everything to preload -- it will start out "choppy", but become smoother as images are loaded.
v0.7.13 introduced a preload
method, which makes this even easier. To make the UI feel less laggy, I'll do something like this:
// Start preloading animation images
myAnimation.preload();
// Show some kind of loading indicator
showLoadingProgressUI('0% complete');
// Hide the animation layer until the animation is preloaded
// Note that the radar layer MUST have a map set when you call preload()
radarLayer.setMap(null);
// Animation objects fire 'load:progress' events as
// tile images are loaded.
myAnimation.on('load:progress', function(progress) {
var progressDisplay = (progress * 100).toFixed(0) + '% complete';
showLoadingProgressUI(progressDisplay);
// Because preloading the entire animation may take a while,
// we'll just tell the user that we're done when enough images are loaded
// that animation won't look choppy
if (progress > 0.5) {
// Hide your loading UI
hideLoadingProgressUI();
// clean up the 'load:progress' event listener
myAnimation.off('load:progress');
// Show the radar layer
radarLayer.setMap(myMap);
}
});
I'm a little embarrassed to say that none of this is really well documented. If you're interested, there's some auto-generated documentation up at docs.aerisjs.com/api.
I hope this helps -- let me know if you run into any issues.
Edan
from aerisjs.
Awesome, I figured you had something in there, I just had trouble finding it. Thanks for the help and the link, I'll bookmark that as a reference
from aerisjs.
Related Issues (15)
- YUIDoc: "The partial public/header could not be found" HOT 1
- Default map? HOT 1
- maps.Map doesn't support style() (and other google options) HOT 2
- Aeris Map is not updated with Google Map attributes
- Sync breaks after time HOT 2
- map.destroy() HOT 3
- Half grey google map HOT 3
- Radar Animations stopped working with google maps HOT 5
- Unable to set KML overlay, might not be a bug but limitation with KML HOT 1
- set minimum zoom HOT 3
- markerCollection.stopClustering() hide all markers on map HOT 8
- Google Maps Error: You have included the Google Maps API multiple times on this page. HOT 1
- Can i have UV index of current localtion / HOT 1
- Can't install via bower
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerisjs.