public class

AssetTileDataSource

extends TileDataSource
java.lang.Object
   ↳ com.carto.datasources.TileDataSource
     ↳ com.carto.datasources.AssetTileDataSource

Class Overview

A tile data source where each map tile is a seperate image file bundled with the application.
The requests are generated using a template scheme, where tags in the basePath string are replaced with actual values.
The following tags are supported: zoom, x, y, xflipped, yflipped, quadkey.

For example, if basePath = "t{zoom}_{x}_{y}.png" and the requested tile has zoom == 2,
x == 1 and y == 3, then the tile will be loaded from the following path: "t2_1_2.png".

Summary

Public Constructors
AssetTileDataSource(int minZoom, int maxZoom, String basePath)
Constructs an AssetTileDataSource object.
Public Methods
synchronized void delete()
TileData loadTile(MapTile tile)
Loads the specified tile.
[Expand]
Inherited Methods
From class com.carto.datasources.TileDataSource
From class java.lang.Object

Public Constructors

public AssetTileDataSource (int minZoom, int maxZoom, String basePath)

Constructs an AssetTileDataSource object.

Parameters
minZoom The minimum zoom level supported by this data source.
maxZoom The maximum zoom level supported by this data source.
basePath The base path containing tags (for example, "t{zoom}_{x}_{y}.png").

Public Methods

public synchronized void delete ()

public TileData loadTile (MapTile tile)

Loads the specified tile.
Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.

Parameters
tile The tile to load.
Returns
  • The tile data. If the tile is not available, null may be returned.