Skip to content

Commit

Permalink
optimize scale for point layers in QgsMapCanvas::zoomToFeatureIds
Browse files Browse the repository at this point in the history
similarly to what is done in zoomToSelected
  • Loading branch information
3nids committed Sep 21, 2020
1 parent b47346b commit 8d385be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1338,6 +1338,10 @@ void QgsMapCanvas::zoomToFeatureIds( QgsVectorLayer *layer, const QgsFeatureIds
QString errorMsg;
if ( boundingBoxOfFeatureIds( ids, layer, bbox, errorMsg ) )
{
if ( bbox.isEmpty() )
{
bbox = optimalExtentForPointLayer( layer, bbox.center() );
}
zoomToFeatureExtent( bbox );
}
else
Expand Down

0 comments on commit 8d385be

Please sign in to comment.