10 #import <UIKit/UIKit.h> 14 #define kMAOverlayRendererDefaultStrokeColor [UIColor colorWithRed:0.3 green:0.63 blue:0.89 alpha:0.8] 15 #define kMAOverlayRendererDefaultFillColor [UIColor colorWithRed:0.77 green:0.88 blue:0.94 alpha:0.8] 17 @protocol MAOverlayRenderDelegate;
32 @property (nonatomic, readonly, retain) id <MAOverlay>
overlay;
41 @property (nonatomic, assign) CGFloat
alpha;
51 - (instancetype)initWithOverlay:(
id<MAOverlay>)overlay;
82 - (CGPoint)glPointForMapPoint:(
MAMapPoint)mapPoint;
90 - (CGPoint *)glPointsForMapPoints:(
MAMapPoint *)mapPoints count:(NSUInteger)count;
97 - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth;
107 - (void)renderLinesWithPoints:(CGPoint *)points
108 pointCount:(NSUInteger)pointCount
109 strokeColor:(UIColor *)strokeColor
110 lineWidth:(CGFloat)lineWidth
111 looped:(BOOL)looped __attribute__((deprecated("已废弃")));;
124 - (void)renderLinesWithPoints:(CGPoint *)points
125 pointCount:(NSUInteger)pointCount
126 strokeColor:(UIColor *)strokeColor
127 lineWidth:(CGFloat)lineWidth
131 lineDash:(
MALineDashType)lineDash __attribute__((deprecated("已废弃")));
141 - (void)renderTexturedLinesWithPoints:(CGPoint *)points
142 pointCount:(NSUInteger)pointCount
143 lineWidth:(CGFloat)lineWidth
144 textureID:(GLuint)textureID
145 looped:(BOOL)looped __attribute__((deprecated("已废弃")));
156 - (void)renderTexturedLinesWithPoints:(CGPoint *)points
157 pointCount:(NSUInteger)pointCount
158 lineWidth:(CGFloat)lineWidth
159 textureIDs:(NSArray *)textureIDs
160 drawStyleIndexes:(NSArray *)drawStyleIndexes
161 looped:(BOOL)looped __attribute__((deprecated("已废弃")));
177 - (void)renderLinesWithPoints:(CGPoint *)points
178 pointCount:(NSUInteger)pointCount
179 strokeColors:(NSArray *)strokeColors
180 drawStyleIndexes:(NSArray *)drawStyleIndexes
181 isGradient:(BOOL)isGradient
182 lineWidth:(CGFloat)lineWidth
186 lineDash:(
MALineDashType)lineDash __attribute__((deprecated("已废弃")));
196 - (void)renderRegionWithPoints:(CGPoint *)points
197 pointCount:(NSUInteger)pointCount
198 fillColor:(UIColor *)fillColor
199 usingTriangleFan:(BOOL)usingTriangleFan __attribute__((deprecated("已废弃")));
213 - (void)renderStrokedRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount
214 fillColor:(UIColor *)fillColor
215 strokeColor:(UIColor *)strokeColor
216 strokeLineWidth:(CGFloat)strokeLineWidth
219 usingTriangleFan:(BOOL)usingTriangleFan __attribute__((deprecated("已废弃")));
231 - (void)renderTextureStrokedRegionWithPoints:(CGPoint *)points
232 pointCount:(NSUInteger)pointCount
233 fillColor:(UIColor *)fillColor
234 strokeTineWidth:(CGFloat)strokeLineWidth
235 strokeTextureID:(GLuint)strokeTexture
236 usingTriangleFan:(BOOL)usingTriangleFan __attribute__((deprecated("已废弃")));
243 - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points __attribute__((deprecated("已废弃")));
251 - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points modulateColor:(UIColor *)modulateColor __attribute__((deprecated("已废弃")));
263 - (GLuint)loadStrokeTextureImage:(UIImage *)textureImage __attribute__((deprecated("已废弃, 请通过属性strokeImage设置")));
270 - (GLuint)loadTexture:(UIImage *)textureImage;
276 - (void)deleteTexture:(GLuint)textureId;
BOOL _needsLoadStrokeTexture
Definition: MAOverlayRenderer.h:25
该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现(render相关方法只能在重写后的gl...
Definition: MAOverlayRenderer.h:20
CGSize _strokeTextureSize
Definition: MAOverlayRenderer.h:23
BOOL _needsUpdate
Definition: MAOverlayRenderer.h:24
float * getProjectionMatrix()
获取当前地图projection矩阵,数组长度为16,无需外界释放. 需要添加至地图后,才能获取有效矩阵数据,否则...
平面投影坐标结构定义
Definition: MAGeometry.h:38
CGFloat getMapZoomLevel()
获取当前地图缩放级别,需要添加到地图获取才有效。(since 5.1.0)
MAMapPoint getOffsetPoint()
获取当前地图中心点偏移,用以把地图坐标转换为gl坐标。需要添加到地图获取才有效。(since 5...
GLuint strokeTextureID
笔触纹理id, 修改纹理id参考, 如果strokeImage未指定、尚未加载或加载失败返回0
Definition: MAOverlayRenderer.h:38
UIImage * strokeImage
用于生成笔触纹理id的图片(支持非PowerOfTwo图片; 如果您需要减轻绘制产生的锯齿,您可以参考AMap.bundle中的traffic_texture_blue.png的方式,在image两边增加部分透明像素.)。(since 5.3.0)
Definition: MAOverlayRenderer.h:35
MALineCapType
Definition: MALineDrawType.h:22
MALineJoinType
Definition: MALineDrawType.h:14
CGFloat alpha
透明度[0,1],默认为1. 使用MAOverlayRenderer类提供的渲染接口会自动应用此属性。(since 5...
Definition: MAOverlayRenderer.h:41
void glRender()
绘制函数(子类需要重载来实现)
void setNeedsUpdate()
当关联overlay对象有更新时,调用此接口刷新. since 5.0.0
GLuint _strokeTextureID
Definition: MAOverlayRenderer.h:22
CGFloat contentScale
overlay渲染的scale。(since 5.1.0)
Definition: MAOverlayRenderer.h:44
float * getViewMatrix()
获取当前地图view矩阵,数组长度为16,无需外界释放. 需要添加至地图后,才能获取有效矩阵数据,否则返回NUL...
id< MAOverlay > overlay
关联的overlay对象
Definition: MAOverlayRenderer.h:32
id< MAOverlayRenderDelegate > rendererDelegate
由地图添加时,不要手动设置。如果不是使用mapview进行添加,则需要手动设置。(since 5.1.0)
Definition: MAOverlayRenderer.h:29
MALineDashType
虚线类型
Definition: MALineDrawType.h:32