Skip to main content

Class: DataProviderBase

api.DataProviderBase

classdesc Base class to extend if implementing a data provider class.

fires datacreate

example

class MyDataProvider extends DataProviderBase {  constructor() {    super(new S2GeometryProvider());  }  ...}

Hierarchy#

Implements#

Constructors#

constructor#

• new DataProviderBase(_geometry)

Create a new data provider base instance.

Parameters#

NameType
_geometryIGeometryProvider

Overrides#

EventEmitter.constructor

Defined in#

api/DataProviderBase.ts:44

Events#

on#

• on(type, handler): void

Fired when data has been created in the data provider after initial load.

example

// Initialize the data providerclass MyDataProvider extends DataProviderBase {  // implementation}var provider = new MyDataProvider();// Set an event listenerprovider.on("datacreate", function() {  console.log("A datacreate event has occurred.");});

Parameters#

NameType
type"datacreate"
handler(event: ProviderCellEvent) => void

Returns#

void

Implementation of#

IDataProvider.on

Overrides#

EventEmitter.on

Defined in#

api/DataProviderBase.ts:258

Accessors#

geometry#

• get geometry(): IGeometryProvider

Get geometry property.

Returns#

IGeometryProvider

Geometry provider instance.

Implementation of#

IDataProvider.geometry

Defined in#

api/DataProviderBase.ts:53

Methods#

fire#

â–¸ fire(type, event): void

Fire when data has been created in the data provider after initial load.

example

// Initialize the data providerclass MyDataProvider extends DataProviderBase {  // Class implementation}var provider = new MyDataProvider();// Create the eventvar cellIds = [ // Determine updated cells ];var target = provider;var type = "datacreate";var event = {  cellIds,  target,  type,};// Fire the eventprovider.fire(type, event);

Parameters#

NameTypeDescription
type"datacreate"datacreate
eventProviderCellEventProvider cell event

Returns#

void

Implementation of#

IDataProvider.fire

Overrides#

EventEmitter.fire

Defined in#

../doc/api/DataProviderBase.ts:84


getCluster#

â–¸ getCluster(url, abort?): Promise<ClusterContract>

Get a cluster reconstruction.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
urlstringURL for the cluster reconstruction to retrieve.
abort?Promise<void>-

Returns#

Promise<ClusterContract>

Promise to the cluster reconstruction.

Implementation of#

IDataProvider.getCluster

Defined in#

api/DataProviderBase.ts:124


getCoreImages#

â–¸ getCoreImages(cellId): Promise<CoreImagesContract>

Get core images in a geometry cell.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
cellIdstringThe id of the geometry cell.

Returns#

Promise<CoreImagesContract>

Promise to the core images of the requested geometry cell id.

Implementation of#

IDataProvider.getCoreImages

Defined in#

api/DataProviderBase.ts:108


getImageBuffer#

â–¸ getImageBuffer(url, abort?): Promise<ArrayBuffer>

Get an image as an array buffer.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
urlstringURL for image to retrieve.
abort?Promise<void>-

Returns#

Promise<ArrayBuffer>

Promise to the array buffer containing the image.

Implementation of#

IDataProvider.getImageBuffer

Defined in#

api/DataProviderBase.ts:168


getImageTiles#

â–¸ getImageTiles(tiles): Promise<ImageTilesContract>

Get image tiles urls for a tile level.

throws Rejects the promise on errors.

example

var tileRequest = { imageId: 'image-id', z: 12 };provider.getImageTiles(tileRequest)  .then((response) => console.log(response));

Parameters#

NameTypeDescription
tilesImageTilesRequestContractTiles to request

Returns#

Promise<ImageTilesContract>

Promise to the image tiles response contract

Implementation of#

IDataProvider.getImageTiles

Defined in#

api/DataProviderBase.ts:190


getImages#

â–¸ getImages(imageIds): Promise<ImagesContract>

Get complete images.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
imageIdsstring[]The ids for the images to retrieve.

Returns#

Promise<ImagesContract>

Promise to the images of the requested image ids.

Implementation of#

IDataProvider.getImages

Defined in#

api/DataProviderBase.ts:153


getMesh#

â–¸ getMesh(url, abort?): Promise<MeshContract>

Get a mesh.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
urlstringURL for mesh to retrieve.
abort?Promise<void>-

Returns#

Promise<MeshContract>

Promise to the mesh.

Implementation of#

IDataProvider.getMesh

Defined in#

api/DataProviderBase.ts:204


getSequence#

â–¸ getSequence(sequenceId): Promise<SequenceEnt>

Get sequence.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
sequenceIdstringThe id for the sequence to retrieve.

Returns#

Promise<SequenceEnt>

Promise to the sequences of the requested image ids.

Implementation of#

IDataProvider.getSequence

Defined in#

api/DataProviderBase.ts:219


getSpatialImages#

â–¸ getSpatialImages(imageIds): Promise<SpatialImagesContract>

Get spatial images.

throws Rejects the promise on errors.

Parameters#

NameTypeDescription
imageIdsstring[]The ids for the images to retrieve.

Returns#

Promise<SpatialImagesContract>

Promise to the spatial images of the requested image ids.

Implementation of#

IDataProvider.getSpatialImages

Defined in#

api/DataProviderBase.ts:139


off#

â–¸ off(type, handler): void

Unsubscribe from an event by its name.

Parameters#

NameType
type"datacreate"
handler(event: ProviderCellEvent) => void

Returns#

void

Implementation of#

IDataProvider.off

Overrides#

EventEmitter.off

Defined in#

../doc/api/DataProviderBase.ts:224


setAccessToken#

â–¸ setAccessToken(accessToken?): void

Set an access token for authenticated API requests of protected resources.

Parameters#

NameType
accessToken?string

Returns#

void

Implementation of#

IDataProvider.setAccessToken

Defined in#

api/DataProviderBase.ts:281