[Qgis-user] Showing coordinates of the composer map item in a label

Nyall Dawson nyall.dawson at gmail.com
Thu Oct 27 11:54:29 PDT 2016


On 28 Oct 2016 1:51 AM, "DelazJ" <delazj at gmail.com> wrote:
>
> Hi all,
>
> Is that possible to create a label which displays the x and y coordinates
of a selected map item in the composer.
> I suspect x(@map_extent_center) to do the trick but I'm unable to find
how to call the map_extent_center variable in a label item as it's stuck to
the map item afaics.
>
> Any tip, please?

It's not currently possible unless you write a python function to do this.

I've been pondering this week about allowing items to access the variables
from another item but need to think this through more.

My (current) use case:
- working on a map of a train line which consists of three vertical panels
covering different parts of the line
- certain elements (like label buffers) in the map style use a
@background_color variable to data define their color
- each map item in the composition has its own @background_color variable
set so that this color represents a good background color for the visible
content within that panel
- I want to style things like North arrows to reuse the @background_color
variable from the map item they are associated with.

Nyall
>
> Thanks,
> Harrissou
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20161028/c60cd20e/attachment.html>


More information about the Qgis-user mailing list