java.lang.Object | |
↳ | com.carto.services.CartoMapsService |
A high-level interface for Carto Maps Service.
The service can be used to automatically configure layers using
anonymous map configurations or by using parametrized named maps.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CartoMapsService()
Constructs a new CartoMapsService instance with default settings.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LayerVector |
buildMap(Variant mapConfig)
Builds a list of layers given anonymous map configuration.
| ||||||||||
LayerVector |
buildNamedMap(String templateId, StringVariantMap templateParams)
Builds a list of layers given named map id and named map parameters.
| ||||||||||
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
String |
getAPIKey()
Returns the API key used when accessing the online service.
| ||||||||||
String |
getAPITemplate()
Returns the API endpoint template of the online service.
| ||||||||||
StringVector |
getAuthTokens()
Returns the list of authentication tokens used when accessing online service.
| ||||||||||
IntVector |
getLayerIndices()
Returns the list of layer indices that are created.
| ||||||||||
String |
getUsername()
Returns the user account name used when accessing the online service.
| ||||||||||
AssetPackage |
getVectorTileAssetPackage()
Returns the asset package used when decoding vector tiles.
| ||||||||||
float |
getVectorTileBufferSize()
Returns the current vector tile buffer size.
| ||||||||||
int |
hashCode()
Returns the hash value of this object.
| ||||||||||
boolean |
isDefaultVectorLayerMode()
Returns true if the service configures layers as vector tile layers,
when possible. | ||||||||||
boolean |
isInteractive()
Returns true is the service configures
layers as interactive by using UTF grids for click detection. | ||||||||||
boolean |
isStrictMode()
Returns true if 'strict mode' is enabled (the service throws exceptions whenever an error is encountered).
| ||||||||||
void |
setAPIKey(String apiKey)
Sets the optional API key used when accessing the online service.
| ||||||||||
void |
setAPITemplate(String apiTemplate)
Sets the API endpoint template of the online service.
| ||||||||||
void |
setAuthTokens(StringVector authTokens)
Sets the list of authentication tokens used when accessing online service.
| ||||||||||
void |
setDefaultVectorLayerMode(boolean vectorLayerMode)
Sets the service to vector layer mode or raster layer mode.
| ||||||||||
void |
setInteractive(boolean interactive)
Sets the interactivity flag of the layers.
| ||||||||||
void |
setLayerIndices(IntVector layerIndices)
Sets the list of layer indices that are created.
| ||||||||||
void |
setStrictMode(boolean strictMode)
Sets the 'strict mode' flag.
| ||||||||||
void |
setUsername(String username)
Sets the user account name used when accessing the online service.
| ||||||||||
void |
setVectorTileAssetPackage(AssetPackage assetPackage)
Sets the asset package used when decoding vector tiles.
| ||||||||||
void |
setVectorTileBufferSize(float bufferSize)
Sets the current vector tile buffer size.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a new CartoMapsService instance with default settings.
Builds a list of layers given anonymous map configuration.
The map configuration specification can be found in CartoDB documentation page.
mapConfig | The map configuration JSON deserialized as Variant type. |
---|
Exception | If IO error occured during the operation. |
---|---|
IOException |
Builds a list of layers given named map id and named map parameters.
templateId | The named map id. |
---|---|
templateParams | The map containing named map parameter names and their values. |
Exception | If IO error occured during the operation. |
---|---|
IOException |
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns the API key used when accessing the online service.
Returns the API endpoint template of the online service.
Returns the list of authentication tokens used when accessing online service.
Returns the list of layer indices that are created.
If non-empty, only layers from this list are created.
Returns the user account name used when accessing the online service.
Returns the asset package used when decoding vector tiles.
By default, no asset package is used and null is returned.
Returns the current vector tile buffer size.
Returns the hash value of this object.
Returns true if the service configures layers as vector tile layers,
when possible. By default this is false. Vector layers
provide much better visual quality at the expense of performance.
Returns true is the service configures
layers as interactive by using UTF grids for click detection.
Returns true if 'strict mode' is enabled (the service throws exceptions whenever an error is encountered).
Sets the optional API key used when accessing the online service.
Usually this is not needed and can be left blank.
apiKey | The optional API key used when accessing the online service. |
---|
Sets the API endpoint template of the online service.
By default cartodb.com endpoint is used. This needs to be redefined only for on-premise services.
apiTemplate | The API endpoint template of the online service. For example, "https://{user}.cartodb.com" |
---|
Sets the list of authentication tokens used when accessing online service.
authTokens | The list of authentication tokens used when accessing online service. |
---|
Sets the service to vector layer mode or raster layer mode.
By default service creates raster layers, but vector layers may
provide much better visual quality at the expense of performance.
vectorLayerMode | True if vector layers should be used. False is raster layers are used. |
---|
Sets the interactivity flag of the layers.
interactive | True if layers should be configured as interactive. The default is false. |
---|
Sets the list of layer indices that are created.
If non-empty, only layers from this list are created.
layerIndices | The list of layer indices that are created. |
---|
Sets the 'strict mode' flag.
strictMode | True if all errors result in exceptions. The default is false. |
---|
Sets the user account name used when accessing the online service.
username | The user account name used when accessing the online service. |
---|
Sets the asset package used when decoding vector tiles.
Asset package with fonts is needed when texts are used.
assetPackage | The asset package to use for vector tiles. |
---|
Sets the current vector tile buffer size.
This can be used to tweak/improve performance or fix rendering artifacts.
The lower values make tiles smaller and improve performance but may create rendering artifacts.
The default value is 64 and should be good fit for most visualizations.
bufferSize | The new buffer size value. |
---|