public class

MBVectorTileDecoder

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

Class Overview

Decoder for vector tiles in MapBox format.

Summary

Public Constructors
MBVectorTileDecoder(CompiledStyleSet compiledStyleSet)
Constructs a decoder for MapBox vector tiles based on specified compiled style set.
MBVectorTileDecoder(CartoCSSStyleSet cartoCSSStyleSet)
Constructs a decoder for MapBox vector tiles based on specified CartoCSS style set.
Public Methods
void addFallbackFont(BinaryData fontData)
Adds a fallback font.
synchronized void delete()
CartoCSSStyleSet getCartoCSSStyleSet()
Returns the current CartoCSS style set used by the decoder.
CompiledStyleSet getCompiledStyleSet()
Returns the current compiled style set used by the decoder.
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).
String getStyleParameter(String param)
Returns the value of the specified style parameter.
StringVector getStyleParameters()
Returns the list of all available style parameters.
void setCartoCSSStyleSet(CartoCSSStyleSet styleSet)
Sets the current CartoCSS style set used by the decoder.
void setCompiledStyleSet(CompiledStyleSet styleSet)
Sets the current compiled style set used by the decoder.
boolean setStyleParameter(String param, String value)
Sets the value of the specified parameter.
[Expand]
Inherited Methods
From class com.carto.vectortiles.VectorTileDecoder
From class java.lang.Object

Public Constructors

public MBVectorTileDecoder (CompiledStyleSet compiledStyleSet)

Constructs a decoder for MapBox vector tiles based on specified compiled style set.

Parameters
compiledStyleSet The compiled style set for the tiles.
Throws
Exception If the decoder could not be created or there are issues with the style set.

public MBVectorTileDecoder (CartoCSSStyleSet cartoCSSStyleSet)

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

Parameters
cartoCSSStyleSet The CartoCSS style set for the tiles.
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 CartoCSSStyleSet getCartoCSSStyleSet ()

Returns the current CartoCSS style set used by the decoder.
If decoder uses non-CartoCSS style set, null is returned.

Returns
  • The current style set.

public CompiledStyleSet getCompiledStyleSet ()

Returns the current compiled style set used by the decoder.
If decoder uses non-compiled style set, null is returned.

Returns
  • The current style set.

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 String getStyleParameter (String param)

Returns the value of the specified style parameter.
The style parameter must be declared in the current style.

Parameters
param The parameter to return.
Returns
  • The value of the parameter. If parameter does not exists, empty string is returned.
Throws
IllegalArgumentException If the style parameter does not exist.

public StringVector getStyleParameters ()

Returns the list of all available style parameters.

Returns
  • The list of all available style parameters.

public void setCartoCSSStyleSet (CartoCSSStyleSet styleSet)

Sets the current CartoCSS style set used by the decoder.

Parameters
styleSet The new style set to use.
Throws
Exception If the decoder could not be updated or there are issues with the style set.

public void setCompiledStyleSet (CompiledStyleSet styleSet)

Sets the current compiled style set used by the decoder.

Parameters
styleSet The new style set to use.
Throws
Exception If the decoder could not be updated or there are issues with the style set.

public boolean setStyleParameter (String param, String value)

Sets the value of the specified parameter.
The style parameter must be declared in the current style.

Parameters
param The parameter to set.
value The value for the parameter.
Returns
  • True if the parameter was set. False if the style parameter does not exist or could not be set.