public interface TileSource

Known subtypesBundledTileSource, DemoTileSource, HttpTileSource, MvtTileSource, RasterTileSource

Supplies tile payloads to the VectorMapEngine given a slippy-map z/x/y address. Two flavors exist: vector sources (isVector true) returning MVT protobuf bytes that the engine decodes and styles, and raster sources returning encoded-image bytes that the engine simply blits. The bundled BundledTileSource, the networked MvtTileSource and the keyless RasterTileSource cover the universal, vector and zero-config cases respectively.

Methods

public abstract boolean isVector()True for MVT vector tiles, false for raster image tiles.
public abstract int getTileSize()The tile edge in pixels (almost always 256).
public abstract int getMinZoom()The smallest zoom level this source serves.
public abstract int getMaxZoom()The largest zoom level this source serves.
public abstract String getAttribution()Attribution text that must be displayed over the map.
public abstract void fetchTile(int z, int x, int y, TileCallback callback)Requests the tile at z/x/y, delivering the result to callback on the event dispatch thread.

Method details

isVector

public abstract boolean isVector()
True for MVT vector tiles, false for raster image tiles.

getTileSize

public abstract int getTileSize()
The tile edge in pixels (almost always 256).

getMinZoom

public abstract int getMinZoom()
The smallest zoom level this source serves.

getMaxZoom

public abstract int getMaxZoom()
The largest zoom level this source serves.

getAttribution

public abstract String getAttribution()
Attribution text that must be displayed over the map.

fetchTile

public abstract void fetchTile(int z, int x, int y, TileCallback callback)
Requests the tile at z/x/y, delivering the result to callback on the event dispatch thread.