optimize scale for point layers in QgsMapCanvas::zoomToFeatureIds

similarly to what is done in zoomToSelected
This commit is contained in:
Denis Rouzaud 2020-09-21 07:46:51 +02:00
parent b47346ba20
commit 8d385be9bd

View File

@ -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