Last updated

API / geotoolkit / widgets / overlays / AbstractOverlay / AbstractOverlay

Class: AbstractOverlay<T>

overlays.AbstractOverlay.AbstractOverlay

Defines an abstract implementation of a widget overlay. Abstract overlay supports ...

Type parameters

NameType
Textends BaseWidget = BaseWidget

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new AbstractOverlay&lt;T&amp;gt;(widget)

new AbstractOverlay<T>(widget)

Type parameters

NameType
Textends BaseWidget<T> = BaseWidget

Parameters

Name Type Description
widgetTwidget to create overlay

Overrides

EventDispatcher.constructor

Methods

dispose

dispose(): void

Disposes this node, once disposes a node should not be used anymore.
Clear all listeners, and disconnect styles to avoid memory leaks.
Also aggressively 'cleanup' this node by setting some of its members to null.

Returns

void

Overrides

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getEnabled

getEnabled(): boolean

Return enabled state

Returns

boolean

enabled state


getVisible

getVisible(): boolean

Return visibility state

Returns

boolean

visible state


getWidget

getWidget(): T

Returns widget

Returns

T

widget


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?): AbstractOverlay<T>

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceAbstractOverlay<BaseWidget>of the event
Optional argsEventMap[E]arguments of the event

Returns

AbstractOverlay<T>

this

Overrides

EventDispatcher.notify


off

off<E>(type?, callback?): AbstractOverlay<T>

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: AbstractOverlay<T>, args: EventMap[E]) => voidfunction to be called

Returns

AbstractOverlay<T>

this

Overrides

EventDispatcher.off


on

on<E>(type, callback): AbstractOverlay<T>

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: AbstractOverlay<T>, args: EventMap[E]) => voidto be called

Returns

AbstractOverlay<T>

this

Overrides

EventDispatcher.on


onStateChanged

Protected onStateChanged(state): AbstractOverlay<T>

Parameters

Name Type Description
state"Visible" | "Enabled"state

Returns

AbstractOverlay<T>


setEnabled

setEnabled(enabled): AbstractOverlay<T>

Set enabled state

Parameters

Name Type Description
enabledbooleanenable or disable tools

Returns

AbstractOverlay<T>

this


setSilent

setSilent(bool): AbstractOverlay<T>

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AbstractOverlay<T>

this

Inherited from

EventDispatcher.setSilent


setVisible

setVisible(visible): AbstractOverlay<T>

Set visibility state

Parameters

Name Type Description
visiblebooleanvisibility of overlay

Returns

AbstractOverlay<T>

this


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName