Constructor
new AnnotationGroup(listopt)
Name | Type | Attributes | Description |
---|---|---|---|
list | Array.<Annotation> | <optional> | Optional list, will create new if not provided. |
Classes
Methods
add(annotation)
Add a new annotation.
Name | Type | Description |
---|---|---|
annotation | Annotation | The annotation to add. |
addEventListener(type, callback)
Add an event listener to this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | function | The function associated with the provided event type, will be called with the fired event. |
find(id) → {Annotation|undefined}
Find an annotation.
Name | Type | Description |
---|---|---|
id | string | The id of the annotation to find. |
The found annotation.
- Type:
- Annotation |
undefined
getColour() → {string}
Get the group colour.
The colour as hex string.
- Type:
- string
getLength() → {number}
Get the number of annotations of this list.
The number of annotations.
- Type:
- number
getList() → {Array.<Annotation>}
Get the annotation group as an array.
The array.
- Type:
- Array.<Annotation>
getMeta() → {Object.<string, any>}
Get the meta data.
The meta data.
- Type:
- Object.<string, any>
getMetaValue(key) → {string|object}
Get a meta data value.
Name | Type | Description |
---|---|---|
key | string | The meta data key. |
The meta data value.
- Type:
- string |
object
hasMeta(key) → {boolean}
Check if this list contains a meta data value.
Name | Type | Description |
---|---|---|
key | string | The key to check. |
True if the meta data is present.
- Type:
- boolean
isEditable() → {boolean}
Check if the annotation group is editable.
True if editable.
- Type:
- boolean
remove(id)
Remove an annotation.
Name | Type | Description |
---|---|---|
id | string | The id of the annotation to remove. |
removeEventListener(type, callback)
Remove an event listener from this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | function | The function associated with the provided event type. |
setColour(colour)
Set the group colour.
Name | Type | Description |
---|---|---|
colour | string | The colour as hex string. |
setEditable(flag)
Set the annotation group editability.
Name | Type | Description |
---|---|---|
flag | boolean | True to make the annotation group editable. |
setMetaValue(key, value)
Set a meta data.
Name | Type | Description |
---|---|---|
key | string | The meta data key. |
value | string | | The value of the meta data. |
setViewController(viewController)
Set the associated view controller.
Name | Type | Description |
---|---|---|
viewController | ViewController | The associated view controller. |
update(annotation, propKeysopt)
Update an existing annotation.
Name | Type | Attributes | Description |
---|---|---|---|
annotation | Annotation | The annotation to update. | |
propKeys | Array.<string> | <optional> | Optional properties that got updated. |
Events
annotationadd
Annotation add event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
data | Annotation | The added annnotation. |
annotationgroupeditablechange
Annotation group editable flag change event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
data | boolean | The value of the editable flag. |
annotationremove
Annotation update event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
data | Annotation | The added annnotation. |
keys | Array.<string> | The properties that were updated. |
annotationupdate
Annotation update event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
data | Annotation | The added annnotation. |
keys | Array.<string> | The properties that were updated. |