单军华
2017-07-12 20d1260d26b028897f3c0935c12fc35aa37b2e93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 *  BMKCloudSearch.h
 *  BMapKit
 *
 *  Copyright 2013 Baidu Inc. All rights reserved.
 *
 */
 
#import <Foundation/Foundation.h>
#import "BMKCloudSearchInfo.h"
#import "BMKCloudPOIList.h"
 
@protocol BMKCloudSearchDelegate;
/// 云检索类型
typedef enum
{
    BMK_NONE_SEARCH                 = 0,
    BMK_CLOUD_LOCAL_SEARCH          = 1,///<本地云检索
    BMK_CLOUD_NEARBY_SEARCH         = 2,///<周边云检索
    BMK_CLOUD_BOUND_SEARCH          = 3,///<区域云检索
    BMK_CLOUD_DETAIL_SEARCH         = 4,///<POI详情
    BMK_CLOUD_RGC_SEARCH            = 5///<云RGC检索
}BMKCloudSearchType;
 
//云检索结果状态码
typedef enum{
    BMK_CLOUD_PERMISSION_UNFINISHED = -4,///<还未完成鉴权,请在鉴权通过后重试
    BMK_CLOUD_NETWOKR_ERROR = -3,///<网络连接错误
    BMK_CLOUD_NETWOKR_TIMEOUT = -2,///<网络连接超时
    BMK_CLOUD_RESULT_NOT_FOUND = -1,///<没有找到检索结果
    BMK_CLOUD_NO_ERROR = 0,///<检索结果正常返回
    BMK_CLOUD_SERVER_ERROR = 1,///<云检索服务器内部错误
    BMK_CLOUD_PARAM_ERROR = 2,///<输入参数有误(geoTableId或者其它参数有误)
    /*
     *更多云检索状态码请参考:
     *http://developer.baidu.com/map/index.php?title=lbscloud/api/appendix
     */
}BMKCloudErrorCode;
 
///云检索服务
@interface BMKCloudSearch : NSObject
/// 检索模块的Delegate,此处记得不用的时候需要置nil,否则影响内存的释放
@property (nonatomic, weak) id<BMKCloudSearchDelegate> delegate;
/**
 *本地云检索
 *异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
 *@param searchInfo 搜索参数
 *@return 成功返回YES,否则返回NO
 */
- (BOOL)localSearchWithSearchInfo:(BMKCloudLocalSearchInfo *)searchInfo;
/**
 *周边云检索
 *异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
 *@param searchInfo 搜索参数
 *@return 成功返回YES,否则返回NO
 */
- (BOOL)nearbySearchWithSearchInfo:(BMKCloudNearbySearchInfo *)searchInfo;
/**
 *矩形云检索
 *异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
 *@param searchInfo 搜索参数
 *@return 成功返回YES,否则返回NO
 */
- (BOOL)boundSearchWithSearchInfo:(BMKCloudBoundSearchInfo *)searchInfo;
 
/**
 *详情云检索
 *异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiDetailResult通知
 *@param searchInfo 搜索参数
 *@return 成功返回YES,否则返回NO
 */
- (BOOL)detailSearchWithSearchInfo:(BMKCloudDetailSearchInfo *)searchInfo;
 
/**
 *云RGC检索:根据地理坐标获取地址信息
 *异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudReverseGeoCodeResult通知
 *@param searchInfo 云RGC检索信息类
 *@return 成功返回YES,否则返回NO
 */
- (BOOL)cloudReverseGeoCodeSearch:(BMKCloudReverseGeoCodeSearchInfo*)searchInfo;
 
@end
 
///云检索delegate,用于获取云检索结果
@protocol BMKCloudSearchDelegate<NSObject>
@optional
/**
 *返回云检索POI列表结果
 *@param poiResultList 云检索结果列表,成员类型为BMKCloudPOIList
 *@param type 返回结果类型: BMK_CLOUD_LOCAL_SEARCH,BMK_CLOUD_NEARBY_SEARCH,BMK_CLOUD_BOUND_SEARCH
 *@param error 错误号,@see BMKCloudErrorCode
 */
- (void)onGetCloudPoiResult:(NSArray*)poiResultList searchType:(int)type errorCode:(int)error;
 
/**
 *返回云检索POI详情
 *@param poiDetailResult 类型为BMKCloudPOIInfo
 *@param type 返回结果类型: BMK_CLOUD_DETAIL_SEARCH
 *@param error 错误号,@see BMKCloudErrorCode
 */
- (void)onGetCloudPoiDetailResult:(BMKCloudPOIInfo*)poiDetailResult searchType:(int)type errorCode:(int)error;
 
/**
 *返回云RGC检索结果
 *@param cloudRGCResult 搜索结果
 *@param type 返回结果类型: BMK_CLOUD_RGC_SEARCH
 *@param error 错误号,@see BMKCloudErrorCode
 */
- (void)onGetCloudReverseGeoCodeResult:(BMKCloudReverseGeoCodeResult*)cloudRGCResult searchType:(BMKCloudSearchType) type errorCode:(NSInteger) errorCode;
 
@end