BMKDistrictSearch.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // BMKDistrictSearch.h
  3. // SearchComponent
  4. //
  5. // Created by wzy on 15/12/14.
  6. // Copyright © 2015年 baidu. All rights reserved.
  7. //
  8. #ifndef BMKDistrictSearch_h
  9. #define BMKDistrictSearch_h
  10. #import <BaiduMapAPI_Base/BMKTypes.h>
  11. #import "BMKSearchBase.h"
  12. /// 行政区域检索信息
  13. @interface BMKDistrictSearchOption : NSObject
  14. /// 城市名字(必须)
  15. @property (nonatomic, strong) NSString *city;
  16. /// 区县名字(可选)
  17. @property (nonatomic, strong) NSString *district;
  18. @end
  19. #pragma mark -
  20. /// 行政区域检索结果
  21. @interface BMKDistrictResult : NSObject
  22. /// 行政区域编码
  23. @property (nonatomic, assign) NSInteger code;
  24. /// 行政区域名称
  25. @property (nonatomic, strong) NSString *name;
  26. /// 行政区域中心点
  27. @property (nonatomic, assign) CLLocationCoordinate2D center;
  28. /// 行政区边界直角地理坐标点数据(NSString数组,字符串数据格式为: @"x,y;x,y")
  29. @property (nonatomic, strong) NSArray *paths;
  30. @end
  31. #pragma mark -
  32. @protocol BMKDistrictSearchDelegate;
  33. /// 行政区域搜索服务
  34. @interface BMKDistrictSearch : BMKSearchBase
  35. /// 检索模块的delegate,此处记得不用的时候需要置nil,否则影响内存的释放
  36. @property (nonatomic, weak) id<BMKDistrictSearchDelegate> delegate;
  37. /**
  38. *行政区域检索
  39. *异步函数,返回结果在BMKDistrictSearchDelegate的onGetDistrictResult通知
  40. *@param DistrictSearchOption 公交线路检索信息类
  41. *@return 成功返回YES,否则返回NO
  42. */
  43. - (BOOL)districtSearch:(BMKDistrictSearchOption*)districtSearchOption;
  44. @end
  45. #pragma mark -
  46. ///搜索delegate,用于获取行政区域搜索结果
  47. @protocol BMKDistrictSearchDelegate<NSObject>
  48. @optional
  49. /**
  50. *返回行政区域搜索结果
  51. *@param searcher 搜索对象
  52. *@param result 搜索结BMKDistrictSearch果
  53. *@param error 错误号,@see BMKSearchErrorCode
  54. */
  55. - (void)onGetDistrictResult:(BMKDistrictSearch *)searcher result:(BMKDistrictResult *)result errorCode:(BMKSearchErrorCode)error;
  56. @end
  57. #endif /* BMKDistrictSearch_h */