I have project in QGIS 3.2 with different shapefiles and WMS layer. When I start the projectfile (.qgs) I want the extent of the map to be the same as one specific WMS layer (same as the option "zoom to layer" in QGIS).
I created the following macro, where I get the right scale of the layer but the extent is not adjusted to the specific layer.
def openProject(): from qgis.utils import iface iface.mapCanvas().zoomScale(4096000)
Is there an macro or even an option in QGIS to accomplish this?