|
TencentMapSDK_iOS_3D_v1.3.3
|
该类是地图覆盖物View的基类, 提供了绘制overlay的接口, 但是没有实际实现。希望不要直接实例化,通常通过子类重写[drawMapRect:zoomScale:inContext:]来绘制内容 更多...
#import <QOverlayView.h>
构造函数 | |
| (id) | - initWithOverlay: |
| 初始化并返回一个overlayView 更多... | |
| (CGPoint) | - pointForMapPoint: |
| 将QMapPoint转化为相对于overlayView的坐标 更多... | |
| (CGPoint) | - pointForMapPoint:modifyDeviationTransform: |
| 将QMapPoint转化为相对于overlayView的坐标,*trans为了弥补32位运行环境下从coordinate转换成double再转换成CGPoint造成的精度丢失, 如果没有误差那么返回的trans为CGAffineTransformIdentity 更多... | |
| (QMapPoint) | - mapPointForPoint: |
| 将相对于overlayView的本地坐标转化为QMapPoint坐标 更多... | |
| (CGRect) | - rectForMapRect: |
| 将QMapRect转化为相对于overlayView的rect 更多... | |
| (QMapRect) | - mapRectForRect: |
| 将相对于overlayView的rect转化为QMapRect 更多... | |
| (BOOL) | - canDrawMapRect:zoomScale: |
| 判断overlayView是否可以绘制包含的内容 更多... | |
| (void) | - drawMapRect:zoomScale:inContext: |
| 绘制overlayView的内容 更多... | |
属性 | |
| id< QOverlay > | overlay |
| 关联的overlay对象 | |
该类是地图覆盖物View的基类, 提供了绘制overlay的接口, 但是没有实际实现。希望不要直接实例化,通常通过子类重写[drawMapRect:zoomScale:inContext:]来绘制内容
| - (BOOL) canDrawMapRect: | (QMapRect) | mapRect | |
| zoomScale: | (QZoomScale) | zoomScale | |
判断overlayView是否可以绘制包含的内容
| mapRect | 该QMapRect范围内需要绘制 |
| zoomScale | 当前的缩放比例值 |
| - (void) drawMapRect: | (QMapRect) | mapRect | |
| zoomScale: | (CGFloat) | zoomScale | |
| inContext: | (CGContextRef) | context | |
绘制overlayView的内容
| mapRect | 该QMapRect范围内需要更新 |
| zoomScale | 当前的缩放比例值 |
| context | 绘制操作的graphics context |
| - (id) initWithOverlay: | (id< QOverlay >) | overlay |
初始化并返回一个overlayView
| overlay | 关联的overlay对象 |
| - (QMapPoint) mapPointForPoint: | (CGPoint) | point |
将相对于overlayView的本地坐标转化为QMapPoint坐标
| point | 要转化的overlayView点坐标 |
| - (QMapRect) mapRectForRect: | (CGRect) | rect |
将相对于overlayView的rect转化为QMapRect
| rect | 要转化的overlayView上的rect |
| - (CGPoint) pointForMapPoint: | (QMapPoint) | mapPoint |
将QMapPoint转化为相对于overlayView的坐标
| mapPoint | 要转化的mapPoint |
| - (CGPoint) pointForMapPoint: | (QMapPoint) | mapPoint | |
| modifyDeviationTransform: | (CGAffineTransform *) | transform | |
将QMapPoint转化为相对于overlayView的坐标,*trans为了弥补32位运行环境下从coordinate转换成double再转换成CGPoint造成的精度丢失, 如果没有误差那么返回的trans为CGAffineTransformIdentity
| mapPoint | 要转化的mapPoint |
| transform对返回值的补充,可以用于对转换精度误差进行补偿 | |
| description | 用户只有在需要重载createPath的时候才会用到这个函数,比方说需要画线的时候利用该函数获取某个mapPoint所对应的point,以及获取的修正误差用的trans,然后使用CGPathMoveToPoint(thePath, &transform, point.x, point.y);来改变CGPath的起点。CGPathAddLineToPoint(thePath, &transform, point.x, point.y);来绘制。总之传入的trans可以修正CGPoint的精度不足所造成的标注抖动问题。如果您只是使用现有的QPolygonView或者QPolylineView则不需要考虑这些问题,因为系统已经为您封装好了相关问题的处理。调用该接口的时候,请不要给trans传NULL,如果你不需要考虑精度问题可以直接使用- (CGPoint)pointFromMapPoint:(QMapPoint)mapPoint |
| - (CGRect) rectForMapRect: | (QMapRect) | mapRect |
将QMapRect转化为相对于overlayView的rect
| mapRect | 要转化的mapRect |