Skip to content
Permalink
Browse files

Only pass on the render context temporal range to the data provider

when the layer is set to the ModeTemporalRangeFromDataProvider mode
  • Loading branch information
nyalldawson committed Mar 5, 2020
1 parent fa6d62f commit ce065059cb12f1a89c16b65c7486d32ce4436ff7
Showing with 15 additions and 4 deletions.
  1. +15 −4 src/core/raster/qgsrasterlayerrenderer.cpp
@@ -228,12 +228,23 @@ QgsRasterLayerRenderer::QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRender
if ( rasterRenderer && !( rendererContext.flags() & QgsRenderContext::RenderPreviewJob ) )
layer->refreshRendererIfNeeded( rasterRenderer, rendererContext.extent() );

if ( renderContext()->isTemporal() && mPipe->provider()->temporalCapabilities() )
if ( layer->temporalProperties()->isActive() && renderContext()->isTemporal() )
{
mPipe->provider()->temporalCapabilities()->setRequestedTemporalRange( rendererContext.temporalRange() );
mPipe->provider()->temporalCapabilities()->setRequestedReferenceTemporalRange( layer->temporalProperties()->referenceTemporalRange() );
switch ( layer->temporalProperties()->mode() )
{
case QgsRasterLayerTemporalProperties::ModeFixedTemporalRange:
break;

case QgsRasterLayerTemporalProperties::ModeTemporalRangeFromDataProvider:
// in this mode we need to pass on the desired render temporal range to the data provider
if ( mPipe->provider()->temporalCapabilities() )
{
mPipe->provider()->temporalCapabilities()->setRequestedTemporalRange( rendererContext.temporalRange() );
mPipe->provider()->temporalCapabilities()->setRequestedReferenceTemporalRange( layer->temporalProperties()->referenceTemporalRange() );
}
break;
}
}

}

QgsRasterLayerRenderer::~QgsRasterLayerRenderer()

0 comments on commit ce06505

Please sign in to comment.
You can’t perform that action at this time.