Opened 13 years ago

Last modified 13 years ago

#3697 assigned bug

Zoom to full extent considers only visible layers

Reported by: pcav Owned by: sunilkcube
Priority: minor: annoyance Milestone: Version 1.7.0
Component: GUI Version:
Keywords: zoom, full extent Cc: andrea.peri@…
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

Zoom to full extent should zoom to the full extent of all loaded layers (as most popular packages do), not only to those activated in the legend

Attachments (4)

Patch_for_the_bug_#3697.diff (917 bytes ) - added by sunilkcube 13 years ago.
Patch_for_the_bug_#3697.2.diff (917 bytes ) - added by sunilkcube 13 years ago.
sample_patch.diff (2.4 KB ) - added by sunilkcube 13 years ago.
fix_zoom_to_full_extent.diff (2.4 KB ) - added by alexbruy 13 years ago.
Proposed patch

Download all attachments as: .zip

Change History (13)

comment:1 by sunilkcube, 13 years ago

Owner: changed from nobody to sunilkcube
Status: newassigned

comment:2 by sunilkcube, 13 years ago

The Layers available only in Mapcanvas are used to calculate Full Extent not all the layers present in the Maplayerregistry. Because the design intention of "Zoom Full" may be to show only the visible layers in the Mapcanvas not all the layers. Can anyone please suggest whether we can use "Zoom Full" to show all the visible and invisible layers to calculate the Full extent like other GIS packages?.

comment:3 by pcav, 13 years ago

IMHO yes, also according to the principle of least surprise.

by sunilkcube, 13 years ago

by sunilkcube, 13 years ago

in reply to:  3 ; comment:4 by sunilkcube, 13 years ago

Replying to pcav:

Thank you for your opinion.

IMHO yes, also according to the principle of least surprise.

Then I have created a patch for that design. Can you kindly have a look on it and reply me in case of any comments ?

in reply to:  4 ; comment:5 by wonder, 13 years ago

Replying to sunilkcube:

Then I have created a patch for that design. Can you kindly have a look on it and reply me in case of any comments ?

Using layers from QgsMapLayerRegistry for zoom full functionality may not always work correctly. Not all layers in the registry have to be necessarily connected with the map renderer. There could be other (unrelated) map canvases with their map renderers with different set of layers...

in reply to:  5 comment:6 by sunilkcube, 13 years ago

Replying to wonder:

Using layers from QgsMapLayerRegistry for zoom full functionality may not always work correctly. Not all layers in the registry have to be necessarily connected with the map renderer. There could be other (unrelated) map canvases with their map renderers with different set of layers...

Thanks for your suggestions ! Can we use the layers directly from the QgsMapCanvas(layers got from the QgsLegend) instead of QgsMapLayerRegistry for calculating full extent. I have attached a sample patch file regarding this, Can you please verify whether this logic is fine ? Waiting for your comments ...

by sunilkcube, 13 years ago

Attachment: sample_patch.diff added

comment:7 by alexbruy, 13 years ago

Keywords: zoom full extent added

Here is complete patch to fix this issue

by alexbruy, 13 years ago

Proposed patch

comment:8 by pcav, 13 years ago

Can we include it in 1.7?

in reply to:  8 comment:9 by alexbruy, 13 years ago

Replying to pcav:

Can we include it in 1.7?

I ask Martin to review it. If there is no objections, I'll commit it

Note: See TracTickets for help on using tickets.