GithubHelp home page GithubHelp logo

Sync breaks after time about aerisjs HOT 2 CLOSED

aerisweather avatar aerisweather commented on July 29, 2024
Sync breaks after time

from aerisjs.

Comments (2)

eschwartz avatar eschwartz commented on July 29, 2024

Hi -- sorry for the slow response. I've been out of town for the last two weeks.

I couldn't say offhand exactly what's going on, but I should be able to get a fix for the demo page up within the next couple of weeks (and probably on the dev branch sooner than that). In the meantime, I can try to point you in the right direction.

The AnimationSync object wraps each layer in an AutoUpdateAnimation object, which it uses to animate through each layer's tiles. The AutoUpdateAnimation object requests new tile times at a fixed interval (eg. every 6 minutes for Radar), and updates the from/to bounds of the animation with the new times.

It is possible that the demo UI is not responding correctly to autoUpdate events. I see two places in the demo code which modify the range input after an autoUpdate:

  1. The load:times event handler
    • The AutoUpdateAnimation has requested and received new times
  2. The 'change:from change:to` event handler
    • The AutoUpdateAnimation has updated the animation bounds to match the received times.

If you do not need the autoUpdate behavior for your application, you can easily fix this problem by telling the AnimationSync to wrap the layers in a standard TileAnimation object, instead of the default AutoUpdateAnimation object:

var animSync = new aeris.maps.animations.AnimationSync([radarLayer, satelliteLayer], {
  from: SOME_TIME,
  to: ANOTHER_TIME,
  // Default AnimationType is aeris.maps.animations.AutoUpdateAnimation
  AnimationType: aeris.maps.animations.TileAnimation
});

I hope this helps you out. The autoUpdate logic can admittedly get kind of confusing, as it necessarily makes some assumptions about how you want the animation to behave over time. I'll try to get to fixing this as soon as I can -- I'm still working through my post-vacation inbox right now, so I'm not sure what all is on my plate for the next week.

Edan

from aerisjs.

lpostuma avatar lpostuma commented on July 29, 2024

Hi Edan,

Thanks for your response. For the time being, I’ve taken your suggestion by using the TileAnimation object instead, and as you noted, this deals with the issue (without advancing the timeframe).

If I have time this week, I can try to look into it a bit more, but this will do for the time being.

Thanks for your work on this!

Luuk

From: Edan Schwartz [mailto:[email protected]]
Sent: Monday, August 25, 2014 10:25 AM
To: hamweather/aerisjs
Cc: Luuk Postuma
Subject: Re: [aerisjs] Sync breaks after time (#25)

Hi -- sorry for the slow response. I've been out of town for the last two weeks.

I couldn't say offhand exactly what's going on, but I should be able to get a fix for the demo page up within the next couple of weeks (and probably on the dev branch sooner than that). In the meantime, I can try to point you in the right direction.

The AnimationSync object wraps each layerhttps://github.com/hamweather/aerisjs/blob/master/src/maps/animations/animationsync.js#L137-L141 in an AutoUpdateAnimationhttps://github.com/hamweather/aerisjs/blob/master/src/maps/animations/autoupdateanimation.js#L40-40 object, which it uses to animate through each layer's tiles. The AutoUpdateAnimation object requests new tile times at a fixed intervalhttps://github.com/hamweather/aerisjs/blob/master/src/maps/animations/autoupdateanimation.js#L70-70 (eg. every 6 minutes for Radar), and updates the from/to bounds of the animation with the new timeshttps://github.com/hamweather/aerisjs/blob/master/src/maps/animations/autoupdateanimation.js#L61-63.

It is possible that the demo UI is not responding correctly to autoUpdate events. I see two places in the demo code which modify the range input after an autoUpdate:

  1. The load:times event handlerhttps://github.com/hamweather/aerisjs/blob/master/examples/animations/sync.html#L133-142
  • The AutoUpdateAnimation has requested and received new times
  1. The 'change:from change:to` event handlerhttps://github.com/hamweather/aerisjs/blob/master/examples/animations/sync.html#L160-168
  • The AutoUpdateAnimation has updated the animation bounds to match the received times.

If you do not need the autoUpdate behavior for your application, you can easily fix this problem by telling the AnimationSync to wrap the layers in a standard TileAnimation object, instead of the default AutoUpdateAnimation object:

var animSync = new aeris.maps.animations.AnimationSync([radarLayer, satelliteLayer], {

from: SOME_TIME,

to: ANOTHER_TIME,

// Default AnimationType is aeris.maps.animations.AutoUpdateAnimation

AnimationType: aeris.maps.animations.TileAnimation

});

I hope this helps you out. The autoUpdate logic can admittedly get kind of confusing, as it necessarily makes some assumptions about how you want the animation to behave over time. I'll try to get to fixing this as soon as I can -- I'm still working through my post-vacation inbox right now, so I'm not sure what all is on my plate for the next week.

Edan


Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-53270144.

from aerisjs.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.