iOS高德地图SDK(3D)  V7.5.0
MAOverlayRenderer.h
Go to the documentation of this file.
1 //
2 // MAOverlayRenderer.h
3 // MAMapKit
4 //
5 //
6 // Copyright (c) 2011年 Amap. All rights reserved.
7 //
8 
9 #import "MAConfig.h"
10 #import <UIKit/UIKit.h>
11 #import "MAOverlay.h"
12 #import "MALineDrawType.h"
13 
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]
16 
17 @protocol MAOverlayRenderDelegate;
18 
20 @interface MAOverlayRenderer : NSObject {
21  @protected
26 }
27 
29 @property (nonatomic, weak) id<MAOverlayRenderDelegate> rendererDelegate;
30 
32 @property (nonatomic, readonly, retain) id <MAOverlay> overlay;
33 
35 @property (nonatomic, strong) UIImage *strokeImage;
36 
38 @property (nonatomic, readonly) GLuint strokeTextureID;
39 
41 @property (nonatomic, assign) CGFloat alpha;
42 
44 @property (nonatomic, readonly) CGFloat contentScale;
45 
51 - (instancetype)initWithOverlay:(id<MAOverlay>)overlay;
52 
57 - (float *)getViewMatrix;
58 
63 - (float *)getProjectionMatrix;
64 
70 
75 - (CGFloat)getMapZoomLevel;
76 
82 - (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint;
83 
90 - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count;
91 
97 - (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth;
98 
107 - (void)renderLinesWithPoints:(CGPoint *)points
108  pointCount:(NSUInteger)pointCount
109  strokeColor:(UIColor *)strokeColor
110  lineWidth:(CGFloat)lineWidth
111  looped:(BOOL)looped __attribute__((deprecated("已废弃")));;
112 
124 - (void)renderLinesWithPoints:(CGPoint *)points
125  pointCount:(NSUInteger)pointCount
126  strokeColor:(UIColor *)strokeColor
127  lineWidth:(CGFloat)lineWidth
128  looped:(BOOL)looped
129  LineJoinType:(MALineJoinType)lineJoinType
130  LineCapType:(MALineCapType)lineCapType
131  lineDash:(MALineDashType)lineDash __attribute__((deprecated("已废弃")));
132 
141 - (void)renderTexturedLinesWithPoints:(CGPoint *)points
142  pointCount:(NSUInteger)pointCount
143  lineWidth:(CGFloat)lineWidth
144  textureID:(GLuint)textureID
145  looped:(BOOL)looped __attribute__((deprecated("已废弃")));
146 
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("已废弃")));
162 
163 
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
183  looped:(BOOL)looped
184  LineJoinType:(MALineJoinType)lineJoinType
185  LineCapType:(MALineCapType)lineCapType
186  lineDash:(MALineDashType)lineDash __attribute__((deprecated("已废弃")));
187 
188 
196 - (void)renderRegionWithPoints:(CGPoint *)points
197  pointCount:(NSUInteger)pointCount
198  fillColor:(UIColor *)fillColor
199  usingTriangleFan:(BOOL)usingTriangleFan __attribute__((deprecated("已废弃")));
200 
201 
213 - (void)renderStrokedRegionWithPoints:(CGPoint *)points pointCount:(NSUInteger)pointCount
214  fillColor:(UIColor *)fillColor
215  strokeColor:(UIColor *)strokeColor
216  strokeLineWidth:(CGFloat)strokeLineWidth
217  strokeLineJoinType:(MALineJoinType)strokeLineJoinType
218  strokeLineDash:(MALineDashType)strokeLineDash
219  usingTriangleFan:(BOOL)usingTriangleFan __attribute__((deprecated("已废弃")));
220 
221 
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("已废弃")));
237 
243 - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points __attribute__((deprecated("已废弃")));
244 
251 - (void)renderIconWithTextureID:(GLuint)textureID points:(CGPoint *)points modulateColor:(UIColor *)modulateColor __attribute__((deprecated("已废弃")));
252 
256 - (void)glRender;
257 
263 - (GLuint)loadStrokeTextureImage:(UIImage *)textureImage __attribute__((deprecated("已废弃, 请通过属性strokeImage设置")));
264 
270 - (GLuint)loadTexture:(UIImage *)textureImage;
271 
276 - (void)deleteTexture:(GLuint)textureId;
277 
281 - (void)setNeedsUpdate;
282 
283 @end
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
© 2017 高德信息技术有限公司 版权所有,保留所有权利。