block by ThomasG77 7c2ecd106091a335a2138dcd82565db8

Add this script in startup.py to now see zoom for EPSG 3857 when the canevas is using it

pyqgis-add-zoom-levels-3857.py

from math import cos, log, pi
from qgis.utils import iface
from qgis.PyQt.QtWidgets import QLabel

# Not needed here but could be useful later
# def getScale(zoom_level, screen_dpi=96, latitude=0):
#     resolution = (6378137.0 * 2 * pi / 256) * cos(latitude) / (2**zoom_level)
#     return (screen_dpi * 1/0.0254 * resolution)

def getZoomLevel(scale, screen_dpi=96, latitude=0):
    resolution = scale / (screen_dpi * 1/0.0254)
    zoom_level = ((6378137.0 * 2 * pi / 256) * cos(latitude)) / resolution
    return log(zoom_level)/log(2)

canvas = iface.mapCanvas()

labelZoomNumberEpsg3857 = QLabel()
iface.mainWindow().statusBar().addPermanentWidget(labelZoomNumberEpsg3857)

def changeZoomNumberOsm(scale):
    rounded_zoom_level = round(getZoomLevel(scale), 2)
    labelZoomNumberEpsg3857.setText("Zoom level : {}".format(str(rounded_zoom_level)))

canvas.scaleChanged.connect(changeZoomNumberOsm)

def showHideZoomLevel():
    if canvas.mapSettings().destinationCrs().authid() == "EPSG:3857":
        labelZoomNumberEpsg3857.show()
    else:
        labelZoomNumberEpsg3857.hide()

canvas.destinationCrsChanged.connect(showHideZoomLevel)