Skip to content

Commit

Permalink
Update vector extents after changing data source for a vector layer
Browse files Browse the repository at this point in the history
Otherwise the old extents are still used after changing a vector's
source
  • Loading branch information
nyalldawson committed Mar 26, 2020
1 parent f525d01 commit c92dffe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -7841,6 +7841,9 @@ void QgisApp::changeDataSource( QgsMapLayer *layer )
vlayer->setSubsetString( subsetString );
}

if ( vlayer )
vlayer->updateExtents();

// All the following code is necessary to refresh the layer
QgsLayerTreeModel *model = qobject_cast<QgsLayerTreeModel *>( mLayerTreeView->model() );
if ( model )
Expand Down

0 comments on commit c92dffe

Please sign in to comment.