Map Doc  1.0
iOS-引擎SDK-开放平台
MBPoiSearchSession.h
浏览该文件的文档.
1 //
2 // MBPoiSearchSession.h
3 // iNaviCore
4 //
5 // Created by fanyunlong on 5/17/16.
6 // Copyright © 2016 Mapbar. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 
11 #import "MBWmrBaseTypes.h"
12 #import "MBPoiBaseTypes.h"
13 #import "MBNaviCoreBase.h"
14 #import "MBNaviBaseTypes.h"
15 
17 
19 typedef void (^MBPoiSearchSessionBasicBlock)(void);
20 
28 typedef void (^MBPoiSearchSessionErrorBlock)(MBPoiSearchError, NSString * _Nullable);
29 
45 typedef void (^MBPoiSearchSessionDataBlock)(NSArray<__kindof MBPoiItem *> * _Nonnull, NSArray<MBKeywordSuggestionItem *> * _Nonnull, NSArray<MBCityDistributionItem *> * _Nonnull, NSArray<MBCitySuggestionItem *> * _Nonnull, NSArray<MBRegionPoiItem *> * _Nonnull);
46 
48 @interface MBPoiSearchSession : NSObject
49 
51 @property (class, nonatomic, readonly, strong) MBPoiSearchSession * _Nonnull defaultPoiSearchSession;
52 
54 @property (nonatomic, assign) MBDataPreference preference;
55 
57 @property (nonatomic, assign) NSInteger range;
58 
60 @property (nonatomic, assign) MBPoint center;
61 
63 @property (nonatomic, copy) NSString * _Nonnull cityName;
64 
66 @property (nonatomic, readonly, copy) NSString * _Nullable keyword;
67 
69 @property (nonatomic, assign) NSInteger pageSize;
70 
72 @property (nonatomic, assign) BOOL isNearBy;
73 
77 @property (nonatomic, readonly) MBPoiTypeTree * _Nonnull typeTree;
78 
80 @property (nonatomic, assign) NSUInteger maxSearchDistance;
81 
83 @property (nonatomic, assign) NSUInteger maxSearchRadius;
84 
86 - (void)setStartedBlock:(nonnull MBPoiSearchSessionBasicBlock)aStartedBlock;
87 
89 - (void)setEndedBlock:(nonnull MBPoiSearchSessionBasicBlock)aEndBlock;
90 
92 - (void)setFailedBlock:(nonnull MBPoiSearchSessionErrorBlock)aFailedBlock;
93 
95 - (void)setLoadedBlock:(nonnull MBPoiSearchSessionDataBlock)aLoadedBlock;
96 
98 - (void)setCanceledBlock:(nonnull MBPoiSearchSessionBasicBlock)aCancelBlock;
99 
103 - (void)queryByKeyword:(nonnull NSString *)keyword NS_SWIFT_NAME(query(keyword:));
104 
108 - (void)queryEnRouteWithKeyword:(nonnull NSString *)keyword shapePoints:(nonnull NSArray<NSValue *> *)shapePoints NS_SWIFT_NAME(query(keyword:shapePoints:));
109 
111 - (void)cancel;
112 
114 - (BOOL)hasMore;
115 
119 - (void)loadMore;
120 
122 - (void)goBack;
123 
125 - (MBPoiSearchError)querySelect:(MBPoiItemType)type index:(NSInteger)index;
126 
129 - (BOOL)setAdminCode:(MBAdminCode)code;
130 
133 - (void)setOnlySearchInCurrentRegion:(BOOL)forced;
134 
137 - (void)setChildrenPoiSearchDepth:(int)depth;
138 
140 - (int)enrouteSearchWidth;
141 - (void)setEnrouteSearchWidth:(int)radius;
143 - (void)enableEnrouteSearchCompensation:(BOOL)comp;
146 
149 - (void)enforceSortingByDistance:(BOOL)isSorted;
153 
155 - (int)currentPageNumber;
156 
158 - (void)clearResult;
159 
161 @property (nonatomic, copy) NSString * _Nonnull urlBase;
162 
164 @property (nonatomic, copy) NSString * _Nonnull urlBaseForPoiServer;
165 @end
MBAdminCode adminCode()
设置行政区编码(可选)和cityname 可以二选一
新搜索(PoiSearchSession)的搜索结果城市建议实体类
Definition: MBCitySuggestionItem.h:21
void clearResult()
清空结果
MBPoiSearchError queryEnroute()
NSString *_Nonnull urlBase
搜索服务器地址
Definition: MBPoiSearchSession.h:161
新搜索业务模块类
Definition: MBPoiSearchSession.h:48
MBPoiSearchError sortByDefault()
void(^ MBPoiSearchSessionDataBlock)(NSArray< __kindof MBPoiItem *> *_Nonnull, NSArray< MBKeywordSuggestionItem *> *_Nonnull, NSArray< MBCityDistributionItem *> *_Nonnull, NSArray< MBCitySuggestionItem *> *_Nonnull, NSArray< MBRegionPoiItem *> *_Nonnull)
Definition: MBPoiSearchSession.h:45
NSString *_Nonnull cityName
关键词搜索的搜索中心点城市(必须设置)
Definition: MBPoiSearchSession.h:63
BOOL sortingByDistanceEnforced()
搜索前设置,搜索结果是否按照距离排序
void goBack()
回退到上一次的搜索结果(?)
MBPoiSearchError sortByDistance()
搜索后设置,对搜索得到的结果进行排序
MBPoiSearchError loadMoreEnroute()
int childrenPoiSearchDepth()
子POI深度
NSInteger range
关键词搜索的搜索距离范围(在线搜索默认3公里,离线搜索默认10公里)
Definition: MBPoiSearchSession.h:57
BOOL isNearBy
关键词搜索是否周边搜
Definition: MBPoiSearchSession.h:72
新搜索(PoiSearchSession)的搜索结果 Poi 实体类
Definition: MBPoiItem.h:20
void cancel()
取消搜索请求
NSUInteger maxSearchRadius
沿路搜的路线周边范围(在线搜索默认3公里,离线搜索默认10公里)
Definition: MBPoiSearchSession.h:83
MBPoiTypeTree *_Nonnull typeTree
Definition: MBPoiSearchSession.h:77
新搜索(PoiSearchSession)的搜索结果城市分布实体类
Definition: MBCityDistributionItem.h:12
BOOL enrouteSearchCompensationEnabled()
BOOL onlySearchInCurrentRegion()
只在当前区域内搜索,没有跳转,特殊需求
NSString *_Nullable keyword
获取当前搜索关键词
Definition: MBPoiSearchSession.h:66
int enrouteSearchWidth()
沿路搜相关
Definition: MBPoiTypeTree.h:14
MBDataPreference
Definition: MBNaviBaseTypes.h:288
NSString *_Nonnull urlBaseForPoiServer
搜索 " Poi 服务器" 地址(?)
Definition: MBPoiSearchSession.h:164
MBPoint center
关键词搜索的搜索中心点坐标(必须设置)
Definition: MBPoiSearchSession.h:60
MBPoiSearchError
新搜索(PoiSearchSession)的错误返回代码
Definition: MBPoiBaseTypes.h:23
void(^ MBPoiSearchSessionBasicBlock)(void)
无结果的搜索返回block类型
Definition: MBPoiSearchSession.h:19
Definition: MBKeywordSuggestionItem.h:11
NSInteger pageSize
搜索结果分页大小(默认为10,最大值为15)
Definition: MBPoiSearchSession.h:69
BOOL hasMore()
是否可继续翻页
unsigned int MBAdminCode
Definition: MBWmrBaseTypes.h:18
MBPoiSearchSession *_Nonnull defaultPoiSearchSession
唯一实例
Definition: MBPoiSearchSession.h:51
新搜索(PoiSearchSession)的搜索结果行政区划实体类
Definition: MBRegionPoiItem.h:26
Definition: MBNaviCoreBase.h:31
MBDataPreference preference
搜索模式(在线/离线/在线优先/离线优先)
Definition: MBPoiSearchSession.h:54
int currentPageNumber()
当前的页
MBPoiItemType
新搜索(PoiSearchSession)的返回结果类型
Definition: MBPoiBaseTypes.h:47
void(^ MBPoiSearchSessionErrorBlock)(MBPoiSearchError, NSString *_Nullable)
Definition: MBPoiSearchSession.h:28
NSUInteger maxSearchDistance
沿路搜的总距离范围(在线搜索默认3公里,离线搜索默认10公里)
Definition: MBPoiSearchSession.h:80