NTHTTPTileDataSource


@interface NTHTTPTileDataSource : NTTileDataSource

A tile data source that loads tiles using a HTTP connection. The requests are generated using a template scheme, where tags in the baseURL string are replaced with actual values. The following tags are supported: s, z, zoom, x, y, xflipped, yflipped, quadkey, frame.

For example, if baseURL = “https://tile.openstreetmap.org/{zoom}/{x}/{y}.png” and the requested tile has zoom = 2, x = 1 and y = 3, then the tile will be loaded from the following URL: “https://tile.openstreetmap.org/2/1/3.png”.

  • Constructs a HTTPTileDataSource object.

    Declaration

    Objective-C

    - (id)initWithMinZoom:(int)minZoom
                  maxZoom:(int)maxZoom
                  baseURL:(NSString *)baseURL;

    Parameters

    minZoom

    The minimum zoom level supported by this data source.

    maxZoom

    The maximum zoom level supported by this data source.

    baseURL

    The base URL containing tags (for example, “https://tile.openstreetmap.org/{zoom}/{x}/{y}.png”).

  • Returns the base URL template containing tags.

    Declaration

    Objective-C

    - (NSString *)getBaseURL;

    Return Value

    The base URL template.

  • Sets the base URL for the data source.

    Declaration

    Objective-C

    - (void)setBaseURL:(NSString *)baseURL;

    Parameters

    baseURL

    The base URL containing tags (for example, “https://tile.openstreetmap.org/{zoom}/{x}/{y}.png”).

  • Returns the subdomains for {s} tag. The default is [“a”, “b”, “c”, “d”].

    Declaration

    Objective-C

    - (NTStringVector *)getSubdomains;

    Return Value

    The list of subdomains.

  • Sets the subdomains for {s} tag.

    Declaration

    Objective-C

    - (void)setSubdomains:(NTStringVector *)subdomains;

    Parameters

    subdomains

    The list of subdomains to use.

  • Returns true/false based whether the TMS tiling scheme is used.

    Declaration

    Objective-C

    - (BOOL)isTMSScheme;

    Return Value

    True if TMS tiling scheme is used. False if XYZ scheme is used.

  • Enables/disables the TMS tiling scheme. In TMS scheme y coordinate of the tile is flipped. The default is disabled.

    Declaration

    Objective-C

    - (void)setTMSScheme:(BOOL)tmsScheme;

    Parameters

    tmsScheme

    True is TMS tiling scheme should be used. False is XYZ should be used.

  • Returns true/false based on whether the max-age header check is used. If this is enabled, SDK will automatically refresh the tiles when tiles have expired.

    Declaration

    Objective-C

    - (BOOL)isMaxAgeHeaderCheck;

    Return Value

    True if max-age header check is used. False otherwise.

  • Enables/disables the max-age header check. If this is enabled, SDK will automatically refresh the tiles when tiles have expired. The default is disabled.

    Declaration

    Objective-C

    - (void)setMaxAgeHeaderCheck:(BOOL)maxAgeCheck;

    Parameters

    maxAgeCheck

    True if the check should be enabled, false otherwise.

  • Returns the current set of HTTP headers used. Initially this set is empty and can be changed with setHTTPHeaders.

    Declaration

    Objective-C

    - (NTStringMap *)getHTTPHeaders;

    Return Value

    The current set of custom HTTP headers.

  • Sets HTTP headers for all requests. Calling this method will invalidate the datasource and all layers using this data source will be refreshed.

    Declaration

    Objective-C

    - (void)setHTTPHeaders:(NTStringMap *)headers;

    Parameters

    headers

    A map of HTTP headers that will be used in subsequent requests.

  • Undocumented

    Declaration

    Objective-C

    - (NTTileData *)loadTile:(NTMapTile *)mapTile;
  • Undocumented

    Declaration

    Objective-C

    -(NTTileData*)loadTileSwigExplicitNTHTTPTileDataSource: (NTMapTile*)mapTile;
  • Undocumented

    Declaration

    Objective-C

    -(NSString*)buildTileURL: (NSString*)baseURL tile: (NTMapTile*)tile;
  • Undocumented

    Declaration

    Objective-C

    -(NSString*)buildTileURLSwigExplicitNTHTTPTileDataSource: (NSString*)baseURL tile: (NTMapTile*)tile;
  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;