Hello all,

I just wanted to return to my problem and show my solution. Like I already 
said, I tried back and forth, to no avail. Like I already described, zoom to 
layer never worked, and I still believe my earlier observation is true, that 
loading multiple layers at once changes the map extent everytime a layer gets 
loaded/added.

What helped in the end was this single line of code, between the layer loading 
code and the final zoom to layer code ...

        # wait for application to process pending tasks
        QCoreApplication.processEvents()

Maybe this is helpful for others as well.

Have a nice day,
Frank


-----Ursprüngliche Nachricht-----
Von: QGIS-Developer <qgis-developer-boun...@lists.osgeo.org> Im Auftrag von 
Frank Broniewski via QGIS-Developer
Gesendet: Donnerstag, 22. Juni 2023 10:56
An: rdmaili...@duif.net; qgis-developer@lists.osgeo.org
Betreff: Re: [QGIS-Developer] PyQGIS zoom to layer not working

Hey Richard,

thanks for the good wishes! I feel, I completely jinxed it 😃. I will continue 
to investigate, as soon as I find a solution, I'll post it here ...

-----Ursprüngliche Nachricht-----
Von: Richard Duivenvoorde <rdmaili...@duif.net> 
Gesendet: Dienstag, 20. Juni 2023 15:33
An: Frank Broniewski <broniew...@a-a.lu>; qgis-developer@lists.osgeo.org
Betreff: Re: AW: [QGIS-Developer] PyQGIS zoom to layer not working

On 6/20/23 14:56, Frank Broniewski wrote:
> I did set the QGIS default CRS to 2169 in the options, but this did not help 
> unfortunately.

Mmm, that should work:

Settings / CRS and Transforms/ CRS for projects / Use a default CRS AND I would 
maybe also set the CRS for layer to epsg:2169

Another option is to create a 'Default Project' (empty, BUT crs set to 
epsg:2169) Settings / General / Set Current Project As Default and Checkbox 
'Create new project from default project'

fiddling with those I'm pretty sure it should be possible to start QGIS in the 
right crs..

Suc6

Richard Duivenvoorde
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to