WhirlyGlobe初识(二)

一、文字

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、基本用法
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 上节文章中,给大家分享了canvas最基础的用法,包括绘制线条、控制渲染方式、绘制图形、作用域、添加阴影、清理、剪...
    yancy_1012阅读 264评论 0 0
  • 一、Dart学习 开始写Flutter项目前,建议先学一下Dart,尽管和java很相似,如果学过kotlin会更...
    夏_Leon阅读 472评论 0 1
  • “作家二美”:是我的老师,专门教授写作课程。到如今,我师从二美门下,已近两个月。今群中闲聊,朋友们谈及“爱”的相关...
    红衣王大卫阅读 792评论 0 5
  • 使用 v-html 指令用于输出 html 代码v-html 指令 html几个重要标签用法(div,p,span...
    Mortimey_yt阅读 128评论 0 0
  • 推荐指数: 6.0 书籍主旨关键词:特权、焦点、注意力、语言联想、情景联想 观点: 1.统计学现在叫数据分析,社会...
    Jenaral阅读 5,753评论 0 5