I have a layer of reference grid lines on top of several map layers. The grid lines should be labeled with coordinate values: vertical grid lines with x-values and horizontal lines with y-values. The label position should be at the border of the current mapcanvas extent.

I was unable to write an expression which uses mapCanvas().extent() due to illegal characters (the dot) . Geometry properties only will not return these coordinates.

My idea so far: creating point features at the intersection of grid lines and map extent triggered by extentChanged event, and labeling these points.

Has somebody a better idea?

  • 1
    Are you trying to do this in the print composer?
    – Ger
    Jul 28, 2015 at 13:06
  • I want this in the map view. I know the grid as decoration, but I want more flexibility concerning the labeling. Then this Feature might be used for labeling other objects as well, eg streets labeled with the next City lying outside the map.
    – Detlev
    Jul 28, 2015 at 13:34
  • @Detlev u want the labeling to appear only on the border of the MapCanvas and not at every lines crossings ?
    – Snaileater
    Jul 29, 2015 at 8:54
  • @snaileater yes, only at the border of the map canvas. I need more control over the reference grid and the labels at the border, the
    – Detlev
    Jul 29, 2015 at 12:01

1 Answer 1


Have you looked into the Maplex Label Engine? It's a pretty powerful labeling option that might be suited for your needs. It comes with all ArcMap versions over 10.0 IIRC.

  • the question is qgis/pyqgis related obviously ...
    – Snaileater
    Jul 29, 2015 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.