Skip to content

Commit 23cb150

Browse files
committed
feat: loadTile method
1 parent 9d2939f commit 23cb150

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/datasources/index.android.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export class TileDataSource<T extends com.carto.datasources.TileDataSource, U ex
1717
return null;
1818
}
1919

20+
loadTile(x, y, z): com.carto.datasources.components.TileData {
21+
return this.getNative().loadTile(new com.carto.core.MapTile(x, y, z, 0));
22+
// return (ArrayBuffer as any).from(java.nio.ByteBuffer.wrap(data.getData().getData()));
23+
}
24+
2025
// get minZoom() {
2126
// if (this.native) {
2227
// return this.native.getMinZoom();

src/datasources/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export abstract class DataSource<T, U extends DataSourceOptions> extends BaseNat
1313
export class TileDataSource<T, U extends TileDataSourceOptions> extends DataSource<T, U> {
1414
minZoom?: number;
1515
maxZoom?: number;
16+
17+
loadTile(x, y, z): any;
1618
}
1719

1820
export interface OrderedTileDataSourceOptions extends DataSourceOptions {

src/datasources/index.ios.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export class TileDataSource<T extends NTTileDataSource, U extends TileDataSource
1616
createNative(options) {
1717
return null;
1818
}
19+
20+
loadTile(x, y, z) {
21+
return this.getNative().loadTile(NTMapTile.alloc().initWithXYZoomFrameNr(x, y, z, 0));
22+
// return interop.bufferFromData(NSData.dataWithBytesLength(data.getData().getData() as any, data.getData().size()));
23+
}
1924
}
2025

2126
export class OrderedTileDataSource extends TileDataSource<NTOrderedTileDataSource, OrderedTileDataSourceOptions> {

0 commit comments

Comments
 (0)