BaiduMap_IOSSDK_v5.4.0_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 //天气服务类型枚举
21 typedef enum {
22  BMKWeatherServerTypeDefault = 0, // 国内
23  BMKLanguageServerTypeAbroad // 海外
24 } BMKWeatherServerType;
25 
26 //语言类型枚举
27 typedef enum {
28  BMKLanguageTypeChinese = 0, // 中文
29  BMKLanguageTypeEnglish
30 } BMKLanguageType;
31 
32 //天气数据类型枚举
33 typedef enum {
34  BMKWeatherDataTypeNow = 0, // 实时天气预报
35  BMKWeatherDataTypeForecasts, // 未来五天天气预报
36  BMKWeatherDataTypeForecastsForHour, // 按小时天气预报,高级字段
37  BMKWeatherDataTypeLifeIndex, // 生活指数,仅支持国内,高级字段
38  BMKWeatherDataTypeAlert, // 天气事件预警,仅支持国内,高级字段
39  BMKWeatherDataTypeAll // 以上全部,高级字段获取对应权限后可返回
40 } BMKWeatherDataType;
41 
42 
50 typedef NS_ENUM(NSUInteger, BMK_COORD_TYPE) {
51  BMK_COORDTYPE_GPS = 0,
52  BMK_COORDTYPE_COMMON,
53  BMK_COORDTYPE_BD09LL,
54 };
55 
63 typedef NS_ENUM(NSUInteger, BMKMapType) {
64  BMKMapTypeNone = 0,
65  BMKMapTypeStandard = 1,
66  BMKMapTypeSatellite = 2,
67 };
68 
69 
70 typedef enum {
71  BMKErrorOk = 0,
72  BMKErrorConnect = 2,
73  BMKErrorData = 3,
74  BMKErrorRouteAddr = 4,
75  BMKErrorResultNotFound = 100,
76  BMKErrorLocationFailed = 200,
77  BMKErrorPermissionCheckFailure = 300,
78  BMKErrorParse = 310
79 }BMKErrorCode;
80 //鉴权结果状态码
81 typedef enum {
82  E_PERMISSIONCHECK_CONNECT_ERROR = -300,//链接服务器错误
83  E_PERMISSIONCHECK_DATA_ERROR = -200,//服务返回数据异常
84  E_PERMISSIONCHECK_OK = 0, // 授权验证通过
85  E_PERMISSIONCHECK_KEY_ERROR = 101, //ak不存在
86  E_PERMISSIONCHECK_MCODE_ERROR = 102, //mcode签名值不正确
87  E_PERMISSIONCHECK_UID_KEY_ERROR = 200, // APP不存在,AK有误请检查再重试
88  E_PERMISSIONCHECK_KEY_FORBIDEN = 201, // APP被用户自己禁用,请在控制台解禁
89  E_PERMISSIONCHECK_KEY_DENY_BY_SERVER = 202, // APP被服务端管理员删除
90  E_PERMISSIONCHECK_USER_DENY_BY_SERVER = 252, // 用户被服务端管理员删除
91  /*
92  *更多鉴权状态码请参考:
93  *http://lbsyun.baidu.com/index.php?title=webapi/appendix
94  */
95 }BMKPermissionCheckResultCode;
96 
97 //检索结果状态码
98 typedef enum{
99  BMK_SEARCH_NO_ERROR = 0,
100  BMK_SEARCH_AMBIGUOUS_KEYWORD,
101  BMK_SEARCH_AMBIGUOUS_ROURE_ADDR,
102  BMK_SEARCH_NOT_SUPPORT_BUS,
103  BMK_SEARCH_NOT_SUPPORT_BUS_2CITY,
104  BMK_SEARCH_RESULT_NOT_FOUND,
105  BMK_SEARCH_ST_EN_TOO_NEAR,
106  BMK_SEARCH_KEY_ERROR,
107  BMK_SEARCH_NETWOKR_ERROR,
108  BMK_SEARCH_NETWOKR_TIMEOUT,
109  BMK_SEARCH_PERMISSION_UNFINISHED,
110  BMK_SEARCH_INDOOR_ID_ERROR,
111  BMK_SEARCH_FLOOR_ERROR,
112  BMK_SEARCH_INDOOR_ROUTE_NO_IN_BUILDING,
113  BMK_SEARCH_INDOOR_ROUTE_NO_IN_SAME_BUILDING,
114  BMK_SEARCH_PARAMETER_ERROR,
115  BMK_SEARCH_SERVER_ERROR,//服务器错误
116  BMK_SEARCH_SERVER_DISTRICT_ID_ERROR,// 天气服务查询的区域编码与约定的编码不符
117  BMK_SEARCH_SERVER_NO_PERMISSIONS,// 用户需开通高级权限功能
118 }BMKSearchErrorCode;
119 
120 //调起百度地图结果状态码
121 typedef enum{
122  BMK_OPEN_NO_ERROR = 0,
123  BMK_OPEN_WEB_MAP,
124  BMK_OPEN_OPTION_NULL,
125  BMK_OPEN_NOT_SUPPORT,
126  BMK_OPEN_POI_DETAIL_UID_NULL,
127  BMK_OPEN_POI_NEARBY_KEYWORD_NULL,
128  BMK_OPEN_ROUTE_START_ERROR,
129  BMK_OPEN_ROUTE_END_ERROR,
130  BMK_OPEN_PANORAMA_UID_ERROR,
131  BMK_OPEN_PANORAMA_ABSENT,
132  BMK_OPEN_PERMISSION_UNFINISHED,
133  BMK_OPEN_KEY_ERROR,
134  BMK_OPEN_NETWOKR_ERROR,
135 }BMKOpenErrorCode;
136 
138 typedef struct {
139  CLLocationDegrees latitudeDelta;
140  CLLocationDegrees longitudeDelta;
142 
150 UIKIT_STATIC_INLINE BMKCoordinateSpan BMKCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) {
151  BMKCoordinateSpan span;
152  span.latitudeDelta = latitudeDelta;
153  span.longitudeDelta = longitudeDelta;
154  return span;
155 }
156 
158 typedef struct {
159  CLLocationCoordinate2D northEast;
160  CLLocationCoordinate2D southWest;
162 
163 
165 typedef struct {
166  CLLocationCoordinate2D center;
169 
176 UIKIT_STATIC_INLINE BMKCoordinateRegion BMKCoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, BMKCoordinateSpan span) {
177  BMKCoordinateRegion region;
178  region.center = centerCoordinate;
179  region.span = span;
180  return region;
181 }
182 
184 typedef struct {
187 } BMKGeoPoint;
188 
190 typedef struct {
191  double x;
192  double y;
193 } BMKMapPoint;
194 
202 UIKIT_STATIC_INLINE BMKMapPoint BMKMapPointMake(double x, double y) {
203  return (BMKMapPoint){x, y};
204 }
205 
207 typedef struct {
208  double width;
209  double height;
210 } BMKMapSize;
211 
219 UIKIT_STATIC_INLINE BMKMapSize BMKMapSizeMake(double width, double height) {
220  return (BMKMapSize){width, height};
221 }
222 
224 typedef struct {
225  BMKMapPoint origin;
227 } BMKMapRect;
228 
238 UIKIT_STATIC_INLINE BMKMapRect BMKMapRectMake(double x, double y, double width, double height) {
239  return (BMKMapRect){ BMKMapPointMake(x, y), BMKMapSizeMake(width, height)};
240 }
241 
248 UIKIT_STATIC_INLINE BOOL BMKMapRectIsNull(BMKMapRect rect) {
249  return isinf(rect.origin.x) || isinf(rect.origin.y);
250 }
251 
252 
258 UIKIT_STATIC_INLINE double BMKMapRectGetMinX(BMKMapRect rect) {
259  return rect.origin.x;
260 }
261 
267 UIKIT_STATIC_INLINE double BMKMapRectGetMinY(BMKMapRect rect) {
268  return rect.origin.y;
269 }
270 
276 UIKIT_STATIC_INLINE double BMKMapRectGetMidX(BMKMapRect rect) {
277  return rect.origin.x + rect.size.width / 2.0;
278 }
279 
285 UIKIT_STATIC_INLINE double BMKMapRectGetMidY(BMKMapRect rect) {
286  return rect.origin.y + rect.size.height / 2.0;
287 }
288 
294 UIKIT_STATIC_INLINE double BMKMapRectGetMaxX(BMKMapRect rect) {
295  return rect.origin.x + rect.size.width;
296 }
297 
303 UIKIT_STATIC_INLINE double BMKMapRectGetMaxY(BMKMapRect rect) {
304  return rect.origin.y + rect.size.height;
305 }
306 
308 typedef CGFloat BMKZoomScale;
309 
311 UIKIT_EXTERN const BMKMapSize BMKMapSizeWorld;
313 UIKIT_EXTERN const BMKMapRect BMKMapRectWorld;
315 UIKIT_EXTERN const BMKMapRect BMKMapRectNull;
316 
318 @interface BMKPlanNode : NSObject
320 @property (nonatomic, copy) NSString *cityName;
322 @property (nonatomic, assign) NSInteger cityID;
324 @property (nonatomic, copy) NSString *name;
326 @property (nonatomic, assign) CLLocationCoordinate2D pt;
327 @end
328 
330 @interface BMKIndoorPlanNode : NSObject
332 @property (nonatomic, copy) NSString *floor;
334 @property (nonatomic, assign) CLLocationCoordinate2D pt;
335 @end
336 
337 
339 @interface BMKAddressComponent : NSObject
340 // 国家
341 @property (nonatomic, copy) NSString *country;
342 // 省份名称
343 @property (nonatomic, copy) NSString *province;
344 // 城市名称
345 @property (nonatomic, copy) NSString *city;
346 // 区县名称
347 @property (nonatomic, copy) NSString *district;
348 // 乡镇
349 @property (nonatomic, copy) NSString *town;
350 // 街道名称
351 @property (nonatomic, copy) NSString *streetName;
352 // 街道号码
353 @property (nonatomic, copy) NSString *streetNumber;
355 @property (nonatomic, copy) NSString *adCode;
357 @property (nonatomic, copy) NSString *countryCode;
358 // 相对当前坐标点的方向,当有门牌号的时候返回数据
359 @property (nonatomic, copy) NSString *direction;
360 // 相对当前坐标点的距离,当有门牌号的时候返回数据
361 @property (nonatomic, copy) NSString *distance;
362 @end
363 #endif
double y
横坐标
Definition: BMKTypes.h:192
BMKCoordinateSpan span
中心点经纬度坐标
Definition: BMKTypes.h:167
矩形大小,用直角地理坐标表示
Definition: BMKTypes.h:207
线路检索节点信息,一个路线检索节点可以通过经纬度坐标或城市名加地名确定
Definition: BMKTypes.h:318
表示一个经纬度坐标点
Definition: BMKTypes.h:184
矩形,用直角地理坐标表示
Definition: BMKTypes.h:224
表示一个经纬度区域
Definition: BMKTypes.h:158
CLLocationCoordinate2D pt
节点坐标
Definition: BMKTypes.h:326
室内路线检索节点信息
Definition: BMKTypes.h:330
NSInteger cityID
节点所在城市ID
Definition: BMKTypes.h:322
NSString * name
节点名称
Definition: BMKTypes.h:324
NSString * cityName
节点所在城市
Definition: BMKTypes.h:320
CLLocationDegrees longitudeDelta
纬度范围
Definition: BMKTypes.h:140
double height
宽度
Definition: BMKTypes.h:209
此类表示地址结果的层次化信息
Definition: BMKTypes.h:339
BMKMapSize size
屏幕左上点对应的直角地理坐标
Definition: BMKTypes.h:226
int longitudeE6
经度,乘以1e6之后的值
Definition: BMKTypes.h:186
int latitudeE6
纬度,乘以1e6之后的值
Definition: BMKTypes.h:185
表示一个经纬度范围
Definition: BMKTypes.h:138
CLLocationCoordinate2D southWest
东北角点经纬度坐标
Definition: BMKTypes.h:160
表示一个经纬度区域
Definition: BMKTypes.h:165
地理坐标点,用直角地理坐标表示
Definition: BMKTypes.h:190