API / geotoolkit / widgets / overlays / Annotation / Annotation
overlays.Annotation.Annotation
Creates default implementation of the annotation
↳
Annotation
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
fillstyle | string | Annotation fill style |
fillstyle | FillStyle | Annotation fill style |
fillstyle-color | string | Color in CSS form |
fillstyle-evenoddmode | boolean | Even-odd fill mode |
fillstyle-fillpattern | Pattern | Pattern |
fillstyle-fillpattern-containername | string | An optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself |
fillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
fillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
fillstyle-foreground | string | Foreground color |
fillstyle-pattern | Pattern | Pattern |
linestyle | string | Annotation borderline style |
linestyle | LineStyle | Annotation borderline style |
linestyle-color | string | Color in CSS form |
linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
linestyle-linecap | CapStyle | The line cap style |
linestyle-linedashoffset | number | Line dash offset of dashed line |
linestyle-linejoin | JoinStyle | The line join style |
linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
linestyle-scalable | boolean | True if width should depend on transformation |
linestyle-unit | string | Optional unit for the width |
linestyle-width | number | string | The line thickness |
text | string | Annotation text content |
textstyle | string | Annotation text style |
textstyle | TextStyle | Annotation text style |
textstyle-alignment | AlignmentStyle | Alignment |
textstyle-autosize | boolean | Auto font size on high definition display |
textstyle-background | string | Background style |
textstyle-background | FillStyle | Background style |
textstyle-baseline | BaseLineStyle | Base line |
textstyle-color | string | Color in CSS form |
textstyle-fill | FillStyle | Text fill style |
textstyle-font | string | Font see |
textstyle-fonturl | string | The place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword |
textstyle-lineheight | string | number | Line height |
textstyle-multiline | boolean | Allow multi-line text |
textstyle-outline | string | Outline style |
textstyle-outline | LineStyle | Outline style |
textstyle-overflowwrap | OverflowWrapStyle | Overflow wrap |
textstyle-strikethrough | string | Strikethrough style |
textstyle-strikethrough | LineStyle | Strikethrough style |
textstyle-textoverflow | TextOverflowStyle | Text overflow |
textstyle-underline | string | Underline style |
textstyle-underline | LineStyle | Underline style |
textstyle-underlineoffset | string | number | Underline offset distance |
textstyle-whitespace | WhiteSpaceStyle | White space |
textstyle-wordbreak | WordBreakStyle | Word break |
z-index | number | Define annotation z-index |
Methods
▸ connectStyle(style, type, callback): Annotation
Connects style.
This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
▸ disconnectStyle(style, type, callback): Annotation
Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
IStyleListener.disconnectStyle
▸ dispose(): void
Dispose.
void
▸ getAnchor(): Point
Get annotation anchor
target
▸ getClassName(): string
string
▸ getFillStyle(): FillStyle
Return fill style
fillStyle current fill style
▸ getInvalidateMethod(): AttributeCallback<EventDispatcher>
invalidate Method
AttributeCallback<EventDispatcher>
method to invalidate this object
▸ getLineStyle(): LineStyle
Return line style
lineStyle current line style
▸ getName(): string
Get annotation name
string
returns name
▸ getOptions(): OptionsOut
Get annotation options
▸ getProperties(): PropertiesOut
Get annotation properties
Annotation properties
▸ getSymbol(): Symbol
Get annotation symbol
▸ getTarget(): Node
Get annotation target
target
▸ getText(): string
Get annotation text
string
returns text
▸ getTextStyle(): TextStyle
The style associated with this text.
text style
▸ getZIndex(): number
Returns node z-index (null if not set)
number
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
EventDispatcher.hasEventListener
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): Annotation
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Annotation | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): Annotation
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: Annotation, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): Annotation
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: Annotation, args: EventMap[E]) => void | to be called |
this
▸ setAnchor(anchor): Annotation
Set annotation anchor
| Name | Type | Description |
|---|---|---|
anchor | Point | anchor |
this
▸ setFillStyle(fillStyle, merge?): Annotation
Sets fill style
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
▸ setLineStyle(lineStyle, merge?): Annotation
Sets line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setName(name): Annotation
Set annotation name
| Name | Type | Description |
|---|---|---|
name | string | new annotation name |
this
▸ setOptions(options): Annotation
Set annotation options
| Name | Type | Description |
|---|---|---|
options | OptionsBase | options |
▸ setProperties(properties?): Annotation
Set annotation properties
| Name | Type | Description |
|---|---|---|
Optional properties | Properties | Annotation properties |
this
▸ setSilent(bool): Annotation
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setSymbol(symbol): Annotation
Set annotation symbol
| Name | Type | Description |
|---|---|---|
symbol | Symbol | symbol |
this
▸ setTarget(target): Annotation
Set annotation target
| Name | Type | Description |
|---|---|---|
target | Node | target |
this
▸ setText(text): Annotation
Set annotation text
| Name | Type | Description |
|---|---|---|
text | string | new annotation text |
this
▸ setTextStyle(textStyle, merge?): Annotation
Set text style
| Name | Type | Description |
|---|---|---|
textStyle | Type | a new shape text style |
Optional merge | boolean | true if you want to merge textStyle with existing attribute, false by default |
this
▸ setZIndex(value): Annotation
Sets z-index for node (set null for default)
| Name | Type | Description |
|---|---|---|
value | number | index determining node z-position |
this
▸ Static fromObject(object): IAnnotation
Create IAnnotation from object
| Name | Type | Description |
|---|---|---|
object | IAnnotation | Options | object |
▸ Static getClassName(): string
string