MAOverlayRenderer.h.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // MAOverlayRenderer.h
  3. // MAMapKit
  4. //
  5. // Created by AutoNavi.
  6. // Copyright (c) 2013年 Amap. All rights reserved.
  7. //
  8. #import "MAGeometry.h"
  9. #import "MAOverlay.h"
  10. ///该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现
  11. @interface MAOverlayRenderer : NSObject
  12. ///关联的overlay对象
  13. @property (nonatomic, readonly) id <MAOverlay> overlay;
  14. ///overlay的透明度
  15. @property CGFloat alpha;
  16. ///context的比例系数
  17. @property (readonly) CGFloat contentScaleFactor;
  18. /**
  19. * @brief 初始化并返回一个overlay renderer
  20. * @param overlay 关联的overlay对象
  21. * @return 初始化成功则返回overlay renderer,否则返回nil
  22. */
  23. - (id)initWithOverlay:(id <MAOverlay>)overlay;
  24. /**
  25. * @brief 将MAMapPoint转化为相对于receiver的本地坐标
  26. * @param mapPoint 要转化的MAMapPoint
  27. * @return 相对于receiver的本地坐标
  28. */
  29. - (CGPoint)pointForMapPoint:(MAMapPoint)mapPoint;
  30. /**
  31. * @brief 将相对于receiver的本地坐标转化为MAMapPoint
  32. * @param point 要转化的相对于receiver的本地坐标
  33. * @return MAMapPoint
  34. */
  35. - (MAMapPoint)mapPointForPoint:(CGPoint)point;
  36. /**
  37. * @brief 将MAMapRect转化为相对于receiver的本地rect
  38. * @param mapRect 要转化的MAMapRect
  39. * @return 相对于receiver的本地rect
  40. */
  41. - (CGRect)rectForMapRect:(MAMapRect)mapRect;
  42. /**
  43. * @brief 将相对于receiver的本地rect转化为MAMapRect
  44. * @param rect 要转化的相对于receiver的本地rect
  45. * @return MAMapRect
  46. */
  47. - (MAMapRect)mapRectForRect:(CGRect)rect;
  48. /**
  49. * @brief 判断overlay renderer是否可以绘制包含的内容
  50. * @param mapRect 该MAMapRect范围内需要绘制
  51. * @param zoomScale 当前的缩放比例值
  52. * @return 是否可以进行绘制
  53. */
  54. - (BOOL)canDrawMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
  55. /**
  56. * @brief 绘制overlay renderer的内容
  57. * @param mapRect 该MAMapRect范围内需要更新
  58. * @param zoomScale 当前的缩放比例值
  59. * @param context 绘制操作的graphics context
  60. */
  61. - (void)drawMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale inContext:(CGContextRef)context;
  62. /**
  63. * @brief 设置是否需要重新绘制
  64. */
  65. - (void)setNeedsDisplay;
  66. /**
  67. * @brief 重绘指定map rect内的内容
  68. * @param mapRect 该map rect范围内的内容需要重绘
  69. */
  70. - (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect;
  71. /**
  72. * @brief 重绘指定zoom scale下map rect内的内容
  73. * @param mapRect 该map rect范围内的内容需要重绘
  74. * @param zoomScale 当前的缩放比例值
  75. */
  76. - (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
  77. @end