Maptitude GISDK Help |
Modifies an existing annotation in a map or layout window.
Added Temporary option to Version 6.0/2012.
SetAnnotation(string window_spec, integer id, array specification)
Argument |
Contents |
window_spec |
Type and name of the window containing the annotation |
id |
Annotation ID |
specification |
Array of name-value pairs that modify the annotation |
Annotation Type |
Valid specifications |
Bitmap |
Color, File |
Compass |
Color, Font, Index |
Editor |
Color, Drop Shadow, Font, Grid, Line Color, Line Style, Line Width |
Ellipse |
Angle, Fill Color, Fill Style, Line Color, Line Style, Line Width, Location (2 coords on a layout, a scope on a map) |
Figure |
Drop Shadow, Line Color, Line Style, Line Width |
Font Character |
Angle, Font, Color, Index, Location (a coord) |
Label |
All the options appropriate for text |
Map |
Line Color, Line Style, Line Width, Scope |
Polygon |
Fill Color, Fill Style, Line Color, Line Style, Line Width |
Polyline |
From Arrow, Line Color, Line Style, Line Width, Smooth, To Arrow |
Rectangle |
Angle, Fill Color, Fill Style, Line Color, Line Style, Line Width, Location (2 coords on a layout, a scope on a map), Rounded |
Splined Text |
Font, Color, Text |
Text |
Angle, Auto-Wrap, Color, Font, Framed, Frame Border Color, Frame Border Style, Frame Border Width, Frame Fill Color, Frame Fill Style, Frame Shield, Frame Type, Location (2 coords on layout, a scope on map or, for non-scaling text, a coord and an alignment string on map), Text |
Specification |
Type |
Contents |
Angle |
Real |
The counterclockwise rotation angle from horizontal |
Auto-Wrap |
Boolean |
Indicates whether text is automatically wrapped into mutiple lines; currently ignored |
Color |
Color |
The foreground color |
Drop Shadow |
Boolean |
Indicates whether drop shadows are displayed; currently ignored |
File |
String |
The path to the file containing the annotation |
Fill Color |
Color |
The fill color |
Fill Style |
Fillstyle |
The fill style |
Font |
String |
The name and size of the font |
Framed |
Boolean |
Indicates whether the text is displayed with a frame |
Frame Border Color |
Color |
The frame border color |
Frame Border Style |
Linestyle |
The frame border style |
Frame Border Width |
Real |
The frame border width in points |
Frame Fill Color |
Color |
The frame background color |
Frame Fill Style |
Fillstyle |
The frame background fill style |
Frame Shield |
Array |
The highway shield definition (string font_name, array of (integer index, color)) |
Frame Type |
String |
"Rectangle", "Rounded Rectangle", "Ellipse", "Shield" |
From Arrow |
Boolean |
Indicates whether an arrow is drawn at the start of the polyline |
Grid |
Boolean |
Indicates whether a grid is displayed |
Index |
Integer |
The chacter value from the font |
Line Color |
Color |
The line or border color |
Line Style |
Linestyle |
The line or border style |
Line Width |
Real |
The line or border width in points |
Location |
Array |
See table below |
Rounded |
Boolean |
Indicates whether the rectangle has rounded corners |
Scope |
Scope |
The scope of the map |
Smooth |
Boolean |
Indicates whether the polyline is smoothed by fitting a spline |
Temporary |
Boolean |
Indicates whether the annotation is temporary; When set to "True" the annotation will not be saved as part of the map or workspace nor be replicated with DuplicateMap() (defaults to "False") |
Text |
String |
The text |
To Arrow |
Boolean |
Indicates whether an arrow is drawn at the end of the polyline |
Location Type |
Window Type |
Comments |
Scope |
Map |
A compound variable with a center, width, and height; the angle is ignored. Use Scope() or ClickRectScope() to create a scope |
2 coords |
Layout |
Compound variables with an X and Y. Use Coord() to create a coord or ClickRect() to create a rectangle of 2 coords |
A coord and an alignment string |
Map |
The coord is a compound variable with an X and Y on a layout or a lon and lat on a map; use Coord() to create a coord. The alignment string can be NW, N, NE, W, C, E, SW, S or SE |
Flag |
Type |
Contents |
Editable |
Boolean |
"True" if the annotation is editable, otherwise "False" |
Protected |
Boolean |
"True" if the annotation is protected (cannot be selected), otherwise "False" |
SetAnnotation() can only modify the annotation specifications listed under Valid Specifications.
Some types of annotations (e.g., legends) cannot be changed at all.
When setting annotations on a map, Location is in longitude and latitude values.
When setting annotations on a layout, Location is in X and Y values measured in hundredths of a printer's point (1/7200ths of an inch) from the upper-left hand corner of the layout.
For a full list of GISDK functions for annotations, see Freehand Items (Annotations).
SetAnnotation("Map|U.S. States", 123, {{"Color", ColorRGB(65535, 0, 0)}})
Error Type |
Meaning |
Error |
The specification array is invalid |
NotFound |
The window or the specified annotation is not found |
Function |
Summary |
Adds an annotation to a map or layout window |
|
Removes an annotation from a map or layout window |
|
Removes annotations from a map or layout window |
|
Removes selected annotations from a map or layout window |
|
Moves an annotation to a new location |
|
Selects all annotations in a map or layout window |
|
Adds an annotation to the list of selected annotations |
|
Gets the IDs of selected annotations in a map or layout window |
©2025 Caliper Corporation | www.caliper.com |