MaplyImageTile
@interface MaplyImageTile : NSObject
Describes a single tile worth of data, which may be multiple images.
Delegates can pass back a single UIImage or NSData object, but if they want to do anything more complex, they need to do it with this.
-
Initialize as a placeholder image. Placeholder images are blank, but they allow the pager to keep loading their children.
Declaration
Objective-C
- (instancetype)initAsPlaceholder;
Swift
init!(asPlaceholder: ())
-
Initialize with an NSData object containing 32 bit pixels.
This sets up the tile with an NSData object containing raw pixels. The pixels are 32 bit RGBA even if you’re targeting a smaller pixel format.
Declaration
Objective-C
- (instancetype)initWithRawImage:(NSData *)data width:(int)width height:(int)height;
Swift
init!(rawImage data: Any!, width: Int32, height: Int32)
Parameters
data
The NSData object containing 32 bit RGBA pixels.
width
The width of the raw image contained in the data object.
height
The height of the raw image contained in the data object.
-
Initialize with an array of NSData objects containing 32 bit pixels.
This does the same thng as initWithRawData:width:height: but for tiles that contain multiple return images.
See
initWithRawData:width:height:
Declaration
Objective-C
- (instancetype)initWithRawImageArray:(NSArray *)data width:(int)width height:(int)height;
Swift
init!(rawImageArray data: Any!, width: Int32, height: Int32)
Parameters
data
The NSArray of NSData objects containing 32 bit RGBA pixels.
width
The width of the raw image contained in the data object.
height
The height of the raw image contained in the data object.
-
Initialize with a single UIImage for the tile.
This sets up the given UIImage as the return for the given tile. You can then set targetSize and such.
Declaration
Objective-C
- (instancetype)initWithImage:(id)image;
Swift
init!(image: Any!)
-
Initialize with an NSArray of UIImage objects for a tile that requires multiple return images.
Declaration
Objective-C
- (instancetype)initWithImageArray:(NSArray *)images;
Swift
init!(imageArray images: Any!)
-
Initialize with an NSData object containing PNG or JPEG data that can be interpreted by UIImage.
We’re expecting PNG, JPEG or another self identified format (e.g. PKM). These we can interpret ourselves.
Declaration
Objective-C
- (instancetype)initWithPNGorJPEGData:(NSData *)data;
Swift
init!(pnGorJPEGData data: Any!)
-
Initialize with an NSArray of NSData objects containing PNG or JPEG data that can be interpreted by UIImage
This is for tiles that require multiple images.
We’re expecting PNG, JPEG or another self identified format (e.g. PKM). These we can interpret ourselves.
Declaration
Objective-C
- (instancetype)initWithPNGorJPEGDataArray:(NSArray *)data;
Swift
init!(pnGorJPEGDataArray data: Any!)
-
Initialize with an NSObject. We’ll try to figure out what it is from the type.
We’ll look at the data type and try to figure out what you’re passing in. In general, it’s better to call one of the specific init routines.
Declaration
Objective-C
- (instancetype)initWithRandomData:(id)theObj;
Swift
init!(randomData theObj: Any!)
-
Optional elevation dataq provided with the image tile.
This is an optional set of elevation data that goes with this image tile.
Declaration
Objective-C
@property (readwrite, strong, nonatomic) MaplyElevationChunk *elevChunk;
Swift
var elevChunk: MaplyElevationChunk! { get set }
-
Target size for the image(s) represented by this tile.
This instructs the pager to rescale the image(s) to the given target size. This is probably faster than doing it yourself because we can extract the data and rescale in the same step.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CGSize targetSize;
Swift
var targetSize: Int32 { get set }