Functions | |
void | Labels.AddLabel (string Text, double x, double y, double offsetX, double offsetY, double Rotation, int Category) |
Adds a new label as the last one in the list. More... | |
void | Labels.AddPart (int Index, string Text, double x, double y, double offsetX, double offsetY, double Rotation, int Category) |
Adds a part to the label with specified index. More... | |
void | Labels.Clear () |
Removes all the labels and parts but not the visualization categories. More... | |
int | Labels.Generate (string Expression, tkLabelPositioning Method, bool LargestPartOnly) |
Generates labels for each shape of the parent shapefile. More... | |
Label | Labels.get_Label (int Index, int Part) |
Gets label with the specified index. More... | |
int | Labels.get_NumParts (int Index) |
Gets the number of parts for the label with specified index. More... | |
bool | Labels.InsertLabel (int Index, string Text, double x, double y, double offsetX, double offsetY, double Rotation, int Category) |
Inserts a new label at the given position. More... | |
bool | Labels.InsertPart (int Index, int Part, string Text, double x, double y, double offsetX, double offsetY, double Rotation, int Category) |
Inserts a new part for the specified label. More... | |
bool | Labels.RemoveLabel (int Index) |
Removes a label with the specified index. If the label is multipart then all its parts will be removed. More... | |
bool | Labels.RemovePart (int Index, int Part) |
Removes a part of label with the specified index. More... | |
Properties | |
int | Labels.Count [get] |
Gets the number of labels. More... | |
bool | Labels.Synchronized [get, set] |
Gets or sets a boolean value which indicates whether labels should be synchronized with the parent shapefile. More... | |
Here is a list of properties and methods for adding labels (or their parts) to the map or removing them. This module is a part of the documentation of Labels class.
void Labels.AddLabel | ( | string | Text, |
double | x, | ||
double | y, | ||
double | offsetX, | ||
double | offsetY, | ||
double | Rotation, | ||
int | Category | ||
) |
Adds a new label as the last one in the list.
All the parameters passed to the method can be changed afterwards using Labels.get_Label() property.
Text | The text of the new label. |
x | The x coordinate of the new label. |
y | The y coordinate of the new label. |
offsetX | The x offset in pixels of the new label. |
offsetY | The y offset in pixels of the new label. |
Rotation | The rotation of the label in degrees. Positive values set clockwise rotation, negative - counter-clockwise. |
Category | The index of visualization category to be used for the label drawing. Default value is -1, which means the default drawing options will be used. |
void Labels.AddPart | ( | int | Index, |
string | Text, | ||
double | x, | ||
double | y, | ||
double | offsetX, | ||
double | offsetY, | ||
double | Rotation, | ||
int | Category | ||
) |
Adds a part to the label with specified index.
According to the shapefile specification shapes such as polylines or polygons can have multiple parts. Use this method to add a separate label for each part of the parent shape.
Index | The index of label to add a part to. |
Text | The text to be displayed. |
x | The x coordinate of the part. |
y | The y coordinate of the part. |
offsetX | The x offset in pixels of the new label. |
offsetY | The y offset in pixels of the new label. |
Rotation | The rotation of the label's part. |
Category | The index of visualization category to be used for the label drawing. Default value is -1, which means the default drawing options will be used. |
///
void Labels.Clear | ( | ) |
Removes all the labels and parts but not the visualization categories.
int Labels.Generate | ( | string | Expression, |
tkLabelPositioning | Method, | ||
bool | LargestPartOnly | ||
) |
Generates labels for each shape of the parent shapefile.
Applicable for the instances of Labels class associated with shapefile, i.e. returned by Shapefile.Labels property.
Expression | The expression to be used for generation of the text for labels. |
Method | The method to calculate position of each label. |
LargestPartOnly | A value which indicates whether labels should be created for each part of the multipart shape or for the largest part only. |
Label Labels.get_Label | ( | int | Index, |
int | Part | ||
) |
Gets label with the specified index.
Index | The index of label to return. |
Part | The part of the label to return. In case of single part labels 0 should be used. |
int Labels.get_NumParts | ( | int | Index | ) |
Gets the number of parts for the label with specified index.
Index | The index of the label. |
bool Labels.InsertLabel | ( | int | Index, |
string | Text, | ||
double | x, | ||
double | y, | ||
double | offsetX, | ||
double | offsetY, | ||
double | Rotation, | ||
int | Category | ||
) |
Inserts a new label at the given position.
Index | The index to insert the label at. |
Text | The text of the label. |
x | The x coordinate of the label. |
y | The y coordinate of the label. |
offsetX | The x offset in pixels of the label. |
offsetY | The y offset in pixels of the label. |
Rotation | The angle of label rotation. |
Category | The index of the visualization category for the label. Use -1 if the label doesn't belong to any category. |
bool Labels.InsertPart | ( | int | Index, |
int | Part, | ||
string | Text, | ||
double | x, | ||
double | y, | ||
double | offsetX, | ||
double | offsetY, | ||
double | Rotation, | ||
int | Category | ||
) |
Inserts a new part for the specified label.
Labels can have several parts which correspond to the parts of shapes they belong to.
Index | The index of the label. |
Part | The index to insert the new part at. |
Text | The text of the label. |
x | The x coordinate of the label. |
y | The y coordinate of the label. |
offsetX | The x offset in pixels of the label. |
offsetY | The y offset in pixels of the label. |
Rotation | The rotation of the label in degrees. |
Category | The index of visualization category. Use -1 if the label doesn't belong to any category. |
///
bool Labels.RemoveLabel | ( | int | Index | ) |
Removes a label with the specified index. If the label is multipart then all its parts will be removed.
Index | The index of the label to be removed. |
bool Labels.RemovePart | ( | int | Index, |
int | Part | ||
) |
Removes a part of label with the specified index.
Index | The index of the label. |
Part | The index of part to be removed. |
|
get |
|
getset |
Gets or sets a boolean value which indicates whether labels should be synchronized with the parent shapefile.
Synchronization means that labels will be automatically added or removed simultaneously with the corresponding operation in the shapefile. Labels can be synchronized only if their number is equal to the number of shapes.