Maptitude GISDK Help |
Get the label option settings for a layer or selection set.
In Version 6.0/2012 added options for callouts, halos, shadows.
options = GetLabelOptions(string lyr_set_name, array options)
Argument |
Contents |
lyr_set_name |
The name of the layer and selection set |
options |
The list of option names (strings) for which the current values are requested |
An array of option values for the requested options, selected from the following list:
Option |
Type |
Contents |
Alignment |
String |
Desired label position relative to the feature, expressed as a compass direction ("NW", "N", "NE", "W", "C", "E", "SW", "S," "SE") or "Auto" for automatic positioning |
Alternate Field |
String |
A field name, or an expression whose result is used as the label if using the primary field would cause an overlap but using this alternate would not |
Angle |
Real or String |
If real then a value between -90 and 90 to specify the slope of the labels, else the string "Automatic" to align with latitudes |
Callout Color |
Color |
Color of callout lines |
Callout Line Style |
Linestyle |
Style of callout lines |
Callout Style |
Integer |
1=straight line, 2=straight line with vertical bar, 3=bent line, or 4=bent line with vertical bar, corresponding to the four styles displayed on the callout tab |
Callout Width |
Real |
Width of callout lines |
Color |
Color |
Label color |
Extra Colors |
Array of colors |
Colors for second, third, etc. lines of multi-line labels |
Font |
String |
Font name, size, and style |
Format |
String |
Format to use when labeling a numeric field |
Frame Border Style |
Linestyle |
Style of the frame border |
Frame Border Color |
Color |
Color of the frame border |
Frame Border Width |
Real |
Width of the frame in points |
Frame Fill Color |
Color |
Color of the interior of the frame |
Frame Fill Style |
Fillstyle |
Style used for the interior of the frame |
Frame Shield |
Array |
The highway shield definition (string font_name, array of (integer index, color)) |
Frame Type |
String |
Shape of the frame ("ellipse", "rectangle", "rounded rectangle", or "shield") |
Framed |
Boolean |
Whether frames should be displayed around each label |
Halo Color |
Color |
Color used for halo |
Has Halo |
Boolean |
If "True" display halos on labels; the default is "False" |
Has Shadow |
Boolean |
If "True" display shadows on labels; the default is "False" |
Kern To Fill |
Boolean |
Whether label text should be stretched, by inserting extra spaces, to fit the feature being labeled |
Leading |
Integer |
Percentage of regular line spacing (100, the default, is normal) |
Left/Right |
Boolean |
If "True" look for a corresponding BA field matching the AB field in the input field name, and label both the left and the right sides of lines; the default is "False"; line layers only |
Line Length Limit |
Integer |
Maximum number of characters |
Overlap |
Boolean |
If "True" labels can be overlapped by other labels; the default is "False" |
Priority Expression |
String |
Expression whose value indicates the relative label priority among features in the layer or selection set |
Rotation |
Boolean |
Whether line labels should be rotated to align with line features |
Scale |
2 Reals |
Autoscale settings (real minimum scale, real maximum scale) |
Set Priority |
Integer |
Label priority for this layer or selection set |
Shadow Color |
Color |
Color used for shadow |
Skip Partial |
Boolean |
If "'True" then labels which cannot be fit fully on-screen will not be displayed; the default is "False" |
Smart |
Boolean |
Whether special label locating logic should be used to place a label in a more aesthetically pleasing location |
Uniqueness |
String |
Boolean value ("On" or "Off") to control whether unique labels are displayed (duplicate labels are not allowed), or a real value in a string to give the spacing in page units |
Visibility |
Boolean |
Whether labels are displayed ("On") or hidden ("Off") |
If there are no labels for the layer or selection set, an array of nulls is returned, one for each option specified, except Left/Right returns "False" and Scale returns array of two nulls.
opts = GetLabelOptions("States|", {"font", "visibility", "alignment"})
// opts = {"Arial|Bold|12", "On", "C"}
Error Type |
Meaning |
Error |
An option is invalid |
NotFound |
The specified layer or selection set does not exist |
Function |
Summary |
Gets the label expression for a layer or selection set |
|
Gets the status of whether labels can be drawn on top of point icons |
|
Enables or disables labeling for a layer or selection set |
|
Changes the option settings for labels |
|
Sets the status of whether labels can be drawn on top of point icons |
©2025 Caliper Corporation | www.caliper.com |