NTCartoMapsService


@interface NTCartoMapsService : NSObject {
  void *swigCPtr;
  BOOL swigCMemOwn;
}

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.

  • Checks if this object is equal to the specified object.

    Declaration

    Objective-C

    - (BOOL)isEqual:(id)object;

    Parameters

    object

    The reference object.

    Return Value

    True when objects are equal, false otherwise.

  • Returns the hash value of this object.

    Declaration

    Objective-C

    - (NSUInteger)hash;

    Return Value

    The hash value of this object.

  • Constructs a new CartoMapsService instance with default settings.

    Declaration

    Objective-C

    - (id)init;
  • Returns the user account name used when accessing the online service.

    Declaration

    Objective-C

    - (NSString *)getUsername;

    Return Value

    The user account name used when accessing the online service.

  • Sets the user account name used when accessing the online service.

    Declaration

    Objective-C

    - (void)setUsername:(NSString *)username;

    Parameters

    username

    The user account name used when accessing the online service.

  • Returns the API key used when accessing the online service.

    Declaration

    Objective-C

    - (NSString *)getAPIKey;

    Return Value

    The API key used when accessing the online service.

  • Sets the optional API key used when accessing the online service. Usually this is not needed and can be left blank.

    Declaration

    Objective-C

    - (void)setAPIKey:(NSString *)apiKey;

    Parameters

    apiKey

    The optional API key used when accessing the online service.

  • Returns the API endpoint template of the online service.

    Declaration

    Objective-C

    - (NSString *)getAPITemplate;

    Return Value

    The API endpoint template of 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.

    Declaration

    Objective-C

    - (void)setAPITemplate:(NSString *)apiTemplate;

    Parameters

    apiTemplate

    The API endpoint template of the online service. For example, “https://{user}.cartodb.com”

  • Returns true is the service configures layers as interactive by using UTF grids for click detection.

    Declaration

    Objective-C

    - (BOOL)isInteractive;

    Return Value

    True if the service configures layers as interactive.

  • Sets the interactivity flag of the layers.

    Declaration

    Objective-C

    - (void)setInteractive:(BOOL)interactive;

    Parameters

    interactive

    True if layers should be configured as interactive. The default is false.

  • Returns the list of layer indices that are created. If non-empty, only layers from this list are created.

    Declaration

    Objective-C

    - (NTIntVector *)getLayerIndices;

    Return Value

    The list of layer indices that are created.

  • Sets the list of layer indices that are created. If non-empty, only layers from this list are created.

    Declaration

    Objective-C

    - (void)setLayerIndices:(NTIntVector *)layerIndices;

    Parameters

    layerIndices

    The list of layer indices that are created.

  • Returns the list of authentication tokens used when accessing online service.

    Declaration

    Objective-C

    - (NTStringVector *)getAuthTokens;

    Return Value

    The list of authentication tokens used when accessing online service.

  • Sets the list of authentication tokens used when accessing online service.

    Declaration

    Objective-C

    - (void)setAuthTokens:(NTStringVector *)authTokens;

    Parameters

    authTokens

    The list of authentication tokens used when accessing online service.

  • 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.

    Declaration

    Objective-C

    - (BOOL)isDefaultVectorLayerMode;

    Return Value

    True if vector layers should be used. False is raster layers are used.

  • 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.

    Declaration

    Objective-C

    - (void)setDefaultVectorLayerMode:(BOOL)vectorLayerMode;

    Parameters

    vectorLayerMode

    True if vector layers should be used. False is raster layers are used.

  • Returns the current vector tile buffer size.

    Declaration

    Objective-C

    - (float)getVectorTileBufferSize;

    Return Value

    The current vector tile buffer size in pixels.

  • 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.

    Declaration

    Objective-C

    - (void)setVectorTileBufferSize:(float)bufferSize;

    Parameters

    bufferSize

    The new buffer size value.

  • Returns true if ‘strict mode’ is enabled (the service throws exceptions whenever an error is encountered).

    Declaration

    Objective-C

    - (BOOL)isStrictMode;

    Return Value

    True if ‘strict mode’ is enabled.

  • Sets the ‘strict mode’ flag.

    Declaration

    Objective-C

    - (void)setStrictMode:(BOOL)strictMode;

    Parameters

    strictMode

    True if all errors result in exceptions. The default is false.

  • Returns the asset package used when decoding vector tiles. By default, no asset package is used and null is returned.

    Declaration

    Objective-C

    - (NTAssetPackage *)getVectorTileAssetPackage;

    Return Value

    The asset package used when decoding vector tiles.

  • Sets the asset package used when decoding vector tiles. Asset package with fonts is needed when texts are used.

    Declaration

    Objective-C

    - (void)setVectorTileAssetPackage:(NTAssetPackage *)assetPackage;

    Parameters

    assetPackage

    The asset package to use for vector tiles.

  • Builds a list of layers given anonymous map configuration. The map configuration specification can be found in CartoDB documentation page.

    Warning

    Throws NSException If IO error occured during the operation.

    Declaration

    Objective-C

    - (NTLayerVector *)buildMap:(NTVariant *)mapConfig;

    Parameters

    mapConfig

    The map configuration JSON deserialized as Variant type.

    Return Value

    The list of created layers.

  • Builds a list of layers given named map id and named map parameters.

    Warning

    Throws NSException If IO error occured during the operation.

    Declaration

    Objective-C

    - (NTLayerVector *)buildNamedMap:(NSString *)templateId
                      templateParams:(NTStringVariantMap *)templateParams;

    Parameters

    templateId

    The named map id.

    templateParams

    The map containing named map parameter names and their values.

    Return Value

    The list of created layers.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;