Skip to content

Commit

Permalink
Additional user metadata in Tile2DHeader to be used by getTileData (
Browse files Browse the repository at this point in the history
  • Loading branch information
juneidysoo authored May 11, 2022
1 parent 6dacb89 commit b613f85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/geo-layers/src/tile-layer/tile-2d-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class Tile2DHeader {
id!: string; // assigned _always_ with result of `getTileId`
bbox!: TileBoundingBox; // assigned _always_ with result of `getTileMetadata`
zoom!: number; // assigned _always_ with result of `getTileZoom`
userData?: Record<string, any>; // _may be_ assigned with result of `getTileMetadata`

private _abortController: AbortController | null;
private _loader: Promise<void> | undefined;
Expand Down Expand Up @@ -78,7 +79,7 @@ export default class Tile2DHeader {
onLoad,
onError
}: TileLoadDataProps): Promise<void> {
const {index, id, bbox} = this;
const {index, id, bbox, userData, zoom} = this;
const loaderId = this._loaderId;

this._abortController = new AbortController();
Expand All @@ -102,7 +103,7 @@ export default class Tile2DHeader {
let tileData = null;
let error;
try {
tileData = await getData({index, id, bbox, signal});
tileData = await getData({index, id, bbox, userData, zoom, signal});
} catch (err) {
error = err || true;
} finally {
Expand Down

0 comments on commit b613f85

Please sign in to comment.