Skip to content
Permalink
Browse files

Make sure to refresh canvas when layer's CRS is changed

  • Loading branch information
wonder-sk committed Sep 11, 2014
1 parent 302c604 commit ed11c57a6980bb8d5cc91810333ce21b8201d966
Showing with 9 additions and 6 deletions.
  1. +9 −6 src/app/qgisapp.cpp
@@ -6975,30 +6975,30 @@ void QgisApp::setLayerCRS()

QgsCoordinateReferenceSystem crs( mySelector.selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );

// Turn off rendering to improve speed.
mMapCanvas->freeze();

foreach ( QgsLayerTreeNode* node, mLayerTreeView->selectedNodes() )
{
if ( QgsLayerTree::isGroup( node ) )
{
foreach ( QgsLayerTreeLayer* child, QgsLayerTree::toGroup( node )->findLayers() )
{
if ( child->layer() )
{
child->layer()->setCrs( crs );
child->layer()->clearCacheImage();
}
}
}
else if ( QgsLayerTree::isLayer( node ) )
{
QgsLayerTreeLayer* nodeLayer = QgsLayerTree::toLayer( node );
if ( nodeLayer->layer() )
{
nodeLayer->layer()->setCrs( crs );
nodeLayer->layer()->clearCacheImage();
}
}
}

// Turn on rendering (if it was on previously)
mMapCanvas->freeze( false );

mMapCanvas->refresh();
}

@@ -7109,7 +7109,10 @@ void QgisApp::legendGroupSetCRS()
foreach ( QgsLayerTreeLayer* nodeLayer, currentGroup->findLayers() )
{
if ( nodeLayer->layer() )
{
nodeLayer->layer()->setCrs( crs );
nodeLayer->layer()->clearCacheImage();
}
}
}

0 comments on commit ed11c57

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