BaiduMap_IOSSDK_v6.2.0_Docs  6.2.0
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  BMKMapModuleBasic //基础地图模块
20 
21 //天气服务类型枚举
22 typedef enum {
26 
27 //语言类型枚举
28 typedef enum {
29  BMKLanguageTypeChinese = 0, // 中文
32 
33 //天气数据类型枚举
34 typedef enum {
35  BMKWeatherDataTypeNow = 0, // 实时天气预报
36  BMKWeatherDataTypeForecasts, // 未来五天天气预报
37  BMKWeatherDataTypeForecastsForHour, // 按小时天气预报,高级字段
38  BMKWeatherDataTypeLifeIndex, // 生活指数,仅支持国内,高级字段
39  BMKWeatherDataTypeAlert, // 天气事件预警,仅支持国内,高级字段
40  BMKWeatherDataTypeAll // 以上全部,高级字段获取对应权限后可返回
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,
78  BMKErrorParse = 310
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  */
96 
97 //检索结果状态码
98 typedef enum{
115  BMK_SEARCH_SERVER_ERROR,//服务器错误
121 
122 //调起百度地图结果状态码
123 typedef enum{
138 
140 typedef struct {
141  CLLocationDegrees latitudeDelta;
142  CLLocationDegrees longitudeDelta;
144 
152 UIKIT_STATIC_INLINE BMKCoordinateSpan BMKCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) {
153  BMKCoordinateSpan span;
154  span.latitudeDelta = latitudeDelta;
155  span.longitudeDelta = longitudeDelta;
156  return span;
157 }
158 
160 typedef struct {
161  CLLocationCoordinate2D northEast;
162  CLLocationCoordinate2D southWest;
164 
165 
167 typedef struct {
168  CLLocationCoordinate2D center;
171 
178 UIKIT_STATIC_INLINE BMKCoordinateRegion BMKCoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, BMKCoordinateSpan span) {
179  BMKCoordinateRegion region;
180  region.center = centerCoordinate;
181  region.span = span;
182  return region;
183 }
184 
186 typedef struct {
189 } BMKGeoPoint;
190 
192 typedef struct {
193  double x;
194  double y;
195 } BMKMapPoint;
196 
204 UIKIT_STATIC_INLINE BMKMapPoint BMKMapPointMake(double x, double y) {
205  return (BMKMapPoint){x, y};
206 }
207 
209 typedef struct {
210  double width;
211  double height;
212 } BMKMapSize;
213 
221 UIKIT_STATIC_INLINE BMKMapSize BMKMapSizeMake(double width, double height) {
222  return (BMKMapSize){width, height};
223 }
224 
226 typedef struct {
229 } BMKMapRect;
230 
240 UIKIT_STATIC_INLINE BMKMapRect BMKMapRectMake(double x, double y, double width, double height) {
241  return (BMKMapRect){ BMKMapPointMake(x, y), BMKMapSizeMake(width, height)};
242 }
243 
250 UIKIT_STATIC_INLINE BOOL BMKMapRectIsNull(BMKMapRect rect) {
251  return isinf(rect.origin.x) || isinf(rect.origin.y);
252 }
253 
254 
260 UIKIT_STATIC_INLINE double BMKMapRectGetMinX(BMKMapRect rect) {
261  return rect.origin.x;
262 }
263 
269 UIKIT_STATIC_INLINE double BMKMapRectGetMinY(BMKMapRect rect) {
270  return rect.origin.y;
271 }
272 
278 UIKIT_STATIC_INLINE double BMKMapRectGetMidX(BMKMapRect rect) {
279  return rect.origin.x + rect.size.width / 2.0;
280 }
281 
287 UIKIT_STATIC_INLINE double BMKMapRectGetMidY(BMKMapRect rect) {
288  return rect.origin.y + rect.size.height / 2.0;
289 }
290 
296 UIKIT_STATIC_INLINE double BMKMapRectGetMaxX(BMKMapRect rect) {
297  return rect.origin.x + rect.size.width;
298 }
299 
305 UIKIT_STATIC_INLINE double BMKMapRectGetMaxY(BMKMapRect rect) {
306  return rect.origin.y + rect.size.height;
307 }
308 
310 typedef CGFloat BMKZoomScale;
311 
313 UIKIT_EXTERN const BMKMapSize BMKMapSizeWorld;
315 UIKIT_EXTERN const BMKMapRect BMKMapRectWorld;
317 UIKIT_EXTERN const BMKMapRect BMKMapRectNull;
318 
320 @interface BMKPlanNode : NSObject
322 @property (nonatomic, copy) NSString *cityName;
324 @property (nonatomic, assign) NSInteger cityID;
326 @property (nonatomic, copy) NSString *name;
328 @property (nonatomic, assign) CLLocationCoordinate2D pt;
329 @end
330 
332 @interface BMKIndoorPlanNode : NSObject
334 @property (nonatomic, copy) NSString *floor;
336 @property (nonatomic, assign) CLLocationCoordinate2D pt;
337 @end
338 
339 
341 @interface BMKAddressComponent : NSObject
342 // 国家
343 @property (nonatomic, copy) NSString *country;
344 // 省份名称
345 @property (nonatomic, copy) NSString *province;
346 // 城市名称
347 @property (nonatomic, copy) NSString *city;
348 // 区县名称
349 @property (nonatomic, copy) NSString *district;
350 // 乡镇
351 @property (nonatomic, copy) NSString *town;
352 // 街道名称
353 @property (nonatomic, copy) NSString *streetName;
354 // 街道号码
355 @property (nonatomic, copy) NSString *streetNumber;
357 @property (nonatomic, copy) NSString *adCode;
359 @property (nonatomic, copy) NSString *countryCode;
360 // 相对当前坐标点的方向,当有门牌号的时候返回数据
361 @property (nonatomic, copy) NSString *direction;
362 // 相对当前坐标点的距离,当有门牌号的时候返回数据
363 @property (nonatomic, copy) NSString *distance;
364 @end
365 #endif
UIKIT_STATIC_INLINE BMKMapPoint BMKMapPointMake(double x, double y)
Definition: BMKTypes.h:204
BMKMapModule
Definition: BMKTypes.h:16
@ BMKMapModuleTile
Definition: BMKTypes.h:17
@ BMKMapModuleBasic
Definition: BMKTypes.h:18
UIKIT_STATIC_INLINE BMKCoordinateSpan BMKCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)
Definition: BMKTypes.h:152
UIKIT_STATIC_INLINE double BMKMapRectGetMinX(BMKMapRect rect)
Definition: BMKTypes.h:260
UIKIT_STATIC_INLINE BOOL BMKMapRectIsNull(BMKMapRect rect)
Definition: BMKTypes.h:250
UIKIT_STATIC_INLINE double BMKMapRectGetMinY(BMKMapRect rect)
Definition: BMKTypes.h:269
BMKLanguageType
Definition: BMKTypes.h:28
@ BMKLanguageTypeChinese
Definition: BMKTypes.h:29
@ BMKLanguageTypeEnglish
Definition: BMKTypes.h:30
BMKPermissionCheckResultCode
Definition: BMKTypes.h:81
@ E_PERMISSIONCHECK_KEY_FORBIDEN
Definition: BMKTypes.h:88
@ E_PERMISSIONCHECK_MCODE_ERROR
Definition: BMKTypes.h:86
@ E_PERMISSIONCHECK_UID_KEY_ERROR
Definition: BMKTypes.h:87
@ E_PERMISSIONCHECK_CONNECT_ERROR
Definition: BMKTypes.h:82
@ E_PERMISSIONCHECK_KEY_DENY_BY_SERVER
Definition: BMKTypes.h:89
@ E_PERMISSIONCHECK_OK
Definition: BMKTypes.h:84
@ E_PERMISSIONCHECK_USER_DENY_BY_SERVER
Definition: BMKTypes.h:90
@ E_PERMISSIONCHECK_DATA_ERROR
Definition: BMKTypes.h:83
@ E_PERMISSIONCHECK_KEY_ERROR
Definition: BMKTypes.h:85
UIKIT_STATIC_INLINE BMKCoordinateRegion BMKCoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, BMKCoordinateSpan span)
Definition: BMKTypes.h:178
UIKIT_STATIC_INLINE double BMKMapRectGetMaxX(BMKMapRect rect)
Definition: BMKTypes.h:296
typedef NS_ENUM(NSUInteger, BMK_COORD_TYPE)
Definition: BMKTypes.h:50
UIKIT_EXTERN const BMKMapRect BMKMapRectWorld
经过投影后的世界矩形范围
Definition: BMKTypes.h:315
BMKErrorCode
Definition: BMKTypes.h:70
@ BMKErrorParse
数据解析失败
Definition: BMKTypes.h:78
@ BMKErrorRouteAddr
起点或终点选择(有歧义)
Definition: BMKTypes.h:74
@ BMKErrorPermissionCheckFailure
百度地图API授权Key验证失败
Definition: BMKTypes.h:77
@ BMKErrorResultNotFound
搜索结果未找到
Definition: BMKTypes.h:75
@ BMKErrorOk
正确,无错误
Definition: BMKTypes.h:71
@ BMKErrorConnect
网络连接错误
Definition: BMKTypes.h:72
@ BMKErrorLocationFailed
定位失败
Definition: BMKTypes.h:76
@ BMKErrorData
数据错误
Definition: BMKTypes.h:73
CGFloat BMKZoomScale
地图缩放比例
Definition: BMKTypes.h:310
BMKSearchErrorCode
Definition: BMKTypes.h:98
@ BMK_SEARCH_NOT_SUPPORT_BUS_2CITY
不支持跨城市公交
Definition: BMKTypes.h:103
@ BMK_SEARCH_INDOOR_ROUTE_NO_IN_SAME_BUILDING
起终点不在支持室内路线的室内图内
Definition: BMKTypes.h:113
@ BMK_SEARCH_KEY_ERROR
key错误
Definition: BMKTypes.h:106
@ BMK_SEARCH_NETWOKR_ERROR
Definition: BMKTypes.h:107
@ BMK_SEARCH_AMBIGUOUS_ROURE_ADDR
检索地址有岐义
Definition: BMKTypes.h:101
@ BMK_SEARCH_ST_EN_TOO_NEAR
起终点太近
Definition: BMKTypes.h:105
@ BMK_SEARCH_NOT_SUPPORT_BUS
该城市不支持公交搜索
Definition: BMKTypes.h:102
@ BMK_SEARCH_PARAMETER_ERROR
起终点不在同一个室内
Definition: BMKTypes.h:114
@ BMK_SEARCH_SERVER_ERROR
参数错误
Definition: BMKTypes.h:115
@ BMK_SEARCH_RESULT_NOT_FOUND
没有找到检索结果
Definition: BMKTypes.h:104
@ BMK_SEARCH_SERVER_DISTRICT_NO_DATA
用户需开通高级权限功能
Definition: BMKTypes.h:118
@ BMK_SEARCH_INDOOR_ID_ERROR
还未完成鉴权,请在鉴权通过后重试
Definition: BMKTypes.h:110
@ BMK_SEARCH_SERVER_NO_PERMISSIONS
Definition: BMKTypes.h:116
@ BMK_SEARCH_FLOOR_ERROR
室内图ID错误
Definition: BMKTypes.h:111
@ BMK_SEARCH_SERVER_DISTRICT_ID_ERROR
所在地区无数据覆盖
Definition: BMKTypes.h:119
@ BMK_SEARCH_AMBIGUOUS_KEYWORD
检索词有岐义
Definition: BMKTypes.h:100
@ BMK_SEARCH_INDOOR_ROUTE_NO_IN_BUILDING
室内图检索楼层错误
Definition: BMKTypes.h:112
@ BMK_SEARCH_PERMISSION_UNFINISHED
网络连接超时
Definition: BMKTypes.h:109
@ BMK_SEARCH_NETWOKR_TIMEOUT
网络连接错误
Definition: BMKTypes.h:108
@ BMK_SEARCH_SERVER_NO_ADVANCED_PERMISSIONS
需开通权限功能,用户在API控制台中创建或设置某APP的时候禁用了某项服务,若需开通权限,可进入API控制台为AK勾选对应服务
Definition: BMKTypes.h:117
@ BMK_SEARCH_NO_ERROR
检索结果正常返回
Definition: BMKTypes.h:99
UIKIT_STATIC_INLINE double BMKMapRectGetMidY(BMKMapRect rect)
Definition: BMKTypes.h:287
UIKIT_EXTERN const BMKMapRect BMKMapRectNull
空的直角坐标矩形
Definition: BMKTypes.h:317
UIKIT_STATIC_INLINE double BMKMapRectGetMaxY(BMKMapRect rect)
Definition: BMKTypes.h:305
UIKIT_EXTERN const BMKMapSize BMKMapSizeWorld
经过投影后的世界范围大小,与经纬度(-85,180)投影后的坐标值对应
Definition: BMKTypes.h:313
BMKWeatherServerType
Definition: BMKTypes.h:22
@ BMKWeatherServerTypeDefault
Definition: BMKTypes.h:23
@ BMKLanguageServerTypeAbroad
Definition: BMKTypes.h:24
BMKWeatherDataType
Definition: BMKTypes.h:34
@ BMKWeatherDataTypeForecastsForHour
Definition: BMKTypes.h:37
@ BMKWeatherDataTypeLifeIndex
Definition: BMKTypes.h:38
@ BMKWeatherDataTypeNow
Definition: BMKTypes.h:35
@ BMKWeatherDataTypeForecasts
Definition: BMKTypes.h:36
@ BMKWeatherDataTypeAll
Definition: BMKTypes.h:40
@ BMKWeatherDataTypeAlert
Definition: BMKTypes.h:39
UIKIT_STATIC_INLINE double BMKMapRectGetMidX(BMKMapRect rect)
Definition: BMKTypes.h:278
UIKIT_STATIC_INLINE BMKMapRect BMKMapRectMake(double x, double y, double width, double height)
Definition: BMKTypes.h:240
BMKOpenErrorCode
Definition: BMKTypes.h:123
@ BMK_OPEN_POI_NEARBY_KEYWORD_NULL
poi周边 keyWord为空
Definition: BMKTypes.h:129
@ BMK_OPEN_ROUTE_END_ERROR
路线终点有误
Definition: BMKTypes.h:131
@ BMK_OPEN_PERMISSION_UNFINISHED
Definition: BMKTypes.h:134
@ BMK_OPEN_NETWOKR_ERROR
Definition: BMKTypes.h:136
@ BMK_OPEN_OPTION_NULL
打开的是web地图
Definition: BMKTypes.h:126
@ BMK_OPEN_NO_ERROR
正常
Definition: BMKTypes.h:124
@ BMK_OPEN_PANORAMA_UID_ERROR
调起全景 poiUid不正确
Definition: BMKTypes.h:132
@ BMK_OPEN_NOT_SUPPORT
没有安装百度地图,或者版本太低
Definition: BMKTypes.h:127
@ BMK_OPEN_POI_DETAIL_UID_NULL
poi详情 poiUid为空
Definition: BMKTypes.h:128
@ BMK_OPEN_WEB_MAP
Definition: BMKTypes.h:125
@ BMK_OPEN_ROUTE_START_ERROR
路线起点有误
Definition: BMKTypes.h:130
@ BMK_OPEN_KEY_ERROR
还未完成鉴权,请在鉴权通过后重试
Definition: BMKTypes.h:135
@ BMK_OPEN_PANORAMA_ABSENT
调起全景 此处不支持全景
Definition: BMKTypes.h:133
UIKIT_STATIC_INLINE BMKMapSize BMKMapSizeMake(double width, double height)
Definition: BMKTypes.h:221
此类表示地址结果的层次化信息
Definition: BMKTypes.h:342
室内路线检索节点信息
Definition: BMKTypes.h:333
线路检索节点信息,一个路线检索节点可以通过经纬度坐标或城市名加地名确定
Definition: BMKTypes.h:321
NSInteger cityID
节点所在城市ID
Definition: BMKTypes.h:324
CLLocationCoordinate2D pt
节点坐标
Definition: BMKTypes.h:328
NSString * cityName
节点所在城市
Definition: BMKTypes.h:322
NSString * name
节点名称
Definition: BMKTypes.h:326
表示一个经纬度区域
Definition: BMKTypes.h:160
CLLocationCoordinate2D northEast
Definition: BMKTypes.h:161
CLLocationCoordinate2D southWest
东北角点经纬度坐标
Definition: BMKTypes.h:162
表示一个经纬度区域
Definition: BMKTypes.h:167
CLLocationCoordinate2D center
Definition: BMKTypes.h:168
BMKCoordinateSpan span
中心点经纬度坐标
Definition: BMKTypes.h:169
表示一个经纬度范围
Definition: BMKTypes.h:140
CLLocationDegrees latitudeDelta
Definition: BMKTypes.h:141
CLLocationDegrees longitudeDelta
纬度范围
Definition: BMKTypes.h:142
表示一个经纬度坐标点
Definition: BMKTypes.h:186
int longitudeE6
经度,乘以1e6之后的值
Definition: BMKTypes.h:188
int latitudeE6
纬度,乘以1e6之后的值
Definition: BMKTypes.h:187
地理坐标点,用直角地理坐标表示
Definition: BMKTypes.h:192
double x
Definition: BMKTypes.h:193
double y
横坐标
Definition: BMKTypes.h:194
矩形,用直角地理坐标表示
Definition: BMKTypes.h:226
BMKMapSize size
屏幕左上点对应的直角地理坐标
Definition: BMKTypes.h:228
BMKMapPoint origin
Definition: BMKTypes.h:227
矩形大小,用直角地理坐标表示
Definition: BMKTypes.h:209
double width
Definition: BMKTypes.h:210
double height
宽度
Definition: BMKTypes.h:211