Last updated

API / geotoolkit / widgets / overlays / Annotation / Annotation

Class: Annotation

overlays.Annotation.Annotation

Creates default implementation of the annotation

Hierarchy

Implements

Table of contents

Constructors
Methods
Css Properties
Name Type Description
fillstylestringAnnotation fill style
fillstyleFillStyleAnnotation fill style
fillstyle-colorstringColor in CSS form
fillstyle-evenoddmodebooleanEven-odd fill mode
fillstyle-fillpatternPatternPattern
fillstyle-fillpattern-containernamestringAn 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-patternnamestringName of this pattern for indexing
fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fillstyle-foregroundstringForeground color
fillstyle-patternPatternPattern
linestylestringAnnotation borderline style
linestyleLineStyleAnnotation borderline style
linestyle-colorstringColor in CSS form
linestyle-fillstringOptional fill style to be used to fill lines generated with this style
linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
linestyle-linecapCapStyleThe line cap style
linestyle-linedashoffsetnumberLine dash offset of dashed line
linestyle-linejoinJoinStyleThe line join style
linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
linestyle-scalablebooleanTrue if width should depend on transformation
linestyle-unitstringOptional unit for the width
linestyle-widthnumber | stringThe line thickness
textstringAnnotation text content
textstylestringAnnotation text style
textstyleTextStyleAnnotation text style
textstyle-alignmentAlignmentStyleAlignment
textstyle-autosizebooleanAuto font size on high definition display
textstyle-backgroundstringBackground style
textstyle-backgroundFillStyleBackground style
textstyle-baselineBaseLineStyleBase line
textstyle-colorstringColor in CSS form
textstyle-fillFillStyleText fill style
textstyle-fontstringFont see
textstyle-fonturlstringThe place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword
textstyle-lineheightstring | numberLine height
textstyle-multilinebooleanAllow multi-line text
textstyle-outlinestringOutline style
textstyle-outlineLineStyleOutline style
textstyle-overflowwrapOverflowWrapStyleOverflow wrap
textstyle-strikethroughstringStrikethrough style
textstyle-strikethroughLineStyleStrikethrough style
textstyle-textoverflowTextOverflowStyleText overflow
textstyle-underlinestringUnderline style
textstyle-underlineLineStyleUnderline style
textstyle-underlineoffsetstring | numberUnderline offset distance
textstyle-whitespaceWhiteSpaceStyleWhite space
textstyle-wordbreakWordBreakStyleWord break
z-indexnumberDefine annotation z-index

Contents

Constructors

new Annotation(data)

new Annotation(data)

Parameters

Name Type
dataOptions

Overrides

EventDispatcher.constructor

Methods

connectStyle

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

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Annotation

this

Implementation of

IStyleListener.connectStyle


disconnectStyle

disconnectStyle(style, type, callback): Annotation

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Annotation

this

Implementation of

IStyleListener.disconnectStyle


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getAnchor

getAnchor(): Point

Get annotation anchor

Returns

Point

target

Implementation of

IAnnotation.getAnchor


getClassName

getClassName(): string

Returns

string

Implementation of

IAnnotation.getClassName

Inherited from

EventDispatcher.getClassName


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Implementation of

IAnnotation.getFillStyle


getInvalidateMethod

getInvalidateMethod(): AttributeCallback<EventDispatcher>

invalidate Method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Implementation of

IAnnotation.getLineStyle


getName

getName(): string

Get annotation name

Returns

string

returns name

Implementation of

IAnnotation.getName


getOptions

getOptions(): OptionsOut

Get annotation options

Returns

OptionsOut

Implementation of

IAnnotation.getOptions


getProperties

getProperties(): PropertiesOut

Get annotation properties

Returns

PropertiesOut

Annotation properties


getSymbol

getSymbol(): Symbol

Get annotation symbol

Returns

Symbol

Implementation of

IAnnotation.getSymbol


getTarget

getTarget(): Node

Get annotation target

Returns

Node

target

Implementation of

IAnnotation.getTarget


getText

getText(): string

Get annotation text

Returns

string

returns text

Implementation of

IAnnotation.getText


getTextStyle

getTextStyle(): TextStyle

The style associated with this text.

Returns

TextStyle

text style

Implementation of

IAnnotation.getTextStyle


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Implementation of

IAnnotation.getZIndex


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

notify<E>(type, source, args?): Annotation

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceAnnotationof the event
Optional argsEventMap[E]arguments of the event

Returns

Annotation

this

Overrides

EventDispatcher.notify


off

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: Annotation, args: EventMap[E]) => voidfunction to be called

Returns

Annotation

this

Overrides

EventDispatcher.off


on

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: Annotation, args: EventMap[E]) => voidto be called

Returns

Annotation

this

Overrides

EventDispatcher.on


setAnchor

setAnchor(anchor): Annotation

Set annotation anchor

Parameters

Name Type Description
anchorPointanchor

Returns

Annotation

this

Implementation of

IAnnotation.setAnchor


setFillStyle

setFillStyle(fillStyle, merge?): Annotation

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Annotation

Implementation of

IAnnotation.setFillStyle


setLineStyle

setLineStyle(lineStyle, merge?): Annotation

Sets line style

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Annotation

this

Implementation of

IAnnotation.setLineStyle


setName

setName(name): Annotation

Set annotation name

Parameters

Name Type Description
namestringnew annotation name

Returns

Annotation

this

Implementation of

IAnnotation.setName


setOptions

setOptions(options): Annotation

Set annotation options

Parameters

Name Type Description
optionsOptionsBaseoptions

Returns

Annotation

Implementation of

IAnnotation.setOptions


setProperties

setProperties(properties?): Annotation

Set annotation properties

Parameters

Name Type Description
Optional propertiesPropertiesAnnotation properties

Returns

Annotation

this


setSilent

setSilent(bool): Annotation

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Annotation

this

Inherited from

EventDispatcher.setSilent


setSymbol

setSymbol(symbol): Annotation

Set annotation symbol

Parameters

Name Type Description
symbolSymbolsymbol

Returns

Annotation

this

Implementation of

IAnnotation.setSymbol


setTarget

setTarget(target): Annotation

Set annotation target

Parameters

Name Type Description
targetNodetarget

Returns

Annotation

this

Implementation of

IAnnotation.setTarget


setText

setText(text): Annotation

Set annotation text

Parameters

Name Type Description
textstringnew annotation text

Returns

Annotation

this

Implementation of

IAnnotation.setText


setTextStyle

setTextStyle(textStyle, merge?): Annotation

Set text style

Parameters

Name Type Description
textStyleTypea new shape text style
Optional mergebooleantrue if you want to merge textStyle with existing attribute, false by default

Returns

Annotation

this

Implementation of

IAnnotation.setTextStyle


setZIndex

setZIndex(value): Annotation

Sets z-index for node (set null for default)

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

Annotation

this

Implementation of

IAnnotation.setZIndex


fromObject

Static fromObject(object): IAnnotation

Create IAnnotation from object

Parameters

Name Type Description
objectIAnnotation | Optionsobject

Returns

IAnnotation


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName