MaplyScreenMarker
Objective-C
@interface MaplyScreenMarker : NSObject
Swift
class MaplyScreenMarker : NSObject
The Screen Marker is a 2D object that displays an image on the screen tracking a given location.
The screen marker will track the given geographic location and display a centered rectangle with the given image. Essentially it’s a free floating icon, similar to the MaplyScreenLabel and it will always be drawn on top of other objects. If the location would be behind the globe (in globe mode), the marker will disappear.
If you’re looking for a 3D marker object, that’s the MaplyMarker.
-
The location we’re tracking for this particular screen marker.
Locations are in geographic (lon/lat in radians).
Declaration
Objective-C
@property (nonatomic) MaplyCoordinate loc;
Swift
var loc: MaplyCoordinate { get set }
-
Screen size in points.
The marker will always be this size on the screen. The size is specified in pixels.
Declaration
Objective-C
@property (nonatomic) CGSize size;
Swift
var size: CGSize { get set }
-
An optional rotation to apply to the screen marker.
This is a rotation we’ll apply after the screen position has been calculated. The angle is in radians counter-clockwise from north.
Declaration
Objective-C
@property (nonatomic) double rotation;
Swift
var rotation: Double { get set }
-
Image or texture to use for the marker.
If set we’ll stretch this UIImage (or MaplyTexture) out over the marker rectangle. If not set, the marker will just be a colored rectangle. The view controller tracks this object and will reuse its texture and dispose of it as needed.
Declaration
Objective-C
@property (nonatomic, strong) id _Nullable image;
Swift
var image: Any? { get set }
-
Images to display on the sticker.
If this is set rather than image, we will cycle through these images on the screen marker. It will take period time to cycle through them all.
Declaration
Objective-C
@property (nonatomic, strong) NSArray *_Nullable images;
Swift
var images: [Any]? { get set }
-
The time we’ll take to cycle through all the images for the marker.
If images are passed in, this is the time it will take to cycle through them all. By default this is 5s.
Declaration
Objective-C
@property (nonatomic) double period;
Swift
var period: Double { get set }
-
Color for this particular marker.
If set, this the color we’ll use for the marker or how we’ll tint the image.
This overrides the color set in the description dictionary.
Declaration
Objective-C
@property (nonatomic, strong) UIColor * __nullable color
Swift
var color: UnsafeMutablePointer<Int32>? { get set }
-
The layout importance compared to other features, 0 by default.
The toolkit has a simple layout engine that runs several times per second. It controls the placement of all participating screen based features, such as MaplyScreenLabel and MaplyScreenMaker objects. This value controls the relative importance of this particular object. By default that importance is 0 so the object must compete with others. Setting it to MAXFLOAT will bypass the layout engine entirely and the object will always appear.
Declaration
Objective-C
@property (nonatomic) float layoutImportance;
Swift
var layoutImportance: Float { get set }
-
The size of the marker for layout purposes.
If layoutImportance is not set to MAXFLOAT, the screen marker will get throw into the mix when doing screen layout. With this, you can set the size of the marker when considering layout. If you set this to (0,0) the maker will take up no space, but still be considered in the layout.
Declaration
Objective-C
@property (nonatomic) CGSize layoutSize;
Swift
var layoutSize: CGSize { get set }
-
Screen markers are usually grouped together for rendering efficiency. This controls the order of the marker within that grouping. orderBy is less important than drawPriority. Default is 0 and means no ordering.
Declaration
Objective-C
@property (nonatomic) long orderBy;
Swift
var orderBy: Int { get set }
-
Offset in screen coordinates.
Set to zero by default, this is the offset we’ll apply to a given screen marker before it’s drawn. The values are screen points.
Declaration
Objective-C
@property (nonatomic) CGPoint offset;
Swift
var offset: CGPoint { get set }
-
Vertex attributes to apply to this screen marker.
MaplyVertexAttribute objects are passed all the way to the shader. Read that page for details on what they do.
The array of vertex attributes provided here will be copied onto all the vertices we create for the shader. This means you can use these to do things for a single billboard in your shader.
Declaration
Objective-C
@property (nonatomic, strong) NSArray *_Nullable vertexAttributes;
Swift
var vertexAttributes: [Any]? { get set }
-
Screen marker selectability. On by default
If set, this marker can be selected by the user. If not set, this screen marker will never appear in selection results.
Declaration
Objective-C
@property (nonatomic) _Bool selectable;
Swift
var selectable: Bool { get set }
-
A unique identifier for the marker that’s propagated through the system.
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *uniqueID;
Swift
var uniqueID: String? { get set }
-
User data object for selection
When the user selects a feature and the developer gets it in their delegate, this is an object they can use to figure out what the screen marker means to them.
Declaration
Objective-C
@property (nonatomic, strong) id _Nullable userObject;
Swift
var userObject: Any? { get set }