I have a PyQGIS application that uses the QgsMapCanvas
as map display. I am trying to retrieve its four corners' coordinates, but couldn't find any public function to do that. All I have is its width()
and height()
.
Is there any way to get the actual coordinates of the corners of the viewport?
Let me provide further context, I need the map canvas's viewport's corners' coordinates when it has not had any layers loaded into it yet or the first layer I am constructing is in memory that has yet to set its projection, I found that in such cases, the map canvas's extent is empty, so calling its extent won't help.