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:
- The GridLabel columns contain the calculated label value that depends on the CoordSys used and the gridline properties.
- The LineType columns contain a value 1 for horizontal lines and 2 for vertical lines.
- 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