MAOverlayView.h
2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// MAOverlayView.h
// MAMapKitNew
//
// Created by AutoNavi.
// Copyright (c) 2014年 Amap. All rights reserved.
//
#import "MAGeometry.h"
#import "MAOverlay.h"
/*!
@brief 该类是地图覆盖物View的基类, 提供绘制overlay的接口但并无实际的实现
*/
@interface MAOverlayView : UIView
/*!
@brief 初始化并返回一个overlay view
@param overlay 关联的overlay对象
@return 初始化成功则返回overlay view,否则返回nil
*/
- (id)initWithOverlay:(id <MAOverlay>)overlay;
/*!
@brief 关联的overlay对象
*/
@property (nonatomic, readonly) id <MAOverlay> overlay;
/*!
@brief 将MAMapPoint转化为相对于receiver的本地坐标
@param mapPoint 要转化的MAMapPoint
@return 相对于receiver的本地坐标
*/
- (CGPoint)pointForMapPoint:(MAMapPoint)mapPoint;
/*!
@brief 将相对于receiver的本地坐标转化为MAMapPoint
@param point 要转化的相对于receiver的本地坐标
@return MAMapPoint
*/
- (MAMapPoint)mapPointForPoint:(CGPoint)point;
/*!
@brief 将MAMapRect转化为相对于receiver的本地rect
@param mapRect 要转化的MAMapRect
@return 相对于receiver的本地rect
*/
- (CGRect)rectForMapRect:(MAMapRect)mapRect;
/*!
@brief 将相对于receiver的本地rect转化为MAMapRect
@param rect 要转化的相对于receiver的本地rect
@return MAMapRect
*/
- (MAMapRect)mapRectForRect:(CGRect)rect;
/*!
@brief 判断overlay view是否可以绘制包含的内容
@param mapRect 该MAMapRect范围内需要绘制
@param zoomScale 当前的缩放比例值
@return 是否可以进行绘制
*/
- (BOOL)canDrawMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
/*!
@brief 绘制overlay view的内容
@param mapRect 该MAMapRect范围内需要更新
@param zoomScale 当前的缩放比例值
@param context 绘制操作的graphics context
*/
- (void)drawMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale inContext:(CGContextRef)context;
- (void)setNeedsDisplay;
/*!
@brief 重绘指定map rect内的内容
@param mapRect 该map rect范围内的内容需要重绘
*/
- (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect;
/*!
@brief 重绘指定zoom scale下map rect内的内容
@param mapRect 该map rect范围内的内容需要重绘
@param zoomScale 当前的缩放比例值
*/
- (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
/*!
@brief overlay的透明度
*/
@property CGFloat alpha;
/*!
@brief context的比例系数
*/
@property (readonly) CGFloat contentScaleFactor;
@end