Skip to content

Commit

Permalink
update temporal extent
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Apr 7, 2020
1 parent bf0aafc commit cf9e4af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgstemporalnavigationobject.cpp
Expand Up @@ -90,7 +90,13 @@ QgsDateTimeRange QgsTemporalNavigationObject::dateTimeRangeForFrameNumber( long
void QgsTemporalNavigationObject::setTemporalExtents( const QgsDateTimeRange &temporalExtents )
{
mTemporalExtents = temporalExtents;
int currentFrameNmber = mCurrentFrameNumber;
setCurrentFrameNumber( 0 );

//Force to emit signal if the current frame number doesn't change
if ( currentFrameNmber == mCurrentFrameNumber )
emit updateTemporalRange( dateTimeRangeForFrameNumber( 0 ) );

}

QgsDateTimeRange QgsTemporalNavigationObject::temporalExtents() const
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgstemporalcontrollerwidget.cpp
Expand Up @@ -173,6 +173,7 @@ void QgsTemporalControllerWidget::onProjectCleared()
mHasTemporalLayersLoaded = false;
mStartDateTime->setDateTime( QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ) ) );
mEndDateTime->setDateTime( mStartDateTime->dateTime() );
updateTemporalExtent();
}

void QgsTemporalControllerWidget::updateSlider( const QgsDateTimeRange &range )
Expand Down Expand Up @@ -230,6 +231,7 @@ void QgsTemporalControllerWidget::setDatesToProjectTime()
{
mStartDateTime->setDateTime( range.begin() );
mEndDateTime->setDateTime( range.end() );
updateTemporalExtent();
}
}

Expand Down

0 comments on commit cf9e4af

Please sign in to comment.