I started with the same setup in QGIS 2.99.0 (bc08a79) and QGIS 2.18.6 (both on Windows 10):
- The project CRS is set to EPSG:3857
- I added 1 layer: An XYZ tile layer with OpenStreetMap tiles:
http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
- I Zoomed out to see the entire world
- In QGIS 2.18.6 OTF is set to enabled. In version 2.99.0 OTF is always enabled.
When I run the following script in the Python Console to set the project CRS to EPSG:31370:
canvas = iface.mapCanvas()
target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId(31370, QgsCoordinateReferenceSystem.EpsgCrsId)
canvas.setDestinationCrs(target_crs)
I get the following correct results in QGIS 2.18.6:
- The map is reprojected
- The coordinates in the status bar are correct when I move the mouse pointer over the map
- The code of the CRS in the status bar is correct: EPSG:31370 (OTF)
- When hovering that CRS code in the status bar it shows "Current CRS Belge 1972 / Belgian Lambert 72 (OTF enabled)"
- When I click on that CRS code in the status bar, it opens the Project Properties with EPSG:31370 selected
All these results are as I expect them to be.
When I run the exact same code in QGIS 2.99.0, I get the following expected results:
- The map is reprojected
- The coordinates in the status bar are correct when I move the mouse pointer over the map
But I also get the following unexpected results:
- The code of the CRS in the status bar is not correct: EPSG:3857
- When hovering that CRS code in the status bar it shows the incorrect "Current CRS WGS 84 / Pseudo Mercator"
- When I click on that CRS code in the status bar, it opens the Project Properties with EPSG:3857 selected
When I use a global Natural Earth shapefile I get the same results.
What do I have to do to get the same correct result in both versions of QGIS? Can anyone explain what's happening in version 2.99.0?