public class

CartoVectorTileDecoder

extends VectorTileDecoder
java.lang.Object
   ↳ com.carto.vectortiles.VectorTileDecoder
     ↳ com.carto.vectortiles.CartoVectorTileDecoder

Class Overview

Decoder for Carto vector tiles in MapBox format.

Summary

Public Constructors
CartoVectorTileDecoder(StringVector layerIds, StringCartoCSSStyleSetMap layerStyleSets)
Constructs a decoder for Carto vector tiles based on specified CartoCSS style set.
Public Methods
void addFallbackFont(BinaryData fontData)
Adds a fallback font.
synchronized void delete()
StringVector getLayerIds()
Returns the list of layer ids used when decoding a tile.
CartoCSSStyleSet getLayerStyleSet(String layerId)
Returns the CartoCSS style set used by the decoder for the specified layer.
int getMaxZoom()
Returns maximum zoom level supported for by the decoder (or style).
int getMinZoom()
Returns minimum zoom level supported for by the decoder (or style).
boolean isLayerVisible(String layerId)
Returns the visibility of the specified layer.
void setLayerStyleSet(String layerId, CartoCSSStyleSet styleSet)
Sets the CartoCSS style set used by the decoder for the specified layer.
void setLayerVisible(String layerId, boolean visible)
Sets the visibility of the specified layer.
[Expand]
Inherited Methods
From class com.carto.vectortiles.VectorTileDecoder
From class java.lang.Object

Public Constructors

public CartoVectorTileDecoder (StringVector layerIds, StringCartoCSSStyleSetMap layerStyleSets)

Constructs a decoder for Carto vector tiles based on specified CartoCSS style set.

Parameters
layerIds The list of layer ids.
layerStyleSets The CartoCSS style sets for the layers.
Throws
Exception If the decoder could not be created or there are issues with the style set.

Public Methods

public void addFallbackFont (BinaryData fontData)

Adds a fallback font. The font should be TTF or OTF font. It is used for glyphs not found in style defined fonts.

Parameters
fontData The font binary.

public synchronized void delete ()

public StringVector getLayerIds ()

Returns the list of layer ids used when decoding a tile.

Returns
  • The list of layer ids used.

public CartoCSSStyleSet getLayerStyleSet (String layerId)

Returns the CartoCSS style set used by the decoder for the specified layer.

Parameters
layerId The layer name to use.
Returns
  • The given layer CartoCSS style.
Throws
IndexOutOfBoundsException If the layer id is not valid.

public int getMaxZoom ()

Returns maximum zoom level supported for by the decoder (or style).

Returns
  • Maximum supported zoom level.

public int getMinZoom ()

Returns minimum zoom level supported for by the decoder (or style).

Returns
  • Minimum supported zoom level.

public boolean isLayerVisible (String layerId)

Returns the visibility of the specified layer.

Parameters
layerId The layer name to use.
Returns
  • True if the layer is visible, false otherwise.

public void setLayerStyleSet (String layerId, CartoCSSStyleSet styleSet)

Sets the CartoCSS style set used by the decoder for the specified layer.

Parameters
layerId The layer name to use.
styleSet The new style set to use.
Throws
Exception If the decoder could not be updated or there are issues with the CartoCSS.
IndexOutOfBoundsException If the layer id is not valid.

public void setLayerVisible (String layerId, boolean visible)

Sets the visibility of the specified layer.

Parameters
layerId The layer name to use.
visible True if the layer should be visible, false if hidden.