BaiduMap_IOSSDK_v4.2.1_Docs
BMKTypes.h
1 //
2 // BMKType.h
3 // MapPlatform
4 //
5 // Created by BaiduMapAPI on 13-3-26.
6 // Copyright (c) 2013年 baidu. All rights reserved.
7 //
8 
9 #import <CoreGraphics/CoreGraphics.h>
10 #import <CoreLocation/CoreLocation.h>
11 #import <UIKit/UIKit.h>
12 
13 #ifndef BMKType_h
14 #define BMKType_h
15 //地图模块枚举
16 typedef enum {
17  BMKMapModuleTile = 0, //瓦片图模块
18 } BMKMapModule;
19 
20 
28 typedef NS_ENUM(NSUInteger, BMK_COORD_TYPE) {
29  BMK_COORDTYPE_GPS = 0,
30  BMK_COORDTYPE_COMMON,
31  BMK_COORDTYPE_BD09LL,
32 };
33 
41 typedef NS_ENUM(NSUInteger, BMKMapType) {
42  BMKMapTypeNone = 0,
43  BMKMapTypeStandard = 1,
44  BMKMapTypeSatellite = 2,
45 };
46 
47 
48 typedef enum {
49  BMKErrorOk = 0,
50  BMKErrorConnect = 2,
51  BMKErrorData = 3,
52  BMKErrorRouteAddr = 4,
53  BMKErrorResultNotFound = 100,
54  BMKErrorLocationFailed = 200,
55  BMKErrorPermissionCheckFailure = 300,
56  BMKErrorParse = 310
57 }BMKErrorCode;
58 //鉴权结果状态码
59 typedef enum {
60  E_PERMISSIONCHECK_CONNECT_ERROR = -300,//链接服务器错误
61  E_PERMISSIONCHECK_DATA_ERROR = -200,//服务返回数据异常
62  E_PERMISSIONCHECK_OK = 0, // 授权验证通过
63  E_PERMISSIONCHECK_KEY_ERROR = 101, //ak不存在
64  E_PERMISSIONCHECK_MCODE_ERROR = 102, //mcode签名值不正确
65  E_PERMISSIONCHECK_UID_KEY_ERROR = 200, // APP不存在,AK有误请检查再重试
66  E_PERMISSIONCHECK_KEY_FORBIDEN = 201, // APP被用户自己禁用,请在控制台解禁
67  E_PERMISSIONCHECK_KEY_DENY_BY_SERVER = 202, // APP被服务端管理员删除
68  E_PERMISSIONCHECK_USER_DENY_BY_SERVER = 252, // 用户被服务端管理员删除
69  /*
70  *更多鉴权状态码请参考:
71  *http://lbsyun.baidu.com/index.php?title=webapi/appendix
72  */
73 }BMKPermissionCheckResultCode;
74 
75 //检索结果状态码
76 typedef enum{
77  BMK_SEARCH_NO_ERROR = 0,
78  BMK_SEARCH_AMBIGUOUS_KEYWORD,
79  BMK_SEARCH_AMBIGUOUS_ROURE_ADDR,
80  BMK_SEARCH_NOT_SUPPORT_BUS,
81  BMK_SEARCH_NOT_SUPPORT_BUS_2CITY,
82  BMK_SEARCH_RESULT_NOT_FOUND,
83  BMK_SEARCH_ST_EN_TOO_NEAR,
84  BMK_SEARCH_KEY_ERROR,
85  BMK_SEARCH_NETWOKR_ERROR,
86  BMK_SEARCH_NETWOKR_TIMEOUT,
87  BMK_SEARCH_PERMISSION_UNFINISHED,
88  BMK_SEARCH_INDOOR_ID_ERROR,
89  BMK_SEARCH_FLOOR_ERROR,
90  BMK_SEARCH_INDOOR_ROUTE_NO_IN_BUILDING,
91  BMK_SEARCH_INDOOR_ROUTE_NO_IN_SAME_BUILDING,
92  BMK_SEARCH_PARAMETER_ERROR,
93  BMK_SEARCH_SERVER_ERROR,//服务器错误
94 }BMKSearchErrorCode;
95 
96 //调起百度地图结果状态码
97 typedef enum{
98  BMK_OPEN_NO_ERROR = 0,
99  BMK_OPEN_WEB_MAP,
100  BMK_OPEN_OPTION_NULL,
101  BMK_OPEN_NOT_SUPPORT,
102  BMK_OPEN_POI_DETAIL_UID_NULL,
103  BMK_OPEN_POI_NEARBY_KEYWORD_NULL,
104  BMK_OPEN_ROUTE_START_ERROR,
105  BMK_OPEN_ROUTE_END_ERROR,
106  BMK_OPEN_PANORAMA_UID_ERROR,
107  BMK_OPEN_PANORAMA_ABSENT,
108  BMK_OPEN_PERMISSION_UNFINISHED,
109  BMK_OPEN_KEY_ERROR,
110  BMK_OPEN_NETWOKR_ERROR,
111 }BMKOpenErrorCode;
112 
114 typedef struct {
115  CLLocationDegrees latitudeDelta;
116  CLLocationDegrees longitudeDelta;
118 
126 UIKIT_STATIC_INLINE BMKCoordinateSpan BMKCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) {
127  BMKCoordinateSpan span;
128  span.latitudeDelta = latitudeDelta;
129  span.longitudeDelta = longitudeDelta;
130  return span;
131 }
132 
134 typedef struct {
135  CLLocationCoordinate2D northEast;
136  CLLocationCoordinate2D southWest;
138 
139 
141 typedef struct {
142  CLLocationCoordinate2D center;
145 
152 UIKIT_STATIC_INLINE BMKCoordinateRegion BMKCoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, BMKCoordinateSpan span) {
153  BMKCoordinateRegion region;
154  region.center = centerCoordinate;
155  region.span = span;
156  return region;
157 }
158 
160 typedef struct {
163 } BMKGeoPoint;
164 
166 typedef struct {
167  double x;
168  double y;
169 } BMKMapPoint;
170 
178 UIKIT_STATIC_INLINE BMKMapPoint BMKMapPointMake(double x, double y) {
179  return (BMKMapPoint){x, y};
180 }
181 
183 typedef struct {
184  double width;
185  double height;
186 } BMKMapSize;
187 
195 UIKIT_STATIC_INLINE BMKMapSize BMKMapSizeMake(double width, double height) {
196  return (BMKMapSize){width, height};
197 }
198 
200 typedef struct {
201  BMKMapPoint origin;
203 } BMKMapRect;
204 
214 UIKIT_STATIC_INLINE BMKMapRect BMKMapRectMake(double x, double y, double width, double height) {
215  return (BMKMapRect){ BMKMapPointMake(x, y), BMKMapSizeMake(width, height)};
216 }
217 
224 UIKIT_STATIC_INLINE BOOL BMKMapRectIsNull(BMKMapRect rect) {
225  return isinf(rect.origin.x) || isinf(rect.origin.y);
226 }
227 
228 
234 UIKIT_STATIC_INLINE double BMKMapRectGetMinX(BMKMapRect rect) {
235  return rect.origin.x;
236 }
237 
243 UIKIT_STATIC_INLINE double BMKMapRectGetMinY(BMKMapRect rect) {
244  return rect.origin.y;
245 }
246 
252 UIKIT_STATIC_INLINE double BMKMapRectGetMidX(BMKMapRect rect) {
253  return rect.origin.x + rect.size.width / 2.0;
254 }
255 
261 UIKIT_STATIC_INLINE double BMKMapRectGetMidY(BMKMapRect rect) {
262  return rect.origin.y + rect.size.height / 2.0;
263 }
264 
270 UIKIT_STATIC_INLINE double BMKMapRectGetMaxX(BMKMapRect rect) {
271  return rect.origin.x + rect.size.width;
272 }
273 
279 UIKIT_STATIC_INLINE double BMKMapRectGetMaxY(BMKMapRect rect) {
280  return rect.origin.y + rect.size.height;
281 }
282 
284 typedef CGFloat BMKZoomScale;
285 
287 UIKIT_EXTERN const BMKMapSize BMKMapSizeWorld;
289 UIKIT_EXTERN const BMKMapRect BMKMapRectWorld;
291 UIKIT_EXTERN const BMKMapRect BMKMapRectNull;
292 
294 @interface BMKPlanNode : NSObject{
295  NSString* _cityName;
296  NSString* _name;
297  CLLocationCoordinate2D _pt;
298 }
299 
301 @property (nonatomic, strong) NSString* cityName;
303 @property (nonatomic, assign) NSInteger cityID;
305 @property (nonatomic, strong) NSString* name;
307 @property (nonatomic) CLLocationCoordinate2D pt;
308 @end
309 
311 @interface BMKIndoorPlanNode : NSObject
313 @property (nonatomic, retain) NSString* floor;
315 @property (nonatomic) CLLocationCoordinate2D pt;
316 @end
317 
318 
320 @interface BMKAddressComponent : NSObject
321 // 国家
322 @property (nonatomic, copy) NSString *country;
323 // 省份名称
324 @property (nonatomic, copy) NSString *province;
325 // 城市名称
326 @property (nonatomic, copy) NSString *city;
327 // 区县名称
328 @property (nonatomic, copy) NSString *district;
329 // 乡镇
330 @property (nonatomic, copy) NSString *town;
331 // 街道名称
332 @property (nonatomic, copy) NSString *streetName;
333 // 街道号码
334 @property (nonatomic, copy) NSString *streetNumber;
336 @property (nonatomic, copy) NSString *adCode;
338 @property (nonatomic, copy) NSString *countryCode;
339 // 相对当前坐标点的方向,当有门牌号的时候返回数据
340 @property (nonatomic, copy) NSString *direction;
341 // 相对当前坐标点的距离,当有门牌号的时候返回数据
342 @property (nonatomic, copy) NSString *distance;
343 @end
344 
345 #endif
double y
横坐标
Definition: BMKTypes.h:168
BMKCoordinateSpan span
中心点经纬度坐标
Definition: BMKTypes.h:143
矩形大小,用直角地理坐标表示
Definition: BMKTypes.h:183
CLLocationCoordinate2D pt
节点坐标
Definition: BMKTypes.h:315
线路检索节点信息,一个路线检索节点可以通过经纬度坐标或城市名加地名确定
Definition: BMKTypes.h:294
表示一个经纬度坐标点
Definition: BMKTypes.h:160
矩形,用直角地理坐标表示
Definition: BMKTypes.h:200
表示一个经纬度区域
Definition: BMKTypes.h:134
NSString * floor
节点所在楼层
Definition: BMKTypes.h:313
室内路线检索节点信息
Definition: BMKTypes.h:311
CLLocationDegrees longitudeDelta
纬度范围
Definition: BMKTypes.h:116
double height
宽度
Definition: BMKTypes.h:185
此类表示地址结果的层次化信息
Definition: BMKTypes.h:320
BMKMapSize size
屏幕左上点对应的直角地理坐标
Definition: BMKTypes.h:202
int longitudeE6
经度,乘以1e6之后的值
Definition: BMKTypes.h:162
int latitudeE6
纬度,乘以1e6之后的值
Definition: BMKTypes.h:161
表示一个经纬度范围
Definition: BMKTypes.h:114
CLLocationCoordinate2D southWest
东北角点经纬度坐标
Definition: BMKTypes.h:136
表示一个经纬度区域
Definition: BMKTypes.h:141
地理坐标点,用直角地理坐标表示
Definition: BMKTypes.h:166