[QGIS-Developer] Changing the logic for map extents in composer templates?

Denis Rouzaud denis.rouzaud at gmail.com
Sat Aug 5 00:25:18 PDT 2017


Although it adds a new setting, my vote goes to solution 2. I'm not a fan
of "black magic".

Cheers,
Denis

Le sam. 5 août 2017 à 08:50, Nyall Dawson <nyall.dawson at gmail.com> a écrit :

> Hi all,
>
> I've recently been made aware of an issue regarding creating new print
> compositions from templates.
>
> Currently, the logic used here is:
>
> 1. For all map items in the template, check the stored map extent
> 2. If this stored extent intersects the full extent of the layers in
> the map canvas, then keep it. If not, reset the map item's extent to
> match the map canvas.
>
> I think this logic could be refined. The issue is that any project
> with a "global" basemap layer (such as a wms/xyz
> tiled/QuickMapServices/etc layer) will ALWAYS satisy the "stored
> extent intersects the full canvas extent" requirement, so the map
> item's extent will never be altered.
>
> Possible solutions I can see are:
> 1. Change the test to be "if the stored extent has any intersection
> with the CURRENT map canvas extent, keep it. Otherwise reset it to the
> map canvas extent."
> 2. (more intrusive, but more flexible) Add a new "template settings"
> section to composer map item properties, with a checkbox for "Store
> map extent for use in templates". If checked, the stored map extent in
> the template will ALWAYS be used for that map. If unchecked, the map's
> extent will ALWAYS be reset to match the current canvas extent. It's
> an extra setting, but possibly making the logic explicit and visible
> to users will actually make this behaviour simpler to understand.
>
> What are other's thoughts?
>
> Nyall
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170805/e3eb0ff1/attachment.html>


More information about the QGIS-Developer mailing list