Gridline Layer Label Expressions - 2023

MapInfo Pro Release Notes

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
MapInfo > MapInfo EasyLoader
MapInfo > License Server Utility
MapInfo > MapBasic
MapInfo > MapInfo Pro Advanced
Version
2023
Language
English
Product name
MapInfo Pro
Title
MapInfo Pro Release Notes
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:43:38.341845

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) ' 
C:\Users\Santa.Claus\AppData\Local\Temp\MIPRO\MapInfo.Application.x64_26724\Gridline0003.TAB