public class

CombinedTileDataSource

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

Class Overview

A tile data source that combines two data sources (usually offline and online) and selects tiles
based on zoom level. All requests below specified zoom level are directed to the first data source
and all requests at or above specified zoom level are directed to the second data source.

Summary

Public Constructors
CombinedTileDataSource(TileDataSource dataSource1, TileDataSource dataSource2, int zoomLevel)
Constructs a combined tile data source object.
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.
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 CombinedTileDataSource (TileDataSource dataSource1, TileDataSource dataSource2, int zoomLevel)

Constructs a combined tile data source object.

Parameters
dataSource1 First data source that is used if requested tile is below given zoomLevel.
dataSource2 Second data source that is used if requested tile is at or above given zoomLevel.
zoomLevel Threshold zoom level value.

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 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.