MSFHTTPTileDataSource

Objective-C


@interface MSFHTTPTileDataSource : MSFTileDataSource

Swift

class MSFHTTPTileDataSource : MSFTileDataSource

A tile data source that loads tiles using a HTTP connection, replacing the tags in the baseURL template with actual values. Supported tags: s, z, zoom, x, y, xflipped, yflipped, quadkey, frame, time (e.g. “https://tile.openstreetmap.org/{zoom}/{x}/{y}.png”). frame is the tile’s frame number; time is the timestamp given to setFrameTimestamps for it, and is left in the URL when none was. A URL ending with .pmtiles or starting with pmtiles:// is read from the PMTiles archive with HTTP range requests.

  • Constructs a HTTPTileDataSource object.

    Declaration

    Objective-C

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

    Swift

    init!(minZoom: Int32, maxZoom: Int32, baseURL: String!)

    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;

    Swift

    func getBaseURL() -> String!

    Return Value

    The base URL template.

  • Sets the base URL for the data source.

    Declaration

    Objective-C

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

    Swift

    func setBaseURL(_ baseURL: String!)

    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

    - (MSFStringVector *)getSubdomains;

    Swift

    func getSubdomains() -> MSFStringVector!

    Return Value

    The list of subdomains.

  • Sets the subdomains for {s} tag.

    Declaration

    Objective-C

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

    Swift

    func setSubdomains(_ subdomains: MSFStringVector!)

    Parameters

    subdomains

    The list of subdomains to use.

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

    Declaration

    Objective-C

    - (BOOL)isTMSScheme;

    Swift

    func isTMSScheme() -> Bool

    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;

    Swift

    func setTMSScheme(_ tmsScheme: Bool)

    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;

    Swift

    func isMaxAgeHeaderCheck() -> Bool

    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;

    Swift

    func setMaxAgeHeaderCheck(_ maxAgeCheck: Bool)

    Parameters

    maxAgeCheck

    True if the check should be enabled, false otherwise.

  • Returns the current timeout value.

    Declaration

    Objective-C

    - (int)getTimeout;

    Swift

    func getTimeout() -> Int32

    Return Value

    The current timeout value in seconds. If negative, then default platform-specific timeout is used.

  • Sets the current timeout value.

    Declaration

    Objective-C

    - (void)setTimeout:(int)timeout;

    Swift

    func setTimeout(_ timeout: Int32)

    Parameters

    timeout

    The new timeout value in seconds. If negative, then default platform-specific timeout is used.

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

    Declaration

    Objective-C

    - (MSFStringMap *)getHTTPHeaders;

    Swift

    func getHTTPHeaders() -> MSFStringMap!

    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:(MSFStringMap *)headers;

    Swift

    func setHTTPHeaders(_ headers: MSFStringMap!)

    Parameters

    headers

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

  • Returns the timestamps that the {time} tag takes the value of.

    Declaration

    Objective-C

    - (MSFStringVector *)getFrameTimestamps;

    Swift

    func getFrameTimestamps() -> MSFStringVector!

    Return Value

    The timestamps, as given to setFrameTimestamps.

  • Sets the timestamps of the frames of an animation, in the order AnimatedRasterTileLayer gives them: a tile of frame nr N gets the timestamp whose frame number (see FrameTimestamps.h) is N as its {time}.

    Declaration

    Objective-C

    - (void)setFrameTimestamps:(MSFStringVector *)timestamps;

    Swift

    func setFrameTimestamps(_ timestamps: MSFStringVector!)

    Parameters

    timestamps

    The timestamps; AnimatedRasterTileLayer sets them on its source by itself.

  • Undocumented

    Declaration

    Objective-C

    - (MSFTileData *)loadTile:(MSFMapTile *)mapTile;

    Swift

    func load(_ mapTile: MSFMapTile!) -> MSFTileData!
  • Undocumented

    Declaration

    Objective-C

    -(MSFTileData*)loadTileSwigExplicitMSFHTTPTileDataSource: (MSFMapTile*)mapTile;

    Swift

    func loadTileSwigExplicitMSFHTTPTileDataSource(_ mapTile: MSFMapTile!) -> MSFTileData!
  • Undocumented

    Declaration

    Objective-C

    - (MSFStringMap *)buildTagValues:(MSFMapTile *)tile;

    Swift

    func buildTagValues(_ tile: MSFMapTile!) -> MSFStringMap!
  • Undocumented

    Declaration

    Objective-C

    -(NSString*)buildTileURL: (NSString*)baseURL tile: (MSFMapTile*)tile;

    Swift

    func buildTileURL(_ baseURL: String!, tile: MSFMapTile!) -> String!
  • Undocumented

    Declaration

    Objective-C

    -(NSString*)buildTileURLSwigExplicitMSFHTTPTileDataSource: (NSString*)baseURL tile: (MSFMapTile*)tile;

    Swift

    func buildTileURLSwigExplicitMSFHTTPTileDataSource(_ baseURL: String!, tile: MSFMapTile!) -> String!
  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()