立得地图iOS SDK 地图&搜索服务参考手册 V1.7.0
构造函数 | 属性 | 所有成员列表
LMKOverlayView类 参考

该类是地图覆盖物View的基类, 提供绘制overlay的接口但并无实际的实现 更多...

#import <LMKOverlayView.h>

类 LMKOverlayView 继承关系图:
LMKOverlayPathView LMKArcView LMKCircleView LMKMultiColoredPolylineView LMKMultiTexturePolylineView LMKPolygonView LMKPolylineView

构造函数

(id)  - initWithOverlay:
  初始化并返回一个overlay view 更多...
 
(CGPoint)  - pointForMapPoint:
  将LMKMapPoint转化为相对于receiver的本地坐标 更多...
 
(LMKMapPoint - mapPointForPoint:
  将相对于receiver的本地坐标转化为LMKMapPoint 更多...
 
(CGRect)  - rectForMapRect:
  将LMKMapRect转化为相对于receiver的本地rect 更多...
 
(LMKMapRect - mapRectForRect:
  将相对于receiver的本地rect转化为LMKMapRect 更多...
 
(void)  - drawMapRect:zoomScale:inContext:
  绘制overlay view的内容 更多...
 
(int *)  - g20PointsForMapPoints:count:
  批量将LMKMapPoint转换为opengles可以直接使用的坐标 更多...
 
(CGFloat)  - glWidthForWindowWidth:
  将屏幕尺寸转换为OpenGLES尺寸 更多...
 
(void)  - referenceDidChange
  OpenGLES坐标系发生改变, 重新计算缓存的OpenGLES坐标 更多...
 
(void)  - renderRegionWithPoints:pointCount:fillColor:usingTriangleFan:
  使用OpenGLES 绘制区域 更多...
 
(void)  - renderIconWithTextureID:points:
  使用OpenGLES 绘制图片 更多...
 
(void)  - renderLinesWithPoints:pointCount:strokeColor:lineWidth:looped:
  使用OpenGLES 绘制线 更多...
 
(void)  - renderLinesWithPoints:pointCount:strokeColor:lineWidth:looped:LineJoinType:LineCapType:lineDash:
 
(void)  - renderLinesWithPoints:pointCount:strokeColor:lineWidth:lineTextureID:texLen:looped:complex:
 
(void)  - renderLinesWithPoints:pointCount:strokeColor:lineWidth:looped:lineDash:complex:
 
(void)  - glRender
  绘制函数(子类需要重载来实现) 更多...
 
(GLuint)  - loadStrokeTextureImage:
 

属性

id< LMKOverlay overlay
  关联的overlay对象 更多...
 
int *  g20MapPoints
  缓存的G20坐标 更多...
 
NSUInteger  g20MapPointCount
  缓存的G20坐标 个数 更多...
 
GLuint  strokeTextureID
  笔触纹理id 修改纹理id参考 - (GLuint)loadStrokeTextureImage:textureImage; 更多...
 

详细描述

该类是地图覆盖物View的基类, 提供绘制overlay的接口但并无实际的实现

函数文档

- (void) drawMapRect: (LMKMapRect mapRect
zoomScale: (CGFloat)  zoomScale
inContext: (CGContextRef)  context 

绘制overlay view的内容

参数
mapRect 该LMKMapRect范围内需要更新
zoomScale 当前的缩放比例值
context 绘制操作的graphics context
- (int*) g20PointsForMapPoints: (LMKMapPoint *)  mapPoints
count: (NSUInteger)  count 

批量将LMKMapPoint转换为opengles可以直接使用的坐标

参数
mapPoints LMKMapPoint坐标数据指针
count 个数
返回
opengles 直接支持的坐标数据指针(需要调用者手动释放)
- (void) glRender

绘制函数(子类需要重载来实现)

- (CGFloat) glWidthForWindowWidth: (CGFloat)  windowWidth

将屏幕尺寸转换为OpenGLES尺寸

参数
windowWidth 屏幕尺寸
返回
OpenGLES尺寸
- (id) initWithOverlay: (id< LMKOverlay >)  overlay

初始化并返回一个overlay view

参数
overlay 关联的overlay对象
返回
初始化成功则返回overlay view,否则返回nil
- (GLuint) loadStrokeTextureImage: (UIImage *)  textureImage

加载纹理图片,纹理ID存储在成员strokeTextureID中。纹理图片为nil时,清空原有纹理。

参数
textureImage 纹理图片(需满足:长宽相等,且宽度值为2的次幂)。若为nil,则清空原有纹理。
返回
openGL纹理ID, 若纹理加载失败返回0。
- (LMKMapPoint) mapPointForPoint: (CGPoint)  point

将相对于receiver的本地坐标转化为LMKMapPoint

参数
point 要转化的相对于receiver的本地坐标
返回
LMKMapPoint
- (LMKMapRect) mapRectForRect: (CGRect)  rect

将相对于receiver的本地rect转化为LMKMapRect

参数
rect 要转化的相对于receiver的本地rect
返回
LMKMapRect
- (CGPoint) pointForMapPoint: (LMKMapPoint mapPoint

将LMKMapPoint转化为相对于receiver的本地坐标

参数
mapPoint 要转化的LMKMapPoint
返回
相对于receiver的本地坐标
- (CGRect) rectForMapRect: (LMKMapRect mapRect

将LMKMapRect转化为相对于receiver的本地rect

参数
mapRect 要转化的LMKMapRect
返回
相对于receiver的本地rect
- (void) referenceDidChange

OpenGLES坐标系发生改变, 重新计算缓存的OpenGLES坐标

- (void) renderIconWithTextureID: (GLuint)  textureID
points: (int *)  points 

使用OpenGLES 绘制图片

参数
textureID OpenGLES纹理ID
points OpenGLES坐标系点指针,纹理矩形的四个顶点坐标,其第一个坐标为图片左上角,依次顺时针传入其他顶点 ,参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count ,
- (void) renderLinesWithPoints: (int *)  points
pointCount: (NSUInteger)  pointCount
strokeColor: (UIColor *)  strokeColor
lineWidth: (CGFloat)  lineWidth
lineTextureID: (GLint)  lineTextureID
texLen: (CGFloat)  texLen
looped: (BOOL)  looped
complex: (BOOL)  complex 

使用OpenGLES 绘制线

参数
points OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count
pointCount 点个数
strokeColor 线颜色
lineWidth OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth
lineTextureID OpenGLES纹理ID
texLen 纹理长度
looped 是否闭合, 如polyline会设置NO, polygon会设置YES.
complex 是否是复杂纹理
- (void) renderLinesWithPoints: (int *)  points
pointCount: (NSUInteger)  pointCount
strokeColor: (UIColor *)  strokeColor
lineWidth: (CGFloat)  lineWidth
looped: (BOOL)  looped 

使用OpenGLES 绘制线

参数
points OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count
pointCount 点个数
strokeColor 线颜色
lineWidth OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth
looped 是否闭合, 如polyline会设置NO, polygon会设置YES.
- (void) renderLinesWithPoints: (int *)  points
pointCount: (NSUInteger)  pointCount
strokeColor: (UIColor *)  strokeColor
lineWidth: (CGFloat)  lineWidth
looped: (BOOL)  looped
lineDash: (BOOL)  lineDash
complex: (BOOL)  complex 

使用OpenGLES 绘制线

参数
points OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count
pointCount 点个数
strokeColor 线颜色
lineWidth OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth
looped 是否闭合, 如polyline会设置NO, polygon会设置YES.
lineDash 是否是虚线
complex 是否是复杂纹理
- (void) renderLinesWithPoints: (int *)  points
pointCount: (NSUInteger)  pointCount
strokeColor: (UIColor *)  strokeColor
lineWidth: (CGFloat)  lineWidth
looped: (BOOL)  looped
LineJoinType: (LMKLineJoinType lineJoinType
LineCapType: (LMKLineCapType lineCapType
lineDash: (BOOL)  lineDash 

使用OpenGLES 绘制线

参数
points OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count
pointCount 点个数
strokeColor 线颜色
lineWidth OpenGLES支持线宽尺寸, 参考 - (CGFloat)glWidthForWindowWidth:windowWidth
looped 是否闭合, 如polyline会设置NO, polygon会设置YES.
lineJoinType 线连接点样式
lineCapType 线端点样式
lineDash 是否是虚线
- (void) renderRegionWithPoints: (int *)  points
pointCount: (NSUInteger)  pointCount
fillColor: (UIColor *)  fillColor
usingTriangleFan: (BOOL)  usingTriangleFan 

使用OpenGLES 绘制区域

参数
points OpenGLES坐标系点指针, 参考- (CGPoint)glPointForMapPoint:(LMKMapPoint)mapPoint, - (CGPoint *)glPointsForMapPoints:(LMKMapPoint *)mapPoints count:(NSUInteger)count
pointCount 点个数
fillColor 填充颜色
usingTriangleFan 若必为凸多边形输入YES,可能为凹多边形输入NO

属性说明

- (NSUInteger) g20MapPointCount
readwritenonatomicassign

缓存的G20坐标 个数

- (int*) g20MapPoints
readwritenonatomicassign

缓存的G20坐标

- (id<LMKOverlay>) overlay
readnonatomicstrong

关联的overlay对象

- (GLuint) strokeTextureID
readnonatomicassign

笔触纹理id 修改纹理id参考 - (GLuint)loadStrokeTextureImage:textureImage;


该类的文档由以下文件生成: