public class

RasterTileLayer

extends TileLayer
java.lang.Object
   ↳ com.carto.layers.Layer
     ↳ com.carto.layers.TileLayer
       ↳ com.carto.layers.RasterTileLayer
Known Direct Subclasses

Class Overview

A tile layer where each tile is a bitmap. Should be used together with corresponding data source.

Summary

Public Constructors
RasterTileLayer(TileDataSource dataSource)
Constructs a RasterTileLayer object from a data source.
Public Methods
synchronized void delete()
RasterTileEventListener getRasterTileEventListener()
Returns the raster tile event listener.
long getTextureCacheCapacity()
Returns the tile texture cache capacity.
float getTileBlendingSpeed()
Returns the current relative tile blending speed.
RasterTileFilterMode getTileFilterMode()
Returns the current tile filter mode.
void setRasterTileEventListener(RasterTileEventListener eventListener)
Sets the raster tile event listener.
void setTextureCacheCapacity(long capacityInBytes)
Sets the tile texture cache capacity.
void setTileBlendingSpeed(float speed)
Sets the relative tile blending speed.
void setTileFilterMode(RasterTileFilterMode filterMode)
Sets the current tile filter mode.
[Expand]
Inherited Methods
From class com.carto.layers.TileLayer
From class com.carto.layers.Layer
From class java.lang.Object

Public Constructors

public RasterTileLayer (TileDataSource dataSource)

Constructs a RasterTileLayer object from a data source.

Parameters
dataSource The data source from which this layer loads data.

Public Methods

public synchronized void delete ()

public RasterTileEventListener getRasterTileEventListener ()

Returns the raster tile event listener.

Returns
  • The raster tile event listener.

public long getTextureCacheCapacity ()

Returns the tile texture cache capacity.

Returns
  • The tile texture cache capacity in bytes.

public float getTileBlendingSpeed ()

Returns the current relative tile blending speed.

Returns
  • The current relative tile blending speed. Default is 1.0.

public RasterTileFilterMode getTileFilterMode ()

Returns the current tile filter mode.

Returns
  • The current tile filter mode. The default is bilinear.

public void setRasterTileEventListener (RasterTileEventListener eventListener)

Sets the raster tile event listener.

Parameters
eventListener The raster tile event listener.

public void setTextureCacheCapacity (long capacityInBytes)

Sets the tile texture cache capacity. Texture cache is the primary storage for raster data,
all tiles contained within the texture cache are stored as uncompressed openGL textures and can immediately be
drawn to the screen. Setting the cache size too small may cause artifacts, such as disappearing tiles.
The more tiles are visible on the screen, the larger this cache should be. A single opaque 256x256 tile takes
up 192KB of memory, a transparent tile of the same size takes 256KB. The number of tiles on the screen depends
on the screen size and density, current rotation and tilt angle, tile draw size parameter and
whether or not preloading is enabled.
The default is 10MB, which should be enough for most use cases with preloading enabled. If preloading is
disabled, the cache size should be reduced by the user to conserve memory.

Parameters
capacityInBytes The new tile bitmap cache capacity in bytes.

public void setTileBlendingSpeed (float speed)

Sets the relative tile blending speed.

Parameters
speed The new relative speed value. Default is 1.0. Use zero or negative values to disable blending.

public void setTileFilterMode (RasterTileFilterMode filterMode)

Sets the current tile filter mode.

Parameters
filterMode The new tile filter mode.