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↳
DataProviderBase
↳↳
GraphDataProvider
#
Implements#
Constructors#
constructor• new DataProviderBase(_geometry
)
Create a new data provider base instance.
#
ParametersName | Type |
---|---|
_geometry | IGeometryProvider |
#
Overrides#
Defined in#
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.");});
#
ParametersName | Type |
---|---|
type | "datacreate" |
handler | (event : ProviderCellEvent ) => void |
#
Returnsvoid
#
Implementation ofIDataProvider.on
#
Overrides#
Defined in#
Accessors#
geometry• get
geometry(): IGeometryProvider
Get geometry property.
#
ReturnsGeometry provider instance.
#
Implementation of#
Defined in#
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);
#
ParametersName | Type | Description |
---|---|---|
type | "datacreate" | datacreate |
event | ProviderCellEvent | Provider cell event |
#
Returnsvoid
#
Implementation of#
OverridesEventEmitter.fire
#
Defined in../doc/api/DataProviderBase.ts:84
#
getClusterâ–¸ getCluster(url
, abort?
): Promise
<ClusterContract
>
Get a cluster reconstruction.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
url | string | URL for the cluster reconstruction to retrieve. |
abort? | Promise <void > | - |
#
ReturnsPromise
<ClusterContract
>
Promise to the cluster reconstruction.
#
Implementation of#
Defined in#
getCoreImagesâ–¸ getCoreImages(cellId
): Promise
<CoreImagesContract
>
Get core images in a geometry cell.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
cellId | string | The id of the geometry cell. |
#
ReturnsPromise
<CoreImagesContract
>
Promise to the core images of the requested geometry cell id.
#
Implementation of#
Defined in#
getImageBufferâ–¸ getImageBuffer(url
, abort?
): Promise
<ArrayBuffer
>
Get an image as an array buffer.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
url | string | URL for image to retrieve. |
abort? | Promise <void > | - |
#
ReturnsPromise
<ArrayBuffer
>
Promise to the array buffer containing the image.
#
Implementation of#
Defined in#
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));
#
ParametersName | Type | Description |
---|---|---|
tiles | ImageTilesRequestContract | Tiles to request |
#
ReturnsPromise
<ImageTilesContract
>
Promise to the image tiles response contract
#
Implementation of#
Defined in#
getImagesâ–¸ getImages(imageIds
): Promise
<ImagesContract
>
Get complete images.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
imageIds | string [] | The ids for the images to retrieve. |
#
ReturnsPromise
<ImagesContract
>
Promise to the images of the requested image ids.
#
Implementation of#
Defined in#
getMeshâ–¸ getMesh(url
, abort?
): Promise
<MeshContract
>
Get a mesh.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
url | string | URL for mesh to retrieve. |
abort? | Promise <void > | - |
#
ReturnsPromise
<MeshContract
>
Promise to the mesh.
#
Implementation of#
Defined in#
getSequenceâ–¸ getSequence(sequenceId
): Promise
<SequenceEnt
>
Get sequence.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
sequenceId | string | The id for the sequence to retrieve. |
#
ReturnsPromise
<SequenceEnt
>
Promise to the sequences of the requested image ids.
#
Implementation of#
Defined in#
getSpatialImagesâ–¸ getSpatialImages(imageIds
): Promise
<SpatialImagesContract
>
Get spatial images.
throws
Rejects the promise on errors.
#
ParametersName | Type | Description |
---|---|---|
imageIds | string [] | The ids for the images to retrieve. |
#
ReturnsPromise
<SpatialImagesContract
>
Promise to the spatial images of the requested image ids.
#
Implementation ofIDataProvider.getSpatialImages
#
Defined in#
offâ–¸ off(type
, handler
): void
Unsubscribe from an event by its name.
#
ParametersName | Type |
---|---|
type | "datacreate" |
handler | (event : ProviderCellEvent ) => void |
#
Returnsvoid
#
Implementation of#
Overrides#
Defined in../doc/api/DataProviderBase.ts:224
#
setAccessTokenâ–¸ setAccessToken(accessToken?
): void
Set an access token for authenticated API requests of protected resources.
#
ParametersName | Type |
---|---|
accessToken? | string |
#
Returnsvoid