MaplySticker
Objective-C
@interface MaplySticker : NSObject
Swift
class MaplySticker : NSObject
Stickers are rectangles placed on the globe with an image.
The Maply Sticker will stretch a rectangle (in geographic) over the given extents and tack the given image on top of it. Stickers differ from MaplyMarker objects in that they’re big. They can stretch over a larger are and need to be subdivided as such.
-
The lower left corner (in geographic) of the sticker
Declaration
Objective-C
@property (nonatomic) MaplyCoordinate ll;
Swift
var ll: MaplyCoordinate { get set }
-
The upper right corner (in geographic) of the sticker
Declaration
Objective-C
@property (nonatomic) MaplyCoordinate ur;
Swift
var ur: MaplyCoordinate { get set }
-
Angle of rotation around center
Declaration
Objective-C
@property (nonatomic) float rotation;
Swift
var rotation: Float { get set }
-
If present, this is the coordinate system the sticker is represented in.
By default the coordinates are in geographic. If this is present, the coordinates are in this system.
Declaration
Objective-C
@property (nonatomic, strong) MaplyCoordinateSystem *_Nullable coordSys;
Swift
var coordSys: MaplyCoordinateSystem? { get set }
-
Image (or MaplyTexture) to stretch over the sticker.
The UIImage (or MaplyTexture) is cached in the view controller, so multiple references will result in the same texture being used. The view controller also cleans up the images when it’s done with it.
Declaration
Objective-C
@property (nonatomic, strong) id _Nullable image;
Swift
var image: Any? { get set }
-
Images to stretch over the sticker.
This is an NSArray of UIImages (or MaplyTextures). The images will be cached in the view controller, so multiple references will result in the same texture being used. The view controller also cleans up the images when it’s done with them.
All the images passed in here will be presented to the shader program, if it has variables for them. It’s up to you to do something with them in the shader.
Declaration
Objective-C
@property (nonatomic, strong) NSArray *_Nullable images;
Swift
var images: [Any]? { get set }
-
Set the image format for the created textures.
OpenGL ES offers us several image formats that are more efficient than 32 bit RGBA, but they’re not always appropriate. This property lets you choose one of them. The 16 or 8 bit ones can save a huge amount of space and will work well for some imagery, most maps, and a lot of weather overlays.
Image Format Description MaplyImageIntRGBA 32 bit RGBA with 8 bits per channel. The default. MaplyImageUShort565 16 bits with 5/6/5 for RGB and none for A. MaplyImageUShort4444 16 bits with 4 bits for each channel. MaplyImageUShort5551 16 bits with 5/5/5 bits for RGB and 1 bit for A. MaplyImageUByteRed 8 bits, where we choose the R and ignore the rest. MaplyImageUByteGreen 8 bits, where we choose the G and ignore the rest. MaplyImageUByteBlue 8 bits, where we choose the B and ignore the rest. MaplyImageUByteAlpha 8 bits, where we choose the A and ignore the rest. MaplyImageUByteRGB 8 bits, where we average RGB for the value. MaplyImage4Layer8Bit 32 bits, four channels of 8 bits each. Just like MaplyImageIntRGBA, but a warning not to do anything too clever in sampling. Declaration
Objective-C
@property (nonatomic) MaplyQuadImageFormat imageFormat;
Swift
var imageFormat: MaplyQuadImageFormat { get set }