Last updated

API / geotoolkit / map / sources / AbstractSource / AbstractSource

Class: AbstractSource

sources.AbstractSource.AbstractSource

Abstract map source that loads server settings and then queries some sort of data from it

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
systemstringInitial data coordinate system
urlstringData server url

Contents

Constructors

new AbstractSource(options)

Protected new AbstractSource(options?)

Creates source

Parameters

Name Type Description
Optional optionsOptionsoptions

Overrides

EventDispatcher.constructor

Methods

clear

clear(): AbstractSource

Clears all the data.

Returns

AbstractSource

this


dispose

dispose(): void

Disposes this source, once disposed it should not be used anymore.

Returns

void

Overrides

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getCopyright

getCopyright(): string

Returns copyright information.

Returns

string


getDataLoader

Protected getDataLoader(): AbstractLoader

Returns server data loader (if exists)

Returns

AbstractLoader


getInitialCoordinateSystem

getInitialCoordinateSystem(): AbstractSystem

Gets current data initial coordinate system.

Returns

AbstractSystem


getMapCoordinateSystem

getMapCoordinateSystem(): AbstractSystem

Gets current map coordinate system.

Returns

AbstractSystem


getModelLimits

getModelLimits(): Rect

Returns the current data model limits (presumably loaded from the server if it's settled)

Returns

Rect


getProperties

getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

properties


getServerData

getServerData(): JSONObject | XMLDocument

Returns server data loaded from the server Should be used asynchronically after loadServerData() method is called

Returns

JSONObject | XMLDocument


getServerURL

getServerURL(): string | string[]

Gets the server url that is currently used for requests

Returns

string | string[]

server url


getTransformerFromMap

getTransformerFromMap(): Transformer

Gets transformer to transform data from map coordinate system

Returns

Transformer


getTransformerToMap

getTransformerToMap(): Transformer

Gets transformer to transform data to map coordinate system

Returns

Transformer


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


initLoader

Protected initLoader(loader?): AbstractSource

Initializes the loader provided

Parameters

Name Type Description
Optional loaderAbstractLoaderloader to use

Returns

AbstractSource

this


isDataLoaded

isDataLoaded(): boolean

Returns true if server data is already loaded (or no loader provided)

Returns

boolean


isDataReady

isDataReady(): boolean

Checks if source (current visible) data is loaded and ready to be rendered

Returns

boolean


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isLoading

isLoading(): boolean

Checks if some of the requests haven't been finished yet. Returns true if some data is loading, false otherwise.

Returns

boolean


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

EventDispatcher.isSilent


loadServerData

loadServerData(): Promise<AbstractSource>

Returns promise that is loaded when server settings are ready to process

Returns

Promise<AbstractSource>


loadSourceData

loadSourceData(): Promise<AbstractSource>

Returns promise that is resolving when data are ready to process

Returns

Promise<AbstractSource>


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

AbstractSource

this

Overrides

EventDispatcher.notify


off

off<E>(type?, callback?): AbstractSource

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

Returns

AbstractSource

this

Overrides

EventDispatcher.off


on

on<E>(type, callback): AbstractSource

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

Returns

AbstractSource

this

Overrides

EventDispatcher.on


resetLastQueryParams

Protected resetLastQueryParams(): AbstractSource

Resets saved last queried limits and layer

Returns

AbstractSource

this


setDataReady

Protected setDataReady(isReady, err?): AbstractSource

Sets source (current visible) data ready/not ready, changes the corresponding promise

Parameters

Name Type Description
isReadybooleantrue if source data was loaded, false if it needs to be reset
Optional errErrordata loading error (if exists)

Returns

AbstractSource

this


setInitialCoordinateSystem

setInitialCoordinateSystem(system): AbstractSource

Sets the data initial coordinate system.

Parameters

Name Type Description
systemstring | AbstractSysteminitial coordinate system

Returns

AbstractSource

this


setMapCoordinateSystem

setMapCoordinateSystem(system): AbstractSource

Sets map coordinate system.

Parameters

Name Type Description
systemstring | AbstractSystemmap coordinate system

Returns

AbstractSource

this


setProperties

setProperties(properties?): AbstractSource

Sets properties

Parameters

Name Type Description
Optional propertiesOptionsproperties

Returns

AbstractSource

this


setQueryParameter

setQueryParameter(param, value?): AbstractSource

Sets custom query parameter to add to the data requests

Parameters

Name Type Description
paramstring | Record<string, string | number>parameter name or custom parameters object (in name -> value format)
Optional valuestring | numberparameter value

Returns

AbstractSource

this


setServerURL

setServerURL(url): AbstractSource

Sets the server url to use for requesting

Parameters

Name Type Description
urlstring | string[]server url

Returns

AbstractSource

this


setSilent

setSilent(bool): AbstractSource

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AbstractSource

this

Inherited from

EventDispatcher.setSilent


update

update(): AbstractSource

Aborts all the sent requests, resends the last one

Returns

AbstractSource

this


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName