一、文字
MaplyScreenLabel 用于绘制文字
1、常用属性:
/**
地图位置
*/
@property (nonatomic,assign) MaplyCoordinate loc;
/**
大小
*/
@property (nonatomic,assign) CGSize size;
/**
图片
*/
@property (nonatomic,strong) id __nullable image;
/**
图片数组
*/
@property (nonatomic,strong) NSArray * __nullable images;
/**
颜色
*/
@property (nonatomic,strong) UIColor * __nullable color;
/**
*/
@property (nonatomic,assign) float layoutImportance;
/**
*/
@property (nonatomic,assign) CGSize layoutSize;
/**
偏移量
*/
@property (nonatomic,assign) CGPoint offset;
/**
是否开启用户交互,默认开启
*/
@property (nonatomic,assign) bool selectable;
/**
一个对象,用于传递信息
*/
@property (nonatomic,strong) id __nullable userObject;
2、基本用法
二、图片
MaplyScreenMarker 用于绘制图片
1、常用属性
/**
Location of the screen label in geographic (lat/lon) in radians.
The screen label will track this position. If it would be behind the globe (in globe mode), then it will disappear.
*/
@property (nonatomic,assign) MaplyCoordinate loc;
/**
An optional rotation to apply to the screen label.
This is a rotation we'll apply after the screen position has been calculated. You can use this to do things like track the orientation of roads.
Rotation is in radians counter-clockwise from north.
*/
@property (nonatomic,assign) float rotation;
/**
When the screen is rotated, try to keep the label upright.
This tells the layout and display engine to keep the label oriented upright no matter what. In practice this means it will manipulate the rotation by 180 degrees.
*/
@property (nonatomic,assign) bool keepUpright;
/**
The actual text to display.
This is a simple NSString for the text. Things like font are set in the NSDictionary passed in to the add call in the view controller.
*/
@property (nonatomic,strong) NSString * __nullable text;
/**
Text can be accompanied by an optional icon image.
If set, we'll put this image to the left of the text in the screen label. The UIImage will be tracked by the view controller and reused as needed or disposed of when no longer needed.
The name had to change because Apple's private selector search is somewhat weak.
*/
@property (nonatomic,strong) UIImage * __nullable iconImage2;
/**
Icon size in points.
If there is an icon image, this is how big it is.
*/
@property (nonatomic,assign) CGSize iconSize;
/**
An optional offset for the whole screen label.
If set, we'll move the screen label around by this amount before rendering it. These are screen coordinates, not geographic.
*/
@property (nonatomic,assign) CGPoint offset;
/**
An option color override.
If set, this color will override the color passed in with the NSDictionary in the view controller's add method.
*/
@property (nonatomic,strong) UIColor * __nullable color;
/**
Label selectability. On by default
If set, this label can be selected by the user. If not set, this screen label will never appear in selection results.
*/
@property (nonatomic,assign) bool selectable;
/**
*/
@property (nonatomic,assign) float layoutImportance;
/**
一个对象,用于传递信息
*/
@property (nonatomic,strong) id __nullable userObject;
2、基本用法