MAMapView.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. //
  2. // MAMapView.h
  3. // MAMapKit
  4. //
  5. // Created by AutoNavi.
  6. // Copyright (c) 2013年 AutoNavi. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "MAGeometry.h"
  10. #import "MAOverlay.h"
  11. #import "MAOverlayRenderer.h"
  12. #import "MAAnnotationView.h"
  13. #import "MAOverlayView.h"
  14. typedef NS_ENUM(NSInteger, MAMapLanguage)
  15. {
  16. MAMapLanguageZhCN = 0,
  17. MAMapLanguageEn = 1,
  18. };
  19. typedef NS_ENUM(NSInteger, MAMapType)
  20. {
  21. MAMapTypeStandard, // 普通地图
  22. MAMapTypeSatellite // 卫星地图
  23. };
  24. typedef NS_ENUM(NSInteger, MAUserTrackingMode)
  25. {
  26. MAUserTrackingModeNone = 0, // 不追踪用户的location更新
  27. MAUserTrackingModeFollow = 1, // 追踪用户的location更新
  28. MAUserTrackingModeFollowWithHeading = 2 // 追踪用户的location与heading更新
  29. };
  30. @protocol MAMapViewDelegate;
  31. @class MAUserLocation;
  32. @class MAAnnotationView;
  33. @class MAUserLocationRepresentation;
  34. @interface MAMapView : UIView
  35. #pragma mark - Properties
  36. /*!
  37. @brief 地图View的Delegate
  38. */
  39. @property (nonatomic, assign) id<MAMapViewDelegate> delegate;
  40. /*!
  41. @brief 地图类型
  42. */
  43. @property (nonatomic, assign) MAMapType mapType;
  44. /*!
  45. @brief 地图语言
  46. */
  47. @property (nonatomic, assign) MAMapLanguage language;
  48. /*!
  49. @brief 是否显示交通,默认为NO
  50. */
  51. @property (nonatomic, assign, getter = isShowTraffic) BOOL showTraffic;
  52. /*!
  53. @brief 是否支持平移,默认为YES
  54. */
  55. @property (nonatomic, assign, getter = isScrollEnabled) BOOL scrollEnabled;
  56. /*!
  57. @brief 是否支持缩放,默认为YES
  58. */
  59. @property (nonatomic, assign, getter = isZoomEnabled) BOOL zoomEnabled;
  60. /*!
  61. @brief 清除所有磁盘上缓存的地图数据。
  62. */
  63. - (void)clearDisk;
  64. #pragma mark - Logo
  65. /*!
  66. @brief logo位置, 必须在mapView.bounds之内,否则会被忽略
  67. */
  68. @property (nonatomic) CGPoint logoCenter;
  69. /*!
  70. @brief logo的宽高
  71. */
  72. @property (nonatomic, readonly) CGSize logoSize;
  73. #pragma mark - Compass
  74. /*!
  75. @brief 是否显示罗盘,默认为YES
  76. */
  77. @property (nonatomic, assign) BOOL showsCompass;
  78. /*!
  79. @brief 罗盘原点位置
  80. */
  81. @property (nonatomic) CGPoint compassOrigin;
  82. /*!
  83. @brief 罗盘的宽高
  84. */
  85. @property (nonatomic, readonly) CGSize compassSize;
  86. /**
  87. * 设置罗盘的图像
  88. *
  89. * @param image 当设置图像非空时,指南针将呈现该图像,如果为nil时,则恢复默认。
  90. */
  91. - (void)setCompassImage:(UIImage *)image;
  92. #pragma mark - Scale
  93. /*!
  94. @brief 是否显示比例尺,默认为YES
  95. */
  96. @property (nonatomic) BOOL showsScale;
  97. /*!
  98. @brief 比例尺原点位置
  99. */
  100. @property (nonatomic) CGPoint scaleOrigin;
  101. /*!
  102. @brief 比例尺的最大宽高
  103. */
  104. @property (nonatomic, readonly) CGSize scaleSize;
  105. /*!
  106. @brief 在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米).
  107. @return 对应的距离(单位是米)
  108. */
  109. - (CGFloat)metersPerPointForCurrentZoomLevel;
  110. /*!
  111. @brief 在指定的缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米).
  112. @param zoomLevel 指定的缩放级别, 在[minZoomLevel, maxZoomLevel]范围内.
  113. @return 对应的距离(单位是米)
  114. */
  115. - (CGFloat)metersPerPointForZoomLevel:(CGFloat)zoomLevel;
  116. #pragma mark - Movement
  117. /*!
  118. @brief 当前地图的中心点经纬度坐标,改变该值时,地图缩放级别不会发生变化
  119. */
  120. @property (nonatomic, assign) CLLocationCoordinate2D centerCoordinate;
  121. /*!
  122. @brief 设定地图中心点经纬度
  123. @param coordinate 要设定的地图中心点经纬度
  124. @param animated 是否采用动画效果
  125. */
  126. - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate animated:(BOOL)animated;
  127. /*!
  128. @brief 当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围
  129. */
  130. @property (nonatomic, assign) MACoordinateRegion region;
  131. /*!
  132. @brief 设定当前地图的region
  133. @param region 要设定的地图范围,用经纬度的方式表示
  134. @param animated 是否采用动画效果
  135. */
  136. - (void)setRegion:(MACoordinateRegion)region animated:(BOOL)animated;
  137. /*!
  138. @brief 根据当前地图视图frame的大小调整region范围,返回适合当前地图frame的region,调整过程中当前地图的中心点不会改变
  139. @param region 要调整的经纬度范围
  140. @return 调整后的经纬度范围
  141. */
  142. - (MACoordinateRegion)regionThatFits:(MACoordinateRegion)region;
  143. /*!
  144. @brief 当前地图可见范围的map rect
  145. */
  146. @property (nonatomic, assign) MAMapRect visibleMapRect;
  147. /*!
  148. @brief 设置当前地图可见范围的map rect
  149. @param mapRect 要调整的map rect
  150. @param animated 是否采用动画效果
  151. */
  152. - (void)setVisibleMapRect:(MAMapRect)mapRect animated:(BOOL)animated;
  153. /*!
  154. @brief 设置当前地图可见范围的map rect
  155. @param mapRect 要设置的map rect
  156. @param insets 嵌入边界
  157. @param animated 是否采用动画效果
  158. */
  159. - (void)setVisibleMapRect:(MAMapRect)mapRect edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
  160. /*!
  161. @brief 调整map rect使其适合地图窗口显示的范围
  162. @param mapRect 要调整的map rect
  163. @return 调整后的maprect
  164. */
  165. - (MAMapRect)mapRectThatFits:(MAMapRect)mapRect;
  166. /*!
  167. @brief 调整map rect使其适合地图窗口显示的范围
  168. @param mapRect 要调整的map rect
  169. @param insets 嵌入边界
  170. @return 调整后的map rect
  171. */
  172. - (MAMapRect)mapRectThatFits:(MAMapRect)mapRect edgePadding:(UIEdgeInsets)insets;
  173. #pragma mark - Zoom
  174. /*!
  175. @brief 缩放级别
  176. */
  177. @property (nonatomic, assign) double zoomLevel;
  178. /*!
  179. @brief 最小缩放级别
  180. */
  181. @property (nonatomic, readonly) double minZoomLevel;
  182. /*!
  183. @brief 最大缩放级别
  184. */
  185. @property (nonatomic, readonly) double maxZoomLevel;
  186. /*!
  187. @brief 设置当前地图的缩放级别zoom level
  188. @param zoomLevel 要设置的zoom level
  189. @param animated 是否采用动画效果
  190. */
  191. - (void)setZoomLevel:(double)newZoomLevel animated:(BOOL)animated;
  192. /*!
  193. @brief 设置当前地图的缩放级别zoom level
  194. @param zoomLevel 要设置的zoom level
  195. @param pivot 指定缩放的锚点,屏幕坐标
  196. @param animated 是否采用动画效果
  197. */
  198. - (void)setZoomLevel:(double)newZoomLevel atPivot:(CGPoint)pivot animated:(BOOL)animated;
  199. #pragma mark - Conversions
  200. /*!
  201. @brief 将经纬度坐标转化为相对于指定view的坐标
  202. @param coordinate 要转化的经纬度坐标
  203. @param view 指定的坐标系统的view
  204. */
  205. - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view;
  206. /*!
  207. @brief 将相对于view的坐标转化为经纬度坐标
  208. @param point 要转化的坐标
  209. @param view point所基于的view
  210. return 转化后的经纬度坐标
  211. */
  212. - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view;
  213. /*!
  214. @brief 将map rect 转化为相对于view的坐标
  215. @param region 要转化的 map rect
  216. @param view 返回值所基于的view
  217. return 基于view的坐标
  218. */
  219. - (CGRect)convertRegion:(MACoordinateRegion)region toRectToView:(UIView *)view;
  220. /*!
  221. @brief 将相对于view的rectangle转化为region
  222. @param rect 要转化的rectangle
  223. @param view rectangle所基于的view
  224. return 转化后的region
  225. */
  226. - (MACoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view;
  227. #pragma mark - UserLocation
  228. /*!
  229. @brief 是否显示用户位置
  230. */
  231. @property (nonatomic, assign, getter = isShowsUserLocation) BOOL showsUserLocation;
  232. /*!
  233. @brief 当前的位置数据
  234. */
  235. @property (nonatomic, readonly) MAUserLocation *userLocation;
  236. /*!
  237. @brief 定位用户位置的模式
  238. */
  239. @property (nonatomic) MAUserTrackingMode userTrackingMode;
  240. /*!
  241. @brief 设置追踪用户位置的模式
  242. @param mode 要使用的模式
  243. @param animated 是否采用动画效果
  244. */
  245. - (void)setUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated;
  246. /*!
  247. @brief 当前位置再地图中是否可见
  248. */
  249. @property (nonatomic, readonly, getter=isUserLocationVisible) BOOL userLocationVisible;
  250. /*!
  251. @brief 设定UserLocationView样式。如果用户自定义了userlocation的annotationView,或者该annotationView还未添加到地图上,此方法将不起作用。
  252. @param representation 样式信息对象
  253. */
  254. - (void)updateUserLocationRepresentation:(MAUserLocationRepresentation *)representation;
  255. #pragma mark - Annotations
  256. /*!
  257. @brief 标注数组
  258. */
  259. @property (nonatomic, readonly) NSArray *annotations;
  260. /*!
  261. @brief 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
  262. @param annotation 要添加的标注
  263. */
  264. - (void)addAnnotation:(id <MAAnnotation>)annotation;
  265. /*!
  266. @brief 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
  267. @param annotations 要添加的标注数组
  268. */
  269. - (void)addAnnotations:(NSArray *)annotations;
  270. /*!
  271. @brief 移除标注
  272. @param annotation 要移除的标注
  273. */
  274. - (void)removeAnnotation:(id <MAAnnotation>)annotation;
  275. /*!
  276. @brief 移除一组标注
  277. @param annotation 要移除的标注数组
  278. */
  279. - (void)removeAnnotations:(NSArray *)annotations;
  280. /*!
  281. @brief 根据标注数据过去标注view
  282. @param annotation 标注数据
  283. @return 对应的标注view
  284. */
  285. - (MAAnnotationView *)viewForAnnotation:(id <MAAnnotation>)annotation;
  286. /*!
  287. @brief 从复用内存池中获取制定复用标识的annotation view
  288. @param identifier 复用标识
  289. @return annotation view
  290. */
  291. - (MAAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:(NSString *)identifier;
  292. /*!
  293. @brief 处于选中状态的标注数据数据(其count == 0 或 1)
  294. */
  295. @property (nonatomic, copy) NSArray *selectedAnnotations;
  296. /*!
  297. @brief 选中标注数据对应的view
  298. @param annotation 标注数据
  299. @param animated 是否有动画效果
  300. */
  301. - (void)selectAnnotation:(id <MAAnnotation>)annotation animated:(BOOL)animated;
  302. /*!
  303. @brief 取消选中标注数据对应的view
  304. @param annotation 标注数据
  305. @param animated 是否有动画效果
  306. */
  307. - (void)deselectAnnotation:(id <MAAnnotation>)annotation animated:(BOOL)animated;
  308. /*!
  309. @brief annotation 可见区域
  310. */
  311. @property (nonatomic, readonly) CGRect annotationVisibleRect;
  312. /*!
  313. @brief 获取指定投影矩形范围内的标注
  314. @param mapRect 投影矩形范围
  315. @return 标注集合
  316. */
  317. - (NSSet *)annotationsInMapRect:(MAMapRect)mapRect;
  318. /*!
  319. 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
  320. @param annotations 需要显示的annotation
  321. @param animated 是否执行动画
  322. */
  323. - (void)showAnnotations:(NSArray *)annotations animated:(BOOL)animated;
  324. /**
  325. * 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
  326. *
  327. * @param annotations 需要显示的annotation
  328. * @param insets insets 嵌入边界
  329. * @param animated 是否执行动画
  330. */
  331. - (void)showAnnotations:(NSArray *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
  332. #pragma mark - Overlays
  333. /*!
  334. @brief Overlay数组
  335. */
  336. @property (nonatomic, readonly) NSArray *overlays;
  337. /*!
  338. @brief 查找指定overlay对应的Renderer,如果该Renderer尚未创建,返回nil
  339. @param overlay 指定的overlay
  340. @return 指定overlay对应的Renderer
  341. */
  342. - (MAOverlayRenderer *)rendererForOverlay:(id <MAOverlay>)overlay;
  343. /*!
  344. @brief 查找指定overlay对应的View,如果该View尚未创建,返回nil
  345. @param overlay 指定的overlay
  346. @return 指定overlay对应的View
  347. */
  348. - (MAOverlayView *)viewForOverlay:(id <MAOverlay>)overlay __attribute__ ((deprecated("use - (MAOverlayRenderer *)rendererForOverlay:(id <MAOverlay>)overlay instead")));
  349. /*!
  350. @brief 向地图窗口添加Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
  351. @param overlay 要添加的overlay
  352. */
  353. - (void)addOverlay:(id <MAOverlay>)overlay;
  354. /*!
  355. @brief 向地图窗口添加一组Overlay,需要实现BMKMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
  356. @param overlays 要添加的overlay数组
  357. */
  358. - (void)addOverlays:(NSArray *)overlays;
  359. /*!
  360. @brief 移除Overlay
  361. @param overlay 要移除的overlay
  362. */
  363. - (void)removeOverlay:(id <MAOverlay>)overlay;
  364. /*!
  365. @brief 移除一组Overlay
  366. @param overlays 要移除的overlay数组
  367. */
  368. - (void)removeOverlays:(NSArray *)overlays;
  369. /*!
  370. @brief 在指定的索引处添加一个Overlay
  371. @param overlay 要添加的overlay
  372. @param index 指定的索引
  373. */
  374. - (void)insertOverlay:(id <MAOverlay>)overlay atIndex:(NSUInteger)index;
  375. /*!
  376. @brief 在交换指定索引处的Overlay
  377. @param index1 索引1
  378. @param index2 索引2
  379. */
  380. - (void)exchangeOverlayAtIndex:(NSUInteger)index1 withOverlayAtIndex:(NSUInteger)index2;
  381. /*!
  382. @brief 在指定的Overlay之上插入一个overlay
  383. @param overlay 带添加的Overlay
  384. @param sibling 用于指定相对位置的Overlay
  385. */
  386. - (void)insertOverlay:(id <MAOverlay>)overlay aboveOverlay:(id <MAOverlay>)sibling;
  387. /*!
  388. @brief 在指定的Overlay之下插入一个overlay
  389. @param overlay 带添加的Overlay
  390. @param sibling 用于指定相对位置的Overlay
  391. */
  392. - (void)insertOverlay:(id <MAOverlay>)overlay belowOverlay:(id <MAOverlay>)sibling;
  393. @end
  394. #pragma mark - Snapshots
  395. /*!
  396. @brief 地图view关于截图的类别
  397. */
  398. @interface MAMapView (Snapshot)
  399. /*!
  400. @brief 在指定区域内截图(默认会包含该区域内的annotationView)
  401. @param rect 指定的区域
  402. @return 截图image
  403. */
  404. - (UIImage *)takeSnapshotInRect:(CGRect)rect;
  405. /*!
  406. @brief 获得地图当前可视区域截图
  407. @param rect 指定截图区域
  408. @param block 回调block
  409. */
  410. - (void)takeSnapshotInRect:(CGRect)rect withCompletionBlock:(void (^)(UIImage *resultImage, CGRect rect))block;
  411. @end
  412. #pragma mark - LocationOption
  413. /*!
  414. @brief 定位相关参数的类别
  415. */
  416. @interface MAMapView (LocationOption)
  417. /*!
  418. @brief 设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动。
  419. */
  420. @property (nonatomic) CLLocationDistance distanceFilter;
  421. /*!
  422. @brief 设定定位精度。默认为kCLLocationAccuracyBest。
  423. */
  424. @property (nonatomic) CLLocationAccuracy desiredAccuracy;
  425. /*!
  426. @brief 设定最小更新角度。默认为1度,设定为kCLHeadingFilterNone会提示任何角度改变。
  427. */
  428. @property (nonatomic) CLLocationDegrees headingFilter;
  429. /**
  430. * 指定定位是否会被系统自动暂停。默认为YES。只在iOS 6.0之后起作用。
  431. */
  432. @property (nonatomic) BOOL pausesLocationUpdatesAutomatically;
  433. /**
  434. * 是否允许后台定位。默认为NO。只在iOS 9.0之后起作用。
  435. * 设置为YES的时候必须保证 Background Modes 中的 Location updates处于选中状态,否则会抛出异常。
  436. */
  437. @property (nonatomic) BOOL allowsBackgroundLocationUpdates;
  438. @end
  439. #pragma mark - MAMapViewDelegate
  440. /*!
  441. @brief 地图view的delegate
  442. */
  443. @protocol MAMapViewDelegate <NSObject>
  444. @optional
  445. /*!
  446. @brief 地图区域即将改变时会调用此接口
  447. @param mapview 地图View
  448. @param animated 是否动画
  449. */
  450. - (void)mapView:(MAMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
  451. /*!
  452. @brief 地图区域改变完成后会调用此接口
  453. @param mapview 地图View
  454. @param animated 是否动画
  455. */
  456. - (void)mapView:(MAMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
  457. /**
  458. * 单击地图底图调用此接口
  459. *
  460. * @param mapView 地图View
  461. * @param coordinate 点击位置经纬度
  462. */
  463. - (void)mapView:(MAMapView *)mapView didSingleTappedAtCoordinate:(CLLocationCoordinate2D)coordinate;
  464. /**
  465. * 长按地图底图调用此接口
  466. *
  467. * @param mapView 地图View
  468. * @param coordinate 长按位置经纬度
  469. */
  470. - (void)mapView:(MAMapView *)mapView didLongPressedAtCoordinate:(CLLocationCoordinate2D)coordinate;
  471. /*!
  472. @brief 根据anntation生成对应的View
  473. @param mapView 地图View
  474. @param annotation 指定的标注
  475. @return 生成的标注View
  476. */
  477. - (MAAnnotationView*)mapView:(MAMapView *)mapView viewForAnnotation:(id <MAAnnotation>)annotation;
  478. /*!
  479. @brief 当mapView新添加annotation views时调用此接口
  480. @param mapView 地图View
  481. @param views 新添加的annotation views
  482. */
  483. - (void)mapView:(MAMapView *)mapView didAddAnnotationViews:(NSArray *)views;
  484. /*!
  485. @brief 当选中一个annotation views时调用此接口
  486. @param mapView 地图View
  487. @param views 选中的annotation views
  488. */
  489. - (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view;
  490. /*!
  491. @brief 当取消选中一个annotation views时调用此接口
  492. @param mapView 地图View
  493. @param views 取消选中的annotation views
  494. */
  495. - (void)mapView:(MAMapView *)mapView didDeselectAnnotationView:(MAAnnotationView *)view;
  496. /*!
  497. @brief 标注view的accessory view(必须继承自UIControl)被点击时调用此接口
  498. @param mapView 地图View
  499. @param annotationView callout所属的标注view
  500. @param control 对应的control
  501. */
  502. - (void)mapView:(MAMapView *)mapView annotationView:(MAAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;
  503. /**
  504. * 标注view的calloutview整体点击时调用此接口
  505. *
  506. * @param mapView 地图的view
  507. * @param view calloutView所属的annotationView
  508. */
  509. - (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view;
  510. /*!
  511. @brief 在地图View将要启动定位时调用此接口
  512. @param mapView 地图View
  513. */
  514. - (void)mapViewWillStartLocatingUser:(MAMapView *)mapView;
  515. /*!
  516. @brief 在地图View停止定位后调用此接口
  517. @param mapView 地图View
  518. */
  519. - (void)mapViewDidStopLocatingUser:(MAMapView *)mapView;
  520. /*!
  521. @brief 位置或者设备方向更新后调用此接口, 这个回调已废弃, 由 -(void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation 来替代
  522. @param mapView 地图View
  523. @param userLocation 用户定位信息(包括位置与设备方向等数据)
  524. */
  525. - (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation __attribute__ ((deprecated("use -(void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation instead")));
  526. /*!
  527. @brief 位置或者设备方向更新后调用此接口
  528. @param mapView 地图View
  529. @param userLocation 用户定位信息(包括位置与设备方向等数据)
  530. @param updatingLocation 标示是否是location数据更新, YES:location数据更新 NO:heading数据更新
  531. */
  532. - (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation;
  533. /*!
  534. @brief 定位失败后调用此接口
  535. @param mapView 地图View
  536. @param error 错误号,参考CLError.h中定义的错误号
  537. */
  538. - (void)mapView:(MAMapView *)mapView didFailToLocateUserWithError:(NSError *)error;
  539. /*!
  540. @brief 当userTrackingMode改变时调用此接口
  541. @param mapView 地图View
  542. @param mode 改变后的mode
  543. @param animated 动画
  544. */
  545. - (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated;
  546. /*!
  547. @brief 拖动annotation view时view的状态变化,ios3.2以后支持
  548. @param mapView 地图View
  549. @param view annotation view
  550. @param newState 新状态
  551. @param oldState 旧状态
  552. */
  553. - (void)mapView:(MAMapView *)mapView annotationView:(MAAnnotationView *)view didChangeDragState:(MAAnnotationViewDragState)newState fromOldState:(MAAnnotationViewDragState)oldState;
  554. /*!
  555. @brief 根据overlay生成对应的Renderer
  556. @param mapView 地图View
  557. @param overlay 指定的overlay
  558. @return 生成的覆盖物Renderer
  559. */
  560. - (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay;
  561. /*!
  562. @brief 根据overlay生成对应的View
  563. @param mapView 地图View
  564. @param overlay 指定的overlay
  565. @return 生成的覆盖物View
  566. */
  567. - (MAOverlayView *)mapView:(MAMapView *)mapView viewForOverlay:(id <MAOverlay>)overlay __attribute__ ((deprecated("use - (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay instead")));
  568. /*!
  569. @brief 当mapView新添加overlay renderer时调用此接口
  570. @param mapView 地图View
  571. @param renderers 新添加的overlay renderers
  572. */
  573. - (void)mapView:(MAMapView *)mapView didAddOverlayRenderers:(NSArray *)renderers;
  574. /*!
  575. @brief 当mapView新添加overlay views时调用此接口
  576. @param mapView 地图View
  577. @param overlayViews 新添加的overlay views
  578. */
  579. - (void)mapView:(MAMapView *)mapView didAddOverlayViews:(NSArray *)overlayViews __attribute__ ((deprecated("use - (void)mapView:(MAMapView *)mapView didAddOverlayRenderers:(NSArray *)renderers instead")));
  580. @end