Last updated

API / geotoolkit / map / sources / formats / AbstractFormat / AbstractFormat

Class: AbstractFormat

formats.AbstractFormat.AbstractFormat

Abstract source format that formats data queries and sends it using the connector provided The data requests could be flexibly adjusted the by additional parameters specified in 'options'. All of them will be added as a query parameter.

Example

import {ArcGISFeature as ArcGISFeatureFormat} from '@int/geotoolkit/map/sources/formats/ArcGISFeature';
const format = new ArcGISFeatureFormat({
// all undocumented parameters would be directly added to the send requests:
'token': 'TikYtCP33k_Ql2mt_233AJZm3iHkFbowqWSUe9ZmkRp15PBbZLgYTEUP0sc46Nxjt5DPWBfSZst5b9ykD7x9mQ..'
});

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new AbstractFormat(options)

new AbstractFormat(options?)

Parameters

Name Type Description
Optional optionsOptionsoptions

Overrides

EventDispatcher.constructor

Methods

abort

abort(key?): AbstractFormat

Aborts all previous requests

Parameters

Name Type Description
Optional keystringkey of the connections to abort (all connections aborted if nothing provided)

Returns

AbstractFormat

this


clone

clone(): AbstractFormat

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

AbstractFormat

clone


cloneQueryParameters

cloneQueryParameters(format): AbstractFormat

Copies query parameters from another format

Parameters

Name Type Description
formatAbstractFormatformat to clone parameters

Returns

AbstractFormat

this


copyConstructor

Protected copyConstructor(src, deepCopy?): AbstractFormat

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcAbstractFormatSource to copy from
Optional deepCopybooleandeep copy

Returns

AbstractFormat

this


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getConnector

getConnector(): AbstractConnector<any>

Gets connector

Returns

AbstractConnector<any>

connector


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


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


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

AbstractFormat

this

Overrides

EventDispatcher.notify


off

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

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

Returns

AbstractFormat

this

Overrides

EventDispatcher.off


on

on<E>(type, callback): AbstractFormat

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

Returns

AbstractFormat

this

Overrides

EventDispatcher.on


parse

parse(data): AbstractFormat

Parses the data provided and notifies about the result. Is used in the default query implementation.

Parameters

Name Type Description
datastring | ArrayBuffer | Blob | Image | string[][] | JSONObject | XMLDocumentdata object or its string representation

Returns

AbstractFormat

this


query

query(query?): AbstractFormat

Sends a request based on a settings provided That's a basic implementation for the file requests. Implement parse method to use it or override this method directly.

Parameters

Name Type Description
Optional querySendOptionsquery params

Returns

AbstractFormat

this


setQueryParameter

setQueryParameter(param, value): AbstractFormat

Sets the query parameter to add to the data requests

Parameters

Name Type Description
paramstringparameter name
valuestring | number | booleanparameter value

Returns

AbstractFormat

this


setSilent

setSilent(bool): AbstractFormat

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AbstractFormat

this

Inherited from

EventDispatcher.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName