- changed status to open
Opening WMS changes QGIS Project/Main canvas CRS to EPSG:3857
How to reproduce:
- Go to Tools → Open WMS Layer
- Select e.g. Google Satellite
- In Data Sources select this layer and open in new Map View
Comments (6)
-
-
Data Source URL:
type=xyz&url=https://mt1.google.com/vt/lyrs%3Ds%26x%3D{x}%26y%3D{y}%26z%3D{z}&zmax=19&zmin=0
-
This behavior is cause by the QgsLayerTreeMapCanvasBrigde (
qgsmaplayertree.cpp line 112 ff
):if ( mFirstCRS.isValid() && firstLayers ) { const QgsGui::ProjectCrsBehavior projectCrsBehavior = QgsSettings().enumValue( QStringLiteral( "/projections/newProjectCrsBehavior" ), QgsGui::UseCrsOfFirstLayerAdded, QgsSettings::App ); switch ( projectCrsBehavior ) { case QgsGui::UseCrsOfFirstLayerAdded: { const bool planimetric = QgsSettings().value( QStringLiteral( "measure/planimetric" ), true, QgsSettings::Core ).toBool(); // Only adjust ellipsoid to CRS if it's not set to planimetric QgsProject::instance()->setCrs( mFirstCRS, !planimetric ); break; } case QgsGui::UsePresetCrs: break; } }
In a new EnMAP-Box MapView, the QgsLayerTreeMapCanvasBrigde connected the QgsMapCanvas with its LayerTree. Added a new layer to the QgsMapCanvas will set mFirstCRS to the new layers’s CRS and trigger:
QgsProject::instance()->setCrs( mFirstCRS, !planimetric )
which changes the QGIS MapCanvas CRS. By commit history, this has been added to
-
refactoring mapcanvas.py: added mFirstCrs
added snippet for qgsmaplayertreebridge_problem.py (addresses
#656)→ <<cset a95f033e6c93>>
-
- changed status to resolved
-
@Fabian Thiel the problem should not exist anymore if there is at least one layers visible in the main QGIS layer tree. Please check and close this issue if appropriate.
- Log in to comment
This might be a QGIS issue. I know a similar problem from the EO Time Series Viewer.