mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-05 00:04:40 -05:00
Fix incorrect projection if raster or plugin layer is first layer
loaded into an empty project (fix #14392)
This commit is contained in:
parent
054894a3dc
commit
15d2be26f1
@ -144,10 +144,10 @@ void QgsLayerTreeMapCanvasBridge::setCanvasLayers()
|
||||
continue;
|
||||
|
||||
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layerNode->layer() );
|
||||
if ( vl && vl->geometryType() != QGis::NoGeometry )
|
||||
if ( !vl || vl->geometryType() != QGis::NoGeometry )
|
||||
{
|
||||
mCanvas->setDestinationCrs( vl->crs() );
|
||||
mCanvas->setMapUnits( vl->crs().mapUnits() );
|
||||
mCanvas->setDestinationCrs( layerNode->layer()->crs() );
|
||||
mCanvas->setMapUnits( layerNode->layer()->crs().mapUnits() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user