MSFTileDataSource

Objective-C


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

Swift

class MSFTileDataSource : NSObject

Abstract base class for tile data sources. It provides default implementation for listener registration and other common tile data source methods.

  • Returns the minimum zoom level supported by this data source.

    Declaration

    Objective-C

    - (int)getMinZoom;

    Swift

    func getMinZoom() -> Int32

    Return Value

    The minimum zoom level supported (inclusive).

  • Returns the minimum zoom level supported by this data source.

    Declaration

    Objective-C

    - (int)getMinZoomSwigExplicitMSFTileDataSource;

    Swift

    func getMinZoomSwigExplicitMSFTileDataSource() -> Int32

    Return Value

    The minimum zoom level supported (inclusive).

  • Returns the maximum zoom level supported by this data source.

    Declaration

    Objective-C

    - (int)getMaxZoom;

    Swift

    func getMaxZoom() -> Int32

    Return Value

    The maximum zoom level supported (exclusive).

  • Returns the maximum zoom level supported by this data source.

    Declaration

    Objective-C

    - (int)getMaxZoomSwigExplicitMSFTileDataSource;

    Swift

    func getMaxZoomSwigExplicitMSFTileDataSource() -> Int32

    Return Value

    The maximum zoom level supported (exclusive).

  • Returns the maximum zoom level supported by this data source + getMaxOverzoomLevel if >= 0.

    Declaration

    Objective-C

    - (int)getMaxZoomWithOverzoom;

    Swift

    func getMaxZoomWithOverzoom() -> Int32

    Return Value

    The maximum zoom level supported (exclusive).

  • Returns the maximum zoom level supported by this data source + getMaxOverzoomLevel if >= 0.

    Declaration

    Objective-C

    - (int)getMaxZoomWithOverzoomSwigExplicitMSFTileDataSource;

    Swift

    func getMaxZoomWithOverzoomSwigExplicitMSFTileDataSource() -> Int32

    Return Value

    The maximum zoom level supported (exclusive).

  • Sets the maximum overzoom level for this datasource. If a tile for the given zoom level Z is not available, SDK will try to use tiles with zoom levels Z-1, …, Z-MaxOverzoomLevel. The default is -1 (disabled).

    Declaration

    Objective-C

    - (void)setMaxOverzoomLevel:(int)overzoomLevel;

    Swift

    func setMaxOverzoomLevel(_ overzoomLevel: Int32)

    Parameters

    overzoomLevel

    The new maximum overzoom value.

  • Gets the current maximum overzoom level for this datasource. Over it the datasource will not be “drawn”

    Declaration

    Objective-C

    - (int)getMaxOverzoomLevel;

    Swift

    func getMaxOverzoomLevel() -> Int32

    Return Value

    The current maximum overzoom level for this datasource.

  • Undocumented

    Declaration

    Objective-C

    -(BOOL)isMaxOverzoomLevelSet;

    Swift

    func isMaxOverzoomLevelSet() -> Bool
  • Returns a copy of the data source meta data map. The changes you make to this map are NOT reflected in the actual meta data of the source. The map is attached to every tile this source loads, and consumers read their settings from it - “dem_encoding” (“mapbox” or “terrarium”) selects the elevation decoder, for instance. A wrapper source with no map of its own answers with its wrapped source’s.

    Declaration

    Objective-C

    - (MSFStringVariantMap *)getMetaData;

    Swift

    func getMetaData() -> MSFStringVariantMap!

    Return Value

    A copy of the data source meta data map.

  • Sets a new meta data map for the data source. Old meta data values will be lost. Takes effect for tiles loaded after the call.

    Declaration

    Objective-C

    - (void)setMetaData:(MSFStringVariantMap *)metaData;

    Swift

    func setMetaData(_ metaData: MSFStringVariantMap!)

    Parameters

    metaData

    The new meta data map for this data source.

  • Returns true if the specified key exists in the data source meta data map, or in the container’s own metadata.

    Declaration

    Objective-C

    - (BOOL)containsMetaDataKey:(NSString *)key;

    Swift

    func containsMetaDataKey(_ key: String!) -> Bool

    Parameters

    key

    The key to check.

    Return Value

    True if the meta data element exists.

  • Returns a meta data element corresponding to the key. Falls back to the container’s own metadata (see getContainerMetaData) when the key was not set on the source itself. If no value is found null variant is returned.

    Declaration

    Objective-C

    - (MSFVariant *)getMetaDataElement:(NSString *)key;

    Swift

    func getMetaDataElement(_ key: String!) -> MSFVariant!

    Parameters

    key

    The key to use.

    Return Value

    The value corresponding to the key, or an empty variant.

  • Adds a new key-value pair to the meta data map. If the key already exists in the map, it’s value will be replaced by the new value. Takes effect for tiles loaded after the call.

    Declaration

    Objective-C

    - (void)setMetaDataElement:(NSString *)key element:(MSFVariant *)element;

    Swift

    func setMetaDataElement(_ key: String!, element: MSFVariant!)

    Parameters

    key

    The new key.

    element

    The new value.

  • Reads one entry of the source’s own metadata, when it has any - the MBTiles or PMTiles metadata table, for instance. Sources that carry none return an empty string, as do keys they do not define. Unlike the meta data map above this is read-only and is NOT attached to the loaded tiles: a container’s metadata can be tens of kilobytes.

    Declaration

    Objective-C

    - (NSString *)getContainerMetaData:(NSString *)key;

    Swift

    func getContainerMetaData(_ key: String!) -> String!

    Parameters

    key

    The metadata key, as named by the container’s specification.

    Return Value

    The value, or empty string if the source does not provide it.

  • Reads one entry of the source’s own metadata, when it has any - the MBTiles or PMTiles metadata table, for instance. Sources that carry none return an empty string, as do keys they do not define. Unlike the meta data map above this is read-only and is NOT attached to the loaded tiles: a container’s metadata can be tens of kilobytes.

    Declaration

    Objective-C

    - (NSString *)getContainerMetaDataSwigExplicitMSFTileDataSource:(NSString *)key;

    Swift

    func getContainerMetaDataSwigExplicitMSFTileDataSource(_ key: String!) -> String!

    Parameters

    key

    The metadata key, as named by the container’s specification.

    Return Value

    The value, or empty string if the source does not provide it.

  • Returns the extent of the tiles in this data source. The bounds are in coordinate system of the projection of the data source.

    Declaration

    Objective-C

    - (MSFMapBounds *)getDataExtent;

    Swift

    func getDataExtent() -> MSFMapBounds!

    Return Value

    The extent of the data source.

  • Returns the extent of the tiles in this data source. The bounds are in coordinate system of the projection of the data source.

    Declaration

    Objective-C

    - (MSFMapBounds *)getDataExtentSwigExplicitMSFTileDataSource;

    Swift

    func getDataExtentSwigExplicitMSFTileDataSource() -> MSFMapBounds!

    Return Value

    The extent of the data source.

  • Returns the projection of this tile source.

    Declaration

    Objective-C

    - (MSFProjection *)getProjection;

    Swift

    func getProjection() -> MSFProjection!

    Return Value

    The projection of this tile source.

  • Loads the specified tile. Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.

    Declaration

    Objective-C

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

    Swift

    func load(_ tile: MSFMapTile!) -> MSFTileData!

    Parameters

    tile

    The tile to load.

    Return Value

    The tile data. If the tile is not available, null may be returned.

  • Notifies listeners that the tiles have changed. Action taken depends on the implementation of the listeners, but generally all cached tiles will be reloaded. If the removeTiles flag is set all caches will be cleared prior to reloading, if it’s not set then the reloaded tiles will replace the old tiles in caches as they finish loading.

    Declaration

    Objective-C

    - (void)notifyTilesChanged:(BOOL)removeTiles;

    Swift

    func notifyTilesChanged(_ removeTiles: Bool)

    Parameters

    removeTiles

    The remove tiles flag.

  • Notifies listeners that the tiles have changed. Action taken depends on the implementation of the listeners, but generally all cached tiles will be reloaded. If the removeTiles flag is set all caches will be cleared prior to reloading, if it’s not set then the reloaded tiles will replace the old tiles in caches as they finish loading.

    Declaration

    Objective-C

    - (void)notifyTilesChangedSwigExplicitMSFTileDataSource:(BOOL)removeTiles;

    Swift

    func notifyTilesChangedSwigExplicitMSFTileDataSource(_ removeTiles: Bool)

    Parameters

    removeTiles

    The remove tiles flag.

  • Builds tag map from tile info.

    Declaration

    Objective-C

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

    Swift

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

    Parameters

    tile

    The tile for the tag map.

    Return Value

    The tag map that will be used for replacing tags in templates.

  • Constructs an abstract TileDataSource object. Note: EPSG3857 projection is used. minZoom is defined to be 0, maxZoom is defined to be 24.

    Declaration

    Objective-C

    - (id)init;

    Swift

    init!()
  • Constructs an abstract TileDataSource object. Note: EPSG3857 projection is used.

    Declaration

    Objective-C

    - (id)initWithMinZoom:(int)minZoom maxZoom:(int)maxZoom;

    Swift

    init!(minZoom: Int32, maxZoom: Int32)

    Parameters

    minZoom

    The minimum zoom level supported by this data source.

    maxZoom

    The maximum zoom level supported by this data source.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()