MSFTileData

Objective-C


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

Swift

class MSFTileData : NSObject

A wrapper class for tile data.

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

    Declaration

    Objective-C

    - (BOOL)isEqual:(id)object;

    Swift

    func isEqual(_ object: Any!) -> Bool

    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;

    Swift

    func hash() -> UInt

    Return Value

    The hash value of this object.

  • Constructs a TileData object from a data blob.

    Declaration

    Objective-C

    - (id)initWithData:(MSFBinaryData *)data;

    Swift

    init!(data: MSFBinaryData!)

    Parameters

    data

    The source tile data.

  • Constructs a TileData object from RAW, already decoded pixels.

    For a source that produces pixels rather than a file - GDAL, a procedural tile, a decoder of a format the SDK does not know. The alternative is to encode a PNG the SDK then immediately decodes again, which is two codecs and three copies per tile.

    The layout is RGBA8, premultiplied, tightly packed: exactly width * height * 4 bytes, no row padding. One format on purpose - a second one would put a switch in every consumer for a case none of them has.

    Raster tiles only, and NOT persistently cached: the bytes carry no format, so a cache that stored them would read them back as a compressed file. See PersistentCacheTileDataSource::store.

    Declaration

    Objective-C

    - (id)initWithPixels:(MSFBinaryData *)pixels
                   width:(int)width
                  height:(int)height;

    Swift

    init!(pixels: MSFBinaryData!, width: Int32, height: Int32)

    Parameters

    pixels

    width * height * 4 bytes of premultiplied RGBA.

    width

    The tile width in pixels.

    height

    The tile height in pixels.

  • Returns the maximum age of the tile data, tile data will expire after that point.

    Declaration

    Objective-C

    - (long long)getMaxAge;

    Swift

    func getMaxAge() -> Int64

    Return Value

    Tile data maximum age in milliseconds, or -1 if the data does not expire.

  • Sets the maximum age of tile data, tile data will expire after that point.

    Declaration

    Objective-C

    - (void)setMaxAge:(long long)maxAge;

    Swift

    func setMaxAge(_ maxAge: Int64)

    Parameters

    maxAge

    Tile data maximum age in milliseconds, or -1 if the data does not expire.

  • Returns true if the tile should be replaced with parent tile.

    Declaration

    Objective-C

    - (BOOL)isReplaceWithParent;

    Swift

    func isReplaceWithParent() -> Bool

    Return Value

    True if the tile should be replaced with parent. False otherwise.

  • Set the parent replacement flag.

    Declaration

    Objective-C

    - (void)setReplaceWithParent:(BOOL)flag;

    Swift

    func setReplaceWithParent(_ flag: Bool)

    Parameters

    flag

    True when the tile should be replaced with the parent, false otherwise.

  • Returns true if the tile data source marked this as over zoom.

    Declaration

    Objective-C

    - (BOOL)isOverZoom;

    Swift

    func isOverZoom() -> Bool

    Return Value

    True if the tile should not be drawn. False otherwise.

  • Set the parent overzoom flag.

    Declaration

    Objective-C

    - (void)setIsOverZoom:(BOOL)flag;

    Swift

    func setIsOverZoom(_ flag: Bool)

    Return Value

    True if the tile should not be drawn. False otherwise.

  • Returns tile data as binary data.

    Declaration

    Objective-C

    - (MSFBinaryData *)getData;

    Swift

    func getData() -> MSFBinaryData!

    Return Value

    Tile data as binary data.

  • Returns true when getData() holds raw RGBA8 pixels rather than an encoded file. A consumer that turns tiles into bitmaps has to check this before decoding.

    Declaration

    Objective-C

    - (BOOL)isRawPixels;

    Swift

    func isRawPixels() -> Bool

    Return Value

    True if the data is raw pixels.

  • The pixel width, or 0 when the data is an encoded file.

    Declaration

    Objective-C

    - (int)getWidth;

    Swift

    func getWidth() -> Int32

    Return Value

    The width in pixels.

  • The pixel height, or 0 when the data is an encoded file.

    Declaration

    Objective-C

    - (int)getHeight;

    Swift

    func getHeight() -> Int32

    Return Value

    The height in pixels.

  • Returns true if the specified key exists in the tile meta data map.

    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. 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, copying it first - the map is shared with every other tile of the same source.

    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.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()