该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现(render相关方法只能在重写后的glRender方法中使用)
More...
#import <MAOverlayRenderer.h>
该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现(render相关方法只能在重写后的glRender方法中使用)
◆ deleteTexture:
- (void) deleteTexture: |
|
(GLuint) |
textureId |
|
删除纹理(since 5.1.0)
- Parameters
-
◆ getMapZoomLevel
- (CGFloat) getMapZoomLevel |
|
|
|
获取当前地图缩放级别,需要添加到地图获取才有效。(since 5.1.0)
- Returns
- 缩放级别
◆ getOffsetPoint
获取当前地图中心点偏移,用以把地图坐标转换为gl坐标。需要添加到地图获取才有效。(since 5.1.0)
- Returns
- 偏移
◆ getProjectionMatrix
- (float *) getProjectionMatrix |
|
|
|
获取当前地图projection矩阵,数组长度为16,无需外界释放. 需要添加至地图后,才能获取有效矩阵数据,否则返回NULL
- Returns
- 矩阵数组
◆ getViewMatrix
- (float *) getViewMatrix |
|
|
|
获取当前地图view矩阵,数组长度为16,无需外界释放. 需要添加至地图后,才能获取有效矩阵数据,否则返回NULL
- Returns
- 矩阵数组
◆ glPointForMapPoint:
- (CGPoint) glPointForMapPoint: |
|
(MAMapPoint) |
mapPoint |
|
将MAMapPoint转换为opengles可以直接使用的坐标
- Parameters
-
- Returns
- 直接支持的坐标
◆ glPointsForMapPoints:count:
- (CGPoint *) glPointsForMapPoints: |
|
(MAMapPoint *) |
mapPoints |
count: |
|
(NSUInteger) |
count |
|
|
| |
批量将MAMapPoint转换为opengles可以直接使用的坐标
- Parameters
-
mapPoints | MAMapPoint坐标数据指针 |
count | 个数 |
- Returns
- 直接支持的坐标数据指针(需要调用者手动释放)
◆ glRender
◆ glWidthForWindowWidth:
- (CGFloat) glWidthForWindowWidth: |
|
(CGFloat) |
windowWidth |
|
将屏幕尺寸转换为OpenGLES尺寸
- Parameters
-
- Returns
- OpenGLES尺寸
◆ initWithOverlay:
- (instancetype) initWithOverlay: |
|
(id< MAOverlay >) |
overlay |
|
初始化并返回一个Overlay Renderer
- Parameters
-
- Returns
- 初始化成功则返回overlay view,否则返回nil
◆ loadStrokeTextureImage:
- (GLuint) loadStrokeTextureImage: |
|
(UIImage *) |
textureImage |
|
加载纹理图片,纹理ID存储在成员strokeTextureID中。纹理图片为nil时,清空原有纹理
- Parameters
-
textureImage | 纹理图片(需满足:长宽相等,且宽度值为2的次幂)。若为nil,则清空原有纹理 |
- Returns
- openGL纹理ID, 若纹理加载失败返回0
◆ loadTexture:
- (GLuint) loadTexture: |
|
(UIImage *) |
textureImage |
|
加载纹理图片(since 5.1.0)
- Parameters
-
textureImage | 纹理图片(需满足:长宽相等,且宽度值为2的次幂) |
- Returns
- openGL纹理ID, 若纹理加载失败返回0
◆ renderIconWithTextureID:points:
- (void) renderIconWithTextureID: |
|
(GLuint) |
textureID |
points: |
|
(CGPoint *) |
points |
|
|
| |
使用OpenGLES 绘制图片
- Parameters
-
textureID | OpenGLES纹理ID |
points | OpenGLES坐标系点指针,纹理矩形的四个顶点坐标,其第一个坐标为图片左上角,依次顺时针传入其他顶点 ,参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
◆ renderIconWithTextureID:points:modulateColor:
- (void) renderIconWithTextureID: |
|
(GLuint) |
textureID |
points: |
|
(CGPoint *) |
points |
modulateColor: |
|
(UIColor *) |
modulateColor |
|
|
| |
使用OpenGLES 绘制图片
- Parameters
-
textureID | OpenGLES纹理ID |
points | OpenGLES坐标系点指针,纹理矩形的四个顶点坐标,其第一个坐标为图片左上角,依次顺时针传入其他顶点 ,参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
modulateColor | 调节颜色值, 最终颜色 = 纹理色 * modulateColor. 如只需要调节alpha的话就设置为[red=1, green=1, blue=1, alpha=0.5] |
◆ renderLinesWithPoints:pointCount:strokeColor:lineWidth:looped:
- (void) renderLinesWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
strokeColor: |
|
(UIColor *) |
strokeColor |
lineWidth: |
|
(CGFloat) |
lineWidth |
looped: |
|
(BOOL) |
looped |
|
|
| |
使用OpenGLES 绘制线
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
strokeColor | 线颜色 |
lineWidth | OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
looped | 是否闭合, 如polyline会设置NO, polygon会设置YES |
◆ renderLinesWithPoints:pointCount:strokeColor:lineWidth:looped:LineJoinType:LineCapType:lineDash:
- (void) renderLinesWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
strokeColor: |
|
(UIColor *) |
strokeColor |
lineWidth: |
|
(CGFloat) |
lineWidth |
looped: |
|
(BOOL) |
looped |
LineJoinType: |
|
(MALineJoinType) |
lineJoinType |
LineCapType: |
|
(MALineCapType) |
lineCapType |
lineDash: |
|
(MALineDashType) |
lineDash |
|
|
| |
使用OpenGLES 绘制线
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
strokeColor | 线颜色 |
lineWidth | OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
looped | 是否闭合, 如polyline会设置NO, polygon会设置YES |
lineJoinType | 线连接点样式 |
lineCapType | 线端点样式 |
lineDash | 虚线类型 |
◆ renderLinesWithPoints:pointCount:strokeColors:drawStyleIndexes:isGradient:lineWidth:looped:LineJoinType:LineCapType:lineDash:
- (void) renderLinesWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
strokeColors: |
|
(NSArray *) |
strokeColors |
drawStyleIndexes: |
|
(NSArray *) |
drawStyleIndexes |
isGradient: |
|
(BOOL) |
isGradient |
lineWidth: |
|
(CGFloat) |
lineWidth |
looped: |
|
(BOOL) |
looped |
LineJoinType: |
|
(MALineJoinType) |
lineJoinType |
LineCapType: |
|
(MALineCapType) |
lineCapType |
lineDash: |
|
(MALineDashType) |
lineDash |
|
|
| |
使用OpenGLES 绘制多段颜色线
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
strokeColors | 各段指定的颜色 |
drawStyleIndexes | 颜色索引数组,成员为NSNumber,且为非负数,负数按0处理 |
isGradient | 颜色是否渐变 |
lineWidth | 线OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
looped | 是否闭合, 如polyline会设置NO, polygon会设置YES |
lineJoinType | 线连接点样式 |
lineCapType | 线端点样式 |
lineDash | 虚线类型 |
◆ renderRegionWithPoints:pointCount:fillColor:usingTriangleFan:
- (void) renderRegionWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
fillColor: |
|
(UIColor *) |
fillColor |
usingTriangleFan: |
|
(BOOL) |
usingTriangleFan |
|
|
| |
使用OpenGLES 绘制区域
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
fillColor | 填充颜色 |
usingTriangleFan | 若必为凸多边形输入YES,可能为凹多边形输入NO |
◆ renderStrokedRegionWithPoints:pointCount:fillColor:strokeColor:strokeLineWidth:strokeLineJoinType:strokeLineDash:usingTriangleFan:
- (void) renderStrokedRegionWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
fillColor: |
|
(UIColor *) |
fillColor |
strokeColor: |
|
(UIColor *) |
strokeColor |
strokeLineWidth: |
|
(CGFloat) |
strokeLineWidth |
strokeLineJoinType: |
|
(MALineJoinType) |
strokeLineJoinType |
strokeLineDash: |
|
(MALineDashType) |
strokeLineDash |
usingTriangleFan: |
|
(BOOL) |
usingTriangleFan |
|
|
| |
使用OpenGLES 绘制区域(带轮廓线)
注意:strokeLineWidth为0 或 strokeColor为nil 时不绘制轮廓线。
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
fillColor | 填充颜色 |
strokeColor | 轮廓线颜色 |
strokeLineWidth | 轮廓线宽。OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
strokeLineJoinType | 轮廓线连接点样式 |
strokeLineDash | 轮廓虚线类型 |
usingTriangleFan | 若必为凸多边形输入YES,可能为凹多边形输入NO |
◆ renderTexturedLinesWithPoints:pointCount:lineWidth:textureID:looped:
- (void) renderTexturedLinesWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
lineWidth: |
|
(CGFloat) |
lineWidth |
textureID: |
|
(GLuint) |
textureID |
looped: |
|
(BOOL) |
looped |
|
|
| |
使用OpenGLES 按指定纹理绘制线
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
lineWidth | 线OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
textureID | 指定的纹理 |
looped | 是否闭合, 如polyline会设置NO, polygon会设置YES |
◆ renderTexturedLinesWithPoints:pointCount:lineWidth:textureIDs:drawStyleIndexes:looped:
- (void) renderTexturedLinesWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
lineWidth: |
|
(CGFloat) |
lineWidth |
textureIDs: |
|
(NSArray *) |
textureIDs |
drawStyleIndexes: |
|
(NSArray *) |
drawStyleIndexes |
looped: |
|
(BOOL) |
looped |
|
|
| |
使用OpenGLES 绘制多纹理线
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
lineWidth | 线OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
textureIDs | 各段指定的纹理 使用- (BOOL)loadStrokeTextureImages:(NSArray *)textureImages;加载,在strokeTextureIDs属性中获取 |
drawStyleIndexes | 纹理索引数组,成员为NSNumber,且为非负数,负数按0处理 |
looped | 是否闭合, 如polyline会设置NO, polygon会设置YES |
◆ renderTextureStrokedRegionWithPoints:pointCount:fillColor:strokeTineWidth:strokeTextureID:usingTriangleFan:
- (void) renderTextureStrokedRegionWithPoints: |
|
(CGPoint *) |
points |
pointCount: |
|
(NSUInteger) |
pointCount |
fillColor: |
|
(UIColor *) |
fillColor |
strokeTineWidth: |
|
(CGFloat) |
strokeLineWidth |
strokeTextureID: |
|
(GLuint) |
strokeTexture |
usingTriangleFan: |
|
(BOOL) |
usingTriangleFan |
|
|
| |
使用OpenGLES 绘制区域(带纹理轮廓线)
注意:strokeLineWidth为0 或 strokeTexture为0 时不绘制轮廓线。
- Parameters
-
points | OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:mapPoint, - (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count |
pointCount | 点个数 |
fillColor | 填充颜色 |
strokeLineWidth | 轮廓线宽。OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth |
strokeTexture | 轮廓线纹理。使用- (void)loadStrokeTextureImage:textureImage;加载 |
usingTriangleFan | 若必为凸多边形输入YES,可能为凹多边形输入NO |
◆ setNeedsUpdate
当关联overlay对象有更新时,调用此接口刷新. since 5.0.0
◆ _needsLoadStrokeTexture
- (BOOL) _needsLoadStrokeTexture |
|
protected |
◆ _needsUpdate
◆ _strokeTextureID
- (GLuint) _strokeTextureID |
|
protected |
◆ _strokeTextureSize
- (CGSize) _strokeTextureSize |
|
protected |
◆ alpha
透明度[0,1],默认为1. 使用MAOverlayRenderer类提供的渲染接口会自动应用此属性。(since 5.1.0)
◆ contentScale
overlay渲染的scale。(since 5.1.0)
◆ overlay
◆ rendererDelegate
- (id<MAOverlayRenderDelegate>) rendererDelegate |
|
readwritenonatomicweak |
由地图添加时,不要手动设置。如果不是使用mapview进行添加,则需要手动设置。(since 5.1.0)
◆ strokeImage
用于生成笔触纹理id的图片(支持非PowerOfTwo图片; 如果您需要减轻绘制产生的锯齿,您可以参考AMap.bundle中的traffic_texture_blue.png的方式,在image两边增加部分透明像素.)。(since 5.3.0)
◆ strokeTextureID
- (GLuint) strokeTextureID |
|
readnonatomicassign |
笔触纹理id, 修改纹理id参考, 如果strokeImage未指定、尚未加载或加载失败返回0
The documentation for this class was generated from the following file: