public class

VectorTileLayer

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

Class Overview

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

Summary

Public Constructors
VectorTileLayer(TileDataSource dataSource, VectorTileDecoder decoder)
Constructs a VectorTileLayer object from a data source and tile decoder.
Public Methods
synchronized void delete()
VectorTileRenderOrder getBuildingRenderOrder()
Returns the current display order of the buildings.
float getClickRadius()
Returns the click radius of vector tile features.
float getLabelBlendingSpeed()
Returns the current relative label blending speed.
VectorTileRenderOrder getLabelRenderOrder()
Returns the current display order of the labels.
float getLayerBlendingSpeed()
Returns the current relative layer blending speed.
long getTileCacheCapacity()
Returns the tile cache capacity.
VectorTileDecoder getTileDecoder()
Returns the tile decoder assigned to this layer.
VectorTileEventListener getVectorTileEventListener()
Returns the vector tile event listener.
void setBuildingRenderOrder(VectorTileRenderOrder renderOrder)
Sets the current display order of the buildings.
void setClickRadius(float radius)
Sets the click radius of vector tile features.
void setLabelBlendingSpeed(float speed)
Sets the relative label blending speed.
void setLabelRenderOrder(VectorTileRenderOrder renderOrder)
Sets the current display order of the labels.
void setLayerBlendingSpeed(float speed)
Sets the relative layer blending speed.
void setTileCacheCapacity(long capacityInBytes)
Sets the vector tile cache capacity.
void setVectorTileEventListener(VectorTileEventListener eventListener)
Sets the vector tile event listener.
[Expand]
Inherited Methods
From class com.carto.layers.TileLayer
From class com.carto.layers.Layer
From class java.lang.Object

Public Constructors

public VectorTileLayer (TileDataSource dataSource, VectorTileDecoder decoder)

Constructs a VectorTileLayer object from a data source and tile decoder.

Parameters
dataSource The data source from which this layer loads data.
decoder The tile decoder that decoder loaded tiles and applies styles.

Public Methods

public synchronized void delete ()

public VectorTileRenderOrder getBuildingRenderOrder ()

Returns the current display order of the buildings.

Returns
  • The display order of the buildigns. Default is VECTOR_TILE_RENDER_ORDER_LAYER.

public float getClickRadius ()

Returns the click radius of vector tile features.
Units are screen density independent pixels (DP or DIP).

Returns
  • The click radius of vector tile features.

public float getLabelBlendingSpeed ()

Returns the current relative label blending speed.

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

public VectorTileRenderOrder getLabelRenderOrder ()

Returns the current display order of the labels.

Returns
  • The display order of the labels. Default is VECTOR_TILE_RENDER_ORDER_LAYER.

public float getLayerBlendingSpeed ()

Returns the current relative layer blending speed.

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

public long getTileCacheCapacity ()

Returns the tile cache capacity.

Returns
  • The tile cache capacity in bytes.

public VectorTileDecoder getTileDecoder ()

Returns the tile decoder assigned to this layer.

Returns
  • The tile decoder assigned to this layer.

public VectorTileEventListener getVectorTileEventListener ()

Returns the vector tile event listener.

Returns
  • The vector tile event listener.

public void setBuildingRenderOrder (VectorTileRenderOrder renderOrder)

Sets the current display order of the buildings.

Parameters
renderOrder The new display order of the labels.

public void setClickRadius (float radius)

Sets the click radius of vector tile features.
The click radius is applied as an extra buffer to the vector tile features to make clicking on small features less sensitive.
Units are screen density independent pixels (DP or DIP).

Parameters
radius The new click radius of vector tile features. The default value is 4.

public void setLabelBlendingSpeed (float speed)

Sets the relative label blending speed.

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

public void setLabelRenderOrder (VectorTileRenderOrder renderOrder)

Sets the current display order of the labels.

Parameters
renderOrder The new display order of the labels.

public void setLayerBlendingSpeed (float speed)

Sets the relative layer blending speed.

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

public void setTileCacheCapacity (long capacityInBytes)

Sets the vector tile cache capacity. Tile cache is the primary storage for vector data,
all tiles contained within the cache are stored as uncompressed vertex buffers 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.
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 setVectorTileEventListener (VectorTileEventListener eventListener)

Sets the vector tile event listener.

Parameters
eventListener The vector tile event listener.