time-awareness for imageryproviders

Hi there,

is there a built-in way to have imagery providers/layers be shown-hidden using the clock/TimeSliderWidget ?

for dynmanic objects we use the 'availability' attribute to define when to display a vector, does the equivalent exist for imagery ?

i assume we can listen for the timeslider activity/events and dynamically show/hide layers, but before implementing that i'd like to confirm i'm not missing anything that already exists.

cheers

-i

Hi,

No, sorry, there is currently no built-in way to show/hide imagery layers with time, so doing it manually is your best bet. Consider setting the layer alpha property to 0 instead of settings the show property to false. Layers with alpha of zero are downloaded as needed, but are not rendered. Layers that are not shown, on the other hand, are not even downloaded.

Kevin

OK thanks Kevin,

We have succeeded in getting our ImageProviders ‘connected’ to the time slider:

// call me.checkTime on clock ticks and manual time slider changes. function takes optional scope argument.

cesiumViewer.timeline.addEventListener(‘settime’, this.checkTime);

cesiumViewer.clock.onTick.addEventListener(function() {

me.checkTime(me)

});

checkTime: function(scope) {

if (scope != null) scope = this;

var now = cesiumViewer.clock.currentTime;

The transition is a bit ‘blinky’, even though we show the next image before hiding the previous one, but for now its ok.

it would be great if this was unnecessary, i imagine we are not the only ones wanting time-filtered images… (weather, scientific data etc). is there a place i can make an official feature request ?

-i

Hi,

Regarding the blinkyness, did you try setting the alpha property of the layer rather than using the show property? That should reduce the blinking. It will be reduced further if you add the new layer (with an alpha of 0) prior to the time it is needed, so that by the time you want it visible it has already loaded.

Regarding a feature request, it’s on the roadmap already:

https://github.com/AnalyticalGraphicsInc/cesium/issues/526

(second-to-last item in the “Interaction with other parts of Cesium” section)

Kevin

Kevin

Hi again Kevin,

sorry for not mentioning that.. yes we did try adding the image layers with alpha=0 but we ended up exploding the browser... it seems that an image of alpha 0 still costs the browser in terms of processing, whereas (fortunately) putting show=false doesn't. I could make a test case if it would help you to recuperate the original error message, i can't remember what it was exactly but i understood 'too much data'.

note we are visualising ~ 30 1000x1000 pixel images. the current situation works fine its just a bit unpleasant to the eye. it may be that we could piece something together that makes a layer alpha 0 and then visible, but we haven't gotten around to it yet.

-i

Yeah, you won’t be able to add all 30 layers at once with alpha=0. But the trick to avoiding blinking is to set the next layer to show=true, alpha=0 before the time comes to show it. Then, when the time comes, set alpha=1 on that layer and it will appear instantly without blinking. At the same time, set the next layer’s show=true, alpha=0 so it will be ready when its time comes. Does that make sense?

Kevin

Hey,

yep it makes sense and we had imagined it would be possible using an approach like that… to go a but further maybe starting a little background worker that rapidly fades in and out layers (to get a crossfade effect) that we can call from hideLayer(layer_id) showLayer(layer_id) type calls… but for now the problem is not as high on our list as other ‘core’ stuff that isn’t implemented yet at all. when we do the work we’ll report back on our final strategy… but i reckon it’ll be something similar to what you suggested above.

thanks and cheers

-i