Last updated

API / geotoolkit / scene / shapes / painters / ImagePainter / ImagePainter

Class: ImagePainter

painters.ImagePainter.ImagePainter

Draws an image symbol

Hierarchy

Implements

Table of contents

Constructors
Methods
Css Properties
Name Type Description
urlstring

Contents

Constructors

new ImagePainter(url)

new ImagePainter(url?)

Create ImagePainter

Parameters

Name Type Description
Optional urlstring | { url?: string }image url or properties object

Overrides

EventDispatcher.constructor

Methods

dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getProperties

getProperties(): Object

Returns all the properties pertaining to the image painter

Returns

Object

image painter properties

NameType
urlstring

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(type, source, args?): ImagePainter

Notify listeners

Parameters

Name Type Description
typestringevent types
sourceanyof the event
Optional argsanyarguments of the event

Returns

ImagePainter

this

Inherited from

EventDispatcher.notify


off

off(type?, callback?): ImagePainter

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.

Parameters

Name Type Description
Optional typestringtype of the event
Optional callbackEventListenerfunction to be called

Returns

ImagePainter

this

Inherited from

EventDispatcher.off

off<E>(type, callback): ImagePainter

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: ImagePainter, args: EventMap[E]) => void

Returns

ImagePainter

Inherited from

EventDispatcher.off


on

on(type, callback, options?): ImagePainter

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.

Parameters

Name Type Description
typestringtype of event or property
callbackEventListenerto be called
Optional optionsOptionsoptions of subscription

Returns

ImagePainter

this

Inherited from

EventDispatcher.on

on<E>(type, callback, options?): ImagePainter

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: ImagePainter, args: EventMap[E]) => void
Optional optionsOptions

Returns

ImagePainter

Inherited from

EventDispatcher.on


render

render(context, symbol, bbox): void

Draw image on context

Parameters

Name Type Description
contextRenderingContextrendering context
symbolSymbolShapesymbol, which uses this painter
bboxRectbounding box

Returns

void

Implementation of

IPainter.render


setProperties

setProperties(props?): ImagePainter

Sets all the properties pertaining to the painter

Parameters

Name Type Description
Optional propsObjectimage painter properties
Optional props.urlstring

Returns

ImagePainter

this


setSilent

setSilent(bool): ImagePainter

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ImagePainter

this

Inherited from

EventDispatcher.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName