You can retrieve the extent coordintes of map item via variables, and use them in text box.
x_min - [% to_dms(x_min(transform( map_get(item_variables('map'),'map_extent'),'EPSG:3857','EPSG:4326')),'x',2)%]
y_max - [% to_dms(y_max(transform( map_get(item_variables('map'),'map_extent'),'EPSG:3857','EPSG:4326')),'y',2)%]
Expression explained step by step:
To get the geometry of map item use (map item name is map
):
map_get(item_variables('map'),'map_extent')
Retrieve the corner coordinate with y_max
, y_min
, x_max
or x_min
y_max( map_get(item_variables('map'),'map_extent'))
For getting WGS84, use transform
function. Example of transfrom from EPSG:3857
:
y_max(transform( map_get(item_variables('map'),'map_extent'),'EPSG:3857','EPSG:4326'))
To change degrees format to DMS just use to_dms
function
to_dms(y_max(transform( map_get(item_variables('map'),'map_extent'),'EPSG:3857','EPSG:4326')),'y',2)
Adjust the text in box, add both corner coordinates and format as needed. Repeat the process for rest corners. Values will be automatically updated when you move the map extent.
Best Answer
Have you set the x and y grid interval? By default the interval is set to 0, which results in no grid lines shown. You'll need to manually set them both to the desired values before a grid will display.