iOS高德地图SDK(3D) V11.2.0001

Instance Methods | Protected Attributes | Properties | List of all members
MAOverlayRenderer Class Reference

`#import <MAOverlayRenderer.h>`

Inheritance diagram for MAOverlayRenderer:

## Instance Methods
(GLuint strokeTextureID) | - __attribute
(instancetype) | - initWithOverlay:
| 初始化并返回一个Overlay Renderer initialize and return an Overlay Renderer More...
(float *) | - getViewMatrix
| 获取当前地图view矩阵，数组长度为16，无需外界释放. 需要添加至地图后，才能获取有效矩阵数据，否则返回NULL Get the current map view matrix with an array length of 16, no external release required. Valid matrix data can only be obtained after adding to the map, otherwise returns NULL. More...
(float *) | - getProjectionMatrix
| 获取当前地图projection矩阵，数组长度为16，无需外界释放. 需要添加至地图后，才能获取有效矩阵数据，否则返回NULL Get the current map projection matrix with an array length of 16, no need for external release. Valid matrix data can only be obtained after adding it to the map, otherwise returns NULL. More...
(MAMapPoint) | - getOffsetPoint
| 获取当前地图中心点偏移，用以把地图坐标转换为gl坐标。需要添加到地图获取才有效。（since 5.1.0） Get the current map center offset to convert map coordinates to gl coordinates. It only takes effect when added to map acquisition （since 5.1.0） More...
(id< MTLRenderCommandEncoder >) | - getCommandEncoder
| 获取Metal渲染MTLRenderCommandEncoder对象。注意：打开地图MetalEnable时有效，否则为nil（since 7.9.0） Obtain the Metal rendering MTLRenderCommandEncoder object. Note: It is valid when MetalEnable is turned on for the map, otherwise it is nil.（since 7.9.0） More...
(CGFloat) | - getMapZoomLevel
| 获取当前地图缩放级别，需要添加到地图获取才有效。（since 5.1.0） Get the current map zoom level, which is only valid when added to the map（since 5.1.0） More...
(CGPoint) | - glPointForMapPoint:
| 将MAMapPoint转换为opengles可以直接使用的坐标 Convert MAMapPoint to coordinates that can be directly used by OpenGLES More...
(CGPoint *) | - glPointsForMapPoints:count:
| 批量将MAMapPoint转换为opengles可以直接使用的坐标 Batch convert MAMapPoint to coordinates that can be directly used by opengles More...
(CGFloat) | - glWidthForWindowWidth:
| 将屏幕尺寸转换为OpenGLES尺寸 Convert screen size to OpenGLES size More...
(void) | - glRender
| 绘制函数(子类需要重载来实现) Drawing function (subclasses need to override to implement) More...
(GLuint) | - loadTexture:
| 加载纹理图片. 注意：仅使用gles环境（since 5.1.0） Load texture image. Note: Only use gles environment （since 5.1.0） More...
(void) | - deleteTexture:
| 删除纹理. 注意：仅使用gles环境（since 5.1.0） Delete texture. Note: Only use in GLES environment（since 5.1.0） More...
(void) | - setNeedsUpdate
| 当关联overlay对象有更新时，调用此接口刷新. since 5.0.0 Call this interface to refresh when the associated overlay object is updated. since 5.0.0 More...

## Protected Attributes
GLuint | _strokeTextureID
CGSize | _strokeTextureSize
BOOL | _needsUpdate
BOOL | _needsLoadStrokeTexture

## Properties
id< MAOverlayRenderDelegate > | rendererDelegate
id< MAOverlay > | overlay
UIImage * | strokeImage
CGFloat | alpha
CGFloat | contentScale

## Detailed Description

该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现（render相关方法只能在重写后的glRender方法中使用） This class is the base class of the map overlay Renderer, providing an interface for drawing overlays but without actual implementation (render-related methods can only be used in the overridden glRender method)

## Method Documentation

## ◆ __attribute

- (GLuint strokeTextureID) __attribute |  | ((deprecated("Deprecated, since 7.9.0"))) |  |

笔触纹理id, 修改纹理id参考, 如果strokeImage未指定、尚未加载或加载失败返回0. 注意：仅使用gles环境 Stroke texture ID, modify texture ID reference, returns 0 if strokeImage is not specified, not yet loaded, or fails to load. Note: Only use gles environment.

## ◆ deleteTexture:

- (void) deleteTexture: |  | ((deprecated("Deprecated, since 7.9.0"))) | __attribute |

删除纹理. 注意：仅使用gles环境（since 5.1.0） Delete texture. Note: Only use in GLES environment（since 5.1.0）

Parameters

  textureId | 纹理ID Texture ID

## ◆ getCommandEncoder

- (id<MTLRenderCommandEncoder>) getCommandEncoder |  |  |

获取Metal渲染MTLRenderCommandEncoder对象。注意：打开地图MetalEnable时有效，否则为nil（since 7.9.0） Obtain the Metal rendering MTLRenderCommandEncoder object. Note: It is valid when MetalEnable is turned on for the map, otherwise it is nil.（since 7.9.0）

Returns
  偏移 offset

## ◆ getMapZoomLevel

- (CGFloat) getMapZoomLevel |  |  |

获取当前地图缩放级别，需要添加到地图获取才有效。（since 5.1.0） Get the current map zoom level, which is only valid when added to the map（since 5.1.0）

Returns
  缩放级别 Zoom level

## ◆ getOffsetPoint

- (MAMapPoint) getOffsetPoint |  |  |

获取当前地图中心点偏移，用以把地图坐标转换为gl坐标。需要添加到地图获取才有效。（since 5.1.0） Get the current map center offset to convert map coordinates to gl coordinates. It only takes effect when added to map acquisition （since 5.1.0）

Returns
  偏移 offset

## ◆ getProjectionMatrix

- (float *) getProjectionMatrix |  |  |

获取当前地图projection矩阵，数组长度为16，无需外界释放. 需要添加至地图后，才能获取有效矩阵数据，否则返回NULL Get the current map projection matrix with an array length of 16, no need for external release. Valid matrix data can only be obtained after adding it to the map, otherwise returns NULL.

Returns
  矩阵数组 matrix array

## ◆ getViewMatrix

- (float *) getViewMatrix |  |  |

获取当前地图view矩阵，数组长度为16，无需外界释放. 需要添加至地图后，才能获取有效矩阵数据，否则返回NULL Get the current map view matrix with an array length of 16, no external release required. Valid matrix data can only be obtained after adding to the map, otherwise returns NULL.

Returns
  矩阵数组 matrix array

## ◆ glPointForMapPoint:

- (CGPoint) glPointForMapPoint: |  | (MAMapPoint) | mapPoint |

将MAMapPoint转换为opengles可以直接使用的坐标 Convert MAMapPoint to coordinates that can be directly used by OpenGLES

Parameters

  mapPoint | MAMapPoint坐标 MAMapPoint coordinates

Returns
  直接支持的坐标 Directly supported coordinates

## ◆ glPointsForMapPoints:count:

- (CGPoint *) glPointsForMapPoints: |  | (MAMapPoint *) | mapPoints
count: |  | (NSUInteger) | count

批量将MAMapPoint转换为opengles可以直接使用的坐标 Batch convert MAMapPoint to coordinates that can be directly used by opengles

Parameters

  mapPoints | MAMapPoint坐标数据指针 MAMapPoint coordinate data pointer
  count | 个数 count

Returns
  直接支持的坐标数据指针(需要调用者手动释放) Directly supported coordinate data pointer (requires manual release by the caller)

## ◆ glRender

- (void) glRender |  |  |

绘制函数(子类需要重载来实现) Drawing function (subclasses need to override to implement)

## ◆ glWidthForWindowWidth:

- (CGFloat) glWidthForWindowWidth: |  | (CGFloat) | windowWidth |

将屏幕尺寸转换为OpenGLES尺寸 Convert screen size to OpenGLES size

Parameters

  windowWidth | 屏幕尺寸 Screen size

Returns
  OpenGLES尺寸 OpenGLES size

## ◆ initWithOverlay:

- (instancetype) initWithOverlay: |  | (id< MAOverlay >) | overlay |

初始化并返回一个Overlay Renderer initialize and return an Overlay Renderer

Parameters

  overlay | 关联的overlay对象 associated overlay object

Returns
  初始化成功则返回overlay view,否则返回nil return the overlay view if initialization is successful, otherwise return nil

## ◆ loadTexture:

- (GLuint) loadTexture: |  | ((deprecated("Deprecated, since 7.9.0"))) | __attribute |

加载纹理图片. 注意：仅使用gles环境（since 5.1.0） Load texture image. Note: Only use gles environment （since 5.1.0）

Parameters

  textureImage | 纹理图片（需满足：长宽相等，且宽度值为2的次幂) Texture image (must meet: width and height are equal, and width value is a power of 2)

Returns
  openGL纹理ID, 若纹理加载失败返回0 openGL texture ID, if texture loading fails, return 0

## ◆ setNeedsUpdate

- (void) setNeedsUpdate |  |  |

当关联overlay对象有更新时，调用此接口刷新. since 5.0.0 Call this interface to refresh when the associated overlay object is updated. since 5.0.0

## Member Data Documentation

## ◆ _needsLoadStrokeTexture

- (BOOL) _needsLoadStrokeTexture
| protected

## ◆ _needsUpdate

- (BOOL) _needsUpdate
| protected

## ◆ _strokeTextureID

- (GLuint) _strokeTextureID
| protected

## ◆ _strokeTextureSize

- (CGSize) _strokeTextureSize
| protected

## Property Documentation

## ◆ alpha

- (CGFloat) alpha
| read write nonatomic assign

透明度[0，1]，默认为1. 使用MAOverlayRenderer类提供的渲染接口会自动应用此属性。（since 5.1.0） Opacity [0, 1], default is 1. This property will be automatically applied when using the rendering interface provided by the MAOverlayRenderer class. (since 5.1.0)

## ◆ contentScale

- (CGFloat) contentScale
| read nonatomic assign

overlay渲染的scale。（since 5.1.0） Scale of overlay rendering.（since 5.1.0）

## ◆ overlay

- (id<MAOverlay>) overlay
| read nonatomic retain

关联的overlay对象 Associated overlay object

## ◆ rendererDelegate

- (id<MAOverlayRenderDelegate>) rendererDelegate
| read write nonatomic weak

由地图添加时，不要手动设置。如果不是使用mapview进行添加，则需要手动设置。（since 5.1.0） When added by the map, do not set manually. If not added using mapview, manual setting is required.（since 5.1.0）

## ◆ strokeImage

- (UIImage*) strokeImage
| read write nonatomic strong

用于生成笔触纹理id的图片（支持非PowerOfTwo图片; 如果您需要减轻绘制产生的锯齿,您可以参考AMap.bundle中的traffic_texture_blue.png的方式,在image两边增加部分透明像素.)。（since 5.3.0） Images used to generate brush stroke texture IDs (supports non-PowerOfTwo images; if you need to reduce aliasing caused by drawing, you can refer to the method in AMap.bundle's traffic_texture_blue.png, adding partially transparent pixels on both sides of the image.). （since 5.3.0）

The documentation for this class was generated from the following file:

- MAOverlayRenderer.h

© 2017 高德信息技术有限公司 版权所有，保留所有权利。