MAOverlayView.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // MAOverlayView.h
  3. // MAMapKitNew
  4. //
  5. // Created by AutoNavi.
  6. // Copyright (c) 2014年 Amap. All rights reserved.
  7. //
  8. #import "MAGeometry.h"
  9. #import "MAOverlay.h"
  10. /*!
  11. @brief 该类是地图覆盖物View的基类, 提供绘制overlay的接口但并无实际的实现
  12. */
  13. @interface MAOverlayView : UIView
  14. /*!
  15. @brief 初始化并返回一个overlay view
  16. @param overlay 关联的overlay对象
  17. @return 初始化成功则返回overlay view,否则返回nil
  18. */
  19. - (id)initWithOverlay:(id <MAOverlay>)overlay;
  20. /*!
  21. @brief 关联的overlay对象
  22. */
  23. @property (nonatomic, readonly) 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 view是否可以绘制包含的内容
  50. @param mapRect 该MAMapRect范围内需要绘制
  51. @param zoomScale 当前的缩放比例值
  52. @return 是否可以进行绘制
  53. */
  54. - (BOOL)canDrawMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
  55. /*!
  56. @brief 绘制overlay view的内容
  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. - (void)setNeedsDisplay;
  63. /*!
  64. @brief 重绘指定map rect内的内容
  65. @param mapRect 该map rect范围内的内容需要重绘
  66. */
  67. - (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect;
  68. /*!
  69. @brief 重绘指定zoom scale下map rect内的内容
  70. @param mapRect 该map rect范围内的内容需要重绘
  71. @param zoomScale 当前的缩放比例值
  72. */
  73. - (void)setNeedsDisplayInMapRect:(MAMapRect)mapRect zoomScale:(MAZoomScale)zoomScale;
  74. /*!
  75. @brief overlay的透明度
  76. */
  77. @property CGFloat alpha;
  78. /*!
  79. @brief context的比例系数
  80. */
  81. @property (readonly) CGFloat contentScaleFactor;
  82. @end