Gridline Layer Label Expressions - 2023

MapInfo Pro Release Notes

MapInfo > MapInfo Pro Advanced
MapInfo > License Server Utility
MapInfo > MapInfo EasyLoader
MapInfo > MapBasic
MapInfo > MapInfo Pro
Product family
Product name
MapInfo Pro
MapInfo Pro Release Notes
First publish date

The Label with expression in Gridline modifies the Labels shown on Gridline Layers. The example below shows the before and after truncation of the Gridline Label values to use only the first two numbers.

Note: A Gridline Label with expression will generate a version 2300 workspace file. If the expression is the default GridLabel, the workspace version should not be increased.
Label Expression example:
Set Map Layer 1 Label with Val(Left$(Right$(GridLabel, 6),2))

While using the Gridline layers, a temporary hidden table is created in the mapinfo temp folder that contains the lines and the following attribute columns:

  1. The GridLabel columns contain the calculated label value that depends on the CoordSys used and the gridline properties.
  2. The LineType columns contain a value 1 for horizontal lines and 2 for vertical lines.
  3. The LabelPosition is a number representing where the label is drawn. Use an expression like: Set Map Window 3004 Layer 1 Label With GridLabel+"_"+Str$(LineType)+"_"+Str$(LabelPosition) to see the various values.

You can find the alias and path of the gridline table using MapBasic:

print layerinfo(3002, 1, LAYER_INFO_ALIAS) ' Gridline0001
print layerinfo(3002, 1, LAYER_INFO_PATH) '