I would like to set Map Tips to display coordinates of some feature in custom selected CRS. When I do:
<b>X: </b>[% $x %]<br> <b>Y: </b>[% $y %]
Tip displays coordinates in WGS84, but not in my current canvas CRS.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
$y takes coordinates directly from your data geometry (your data are in WGS), so it is project-independent. Probably you have set other CRS with on the fly reprojection, which could confuse you.
If you want display coordinates from data in other CRS, you have to use
transform function like this:
<b>X: </b>[% x(transform($geometry,'EPSG:4326', 'EPSG:XXXX')) %]<br> <b>Y: </b>[% y(transform($geometry,'EPSG:4326', 'EPSG:XXXX')) %]