Skip to content

Commit

Permalink
Show cannot pan WARNING for NULL geometry (#3255)
Browse files Browse the repository at this point in the history
  • Loading branch information
tudorbarascu authored and m-kuhn committed Jun 29, 2016
1 parent 78569ab commit 50dd57d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1135,7 +1135,13 @@ void QgsMapCanvas::panToSelected( QgsVectorLayer* layer )

QgsRectangle rect = mapSettings().layerExtentToOutputExtent( layer, layer->boundingBoxOfSelected() );
if ( !rect.isNull() )
{
setCenter( rect.center() );
}
else
{
emit messageEmitted( tr( "Cannot pan to selected feature(s)" ), tr( "Geometry is NULL" ), QgsMessageBar::WARNING );
}
} // panToSelected

void QgsMapCanvas::keyPressEvent( QKeyEvent * e )
Expand Down

0 comments on commit 50dd57d

Please sign in to comment.