MAOverlayPathView.h
2.2 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
99
//
// MAOverlayPathView.h
// MAMapKitNew
//
// Created by AutoNavi.
// Copyright (c) 2014年 Amap. All rights reserved.
//
#import "MAOverlayView.h"
/*!
@brief 该类提供使用CGPathRef来绘制overlay,默认的操作是使用fill attributes, stroke attributes绘制当前path到context中, 可以使用该类的子类MACircleView, MAPolylineView, MAPolygonView或者继承该类, 如果继承该类,需要重载-(void)createPath方法
*/
@interface MAOverlayPathView : MAOverlayView
/*!
@brief 填充颜色,默认是[UIColor colorWithRed:0 green:1 blue:0 alpha:0.6]
*/
@property (strong) UIColor *fillColor;
/*!
@brief 笔触颜色,默认是[UIColor colorWithRed:1 green:0 blue:0 alpha:0.6]
*/
@property (strong) UIColor *strokeColor;
/*!
@brief 笔触宽度,默认是0
*/
@property CGFloat lineWidth;
/*!
@brief LineJoin,默认是kCGLineJoinRound
*/
@property CGLineJoin lineJoin;
/*!
@brief LineCap,默认是kCGLineCapRound
*/
@property CGLineCap lineCap;
/*!
@brief MiterLimit,默认是10.f
*/
@property CGFloat miterLimit;
/*!
@brief LineDashPhase,默认是0.f
*/
@property CGFloat lineDashPhase;
/*!
@brief LineDashPattern,默认是nil
*/
@property (copy) NSArray *lineDashPattern;
/*!
@brief 子类需要重载该方法并设置(self.path = newPath)
*/
- (void)createPath;
/*!
@brief 当前的path
*/
@property CGPathRef path;
/*!
@brief 释放当前path,调用之后 path == NULL
*/
- (void)invalidatePath;
/*!
@brief 将当前的stroke attributes设置到指定的context
@param context 目标context
@param zoomScale 当前缩放比例值
*/
- (void)applyStrokePropertiesToContext:(CGContextRef)context atZoomScale:(MAZoomScale)zoomScale;
/*!
@brief 将当前的fill attributes设置到指定的context
@param context 目标context
@param zoomScale 当前缩放比例值
*/
- (void)applyFillPropertiesToContext:(CGContextRef)context atZoomScale:(MAZoomScale)zoomScale;
/*!
@brief 绘制path
@param path 要绘制的path
@param context 目标context
*/
- (void)strokePath:(CGPathRef)path inContext:(CGContextRef)context;
/*!
@brief 填充path
@param path 要绘制的path
@param context 目标context
*/
- (void)fillPath:(CGPathRef)path inContext:(CGContextRef)context;
@end