new Annotation(viewer, options, meta)
Create the annotation.
Name | Type | Description |
---|---|---|
viewer |
Viewer |
The viewer |
options |
Object |
Attributes used to create the annotation |
meta |
Object |
optional
User-defined Meta data to add to the annotation. |
Extends
Members
-
canvasCanvas
-
Get the canvas.
-
colorColor
-
Get or set the label color. When setting the color, a string representing the color or a
Color
object can be used. For details seeColor
. -
fontFont
-
Get or set the font. When setting the font, a string representing the font or a
Font
object can be used. For details seeFont
. -
labelLineLengthNumber
-
Get or set the label line length.
-
labelPlacementLabelPlacement
-
Set the label placement instance for both fast and full drawing. Value can be one of the following: 'default', 'angled', or a custom LabelPlacement class.
-
labelPlacementFastLabelPlacement
-
Get or set the label placement instance for fast drawing. Values for setting can be one of the following: 'default', 'angled', or a custom LabelPlacement class.
-
labelPlacementFullLabelPlacement
-
Get or set the label placement instance for full drawing. Values for setting can be one of the following: 'default', 'angled', or a custom LabelPlacement class.
-
layoutLayout
-
Get the layout.
-
lengthNumber
-
The number of labels in the set.
-
metaBoolean
-
Get or Set the meta data of this object. See the meta data tutorial for details.
-
priorityMaxNumber
-
Get or set the number of priority labels that will be drawn for sure. If they overlap the label will be moved until they no longer overlap. Priority is defined as features that are marked as a "favorite". After favorites, features are sorted by size. For example, if priorityMax is 50 and there are 10 "favorite" features. The favorites will be drawn and then the 40 largest features will be drawn.
-
sequenceSequence
-
Get the sequence.
-
viewerViewer
-
Get the viewer.
-
visibleBoolean
-
Get or Set the visibility of this object.
Methods
-
addLabel(label)
-
Add a new label to the set.
Name Type Description label
Label The Label to add to the set.
-
inherited deleteFromObjects()
-
Remove the object from Viewer.objects
-
invertColors()
-
Invert color
-
labels(term){CGArray}
-
Returns an CGArray of Labels or a single Label.
Name Type Description term
Integer | String | Array See CGArray.get for details.
Returns:
Type Description CGArray -
removeLabels(labels)
-
Remove a label or an array of labels from the set.
Name Type Description labels
Label | Array The Label(s) to remove from the set.
-
toJSON()
-
Returns JSON representing the object
-
toString(){String}
-
Return the class name as a string.
Returns:
Type Description String - 'Annotation'
-
update(attributes)
-
Update annotation attributes. See updating records for details.
Name Type Description attributes
Object Object describing the properties to change