public class

TileDataSource

extends Object
java.lang.Object
   ↳ com.carto.datasources.TileDataSource
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract base class for tile data sources. It provides default implementation
for listener registration and other common tile data source methods.

Summary

Public Methods
synchronized void delete()
MapBounds getDataExtent()
Returns the extent of the tiles in this data source.
int getMaxZoom()
Returns the maximum zoom level supported by this data source.
int getMinZoom()
Returns the minimum zoom level supported by this data source.
Projection getProjection()
Returns the projection of this tile source.
TileData loadTile(MapTile tile)
Loads the specified tile.
void notifyTilesChanged(boolean removeTiles)
Notifies listeners that the tiles have changed.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public synchronized void delete ()

public MapBounds getDataExtent ()

Returns the extent of the tiles in this data source.
The bounds are in coordinate system of the projection of the data source.

Returns
  • The extent of the data source.

public int getMaxZoom ()

Returns the maximum zoom level supported by this data source.

Returns
  • The maximum zoom level supported (exclusive).

public int getMinZoom ()

Returns the minimum zoom level supported by this data source.

Returns
  • The minimum zoom level supported (inclusive).

public Projection getProjection ()

Returns the projection of this tile source.

Returns
  • The projection of this tile source.

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.

public void notifyTilesChanged (boolean removeTiles)

Notifies listeners that the tiles have changed. Action taken depends on the implementation of the
listeners, but generally all cached tiles will be reloaded. If the removeTiles flag is set all caches will be cleared
prior to reloading, if it's not set then the reloaded tiles will replace the old tiles in caches as they finish loading.

Parameters
removeTiles The remove tiles flag.