AMapCommonObj.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. //
  2. // AMapCommonObj.h
  3. // AMapSearchKit
  4. //
  5. // Created by xiaoming han on 15/7/22.
  6. // Copyright (c) 2015年 AutoNavi. All rights reserved.
  7. //
  8. /**
  9. * 该文件定义了搜索结果的基础数据类型。
  10. */
  11. #import <Foundation/Foundation.h>
  12. #import <UIKit/UIKit.h>
  13. #pragma mark - AMapSearchObject
  14. /// 搜索SDK基础类
  15. @interface AMapSearchObject : NSObject
  16. /// 返回格式化的描述信息。通用数据结构和response类型有效。
  17. - (NSString *)formattedDescription;
  18. @end
  19. #pragma mark - 通用数据结构
  20. /// 经纬度
  21. @interface AMapGeoPoint : AMapSearchObject<NSCopying>
  22. @property (nonatomic, assign) CGFloat latitude;
  23. @property (nonatomic, assign) CGFloat longitude;
  24. + (AMapGeoPoint *)locationWithLatitude:(CGFloat)lat longitude:(CGFloat)lon;
  25. @end
  26. /**
  27. * 多边形
  28. * 当传入两个点的时候,当做矩形处理:左下-右上两个顶点;其他情况视为多边形,几个点即为几边型。
  29. */
  30. @interface AMapGeoPolygon : AMapSearchObject<NSCopying>
  31. @property (nonatomic, strong) NSArray *points; //!< 坐标集, AMapGeoPoint 数组
  32. + (AMapGeoPolygon *)polygonWithPoints:(NSArray *)points;
  33. @end
  34. /// 城市
  35. @interface AMapCity : AMapSearchObject
  36. @property (nonatomic, copy) NSString *city; //!< 城市名称
  37. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  38. @property (nonatomic, copy) NSString *adcode; //!< 城市区域编码
  39. @property (nonatomic, assign) NSInteger num; //!< 此区域的建议结果数目,AMapSuggestion中使用
  40. @property (nonatomic, strong) NSArray *districts; //!< 途径区域 AMapDistrict 数组,AMepStep中使用
  41. @end
  42. /// 建议信息
  43. @interface AMapSuggestion : AMapSearchObject
  44. @property (nonatomic, strong) NSArray *keywords; //!< NSString 数组
  45. @property (nonatomic, strong) NSArray *cities; //!< AMapCity 数组
  46. @end
  47. #pragma mark - 输入提示
  48. /// 输入提示
  49. @interface AMapTip : AMapSearchObject
  50. @property (nonatomic, copy) NSString *uid; //!< poi的id
  51. @property (nonatomic, copy) NSString *name; //!< 名称
  52. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  53. @property (nonatomic, copy) NSString *district; //!< 所属区域
  54. @property (nonatomic, copy) AMapGeoPoint *location; //!< 位置
  55. @end
  56. #pragma mark - POI
  57. /// POI
  58. @interface AMapPOI : AMapSearchObject
  59. // 基础信息
  60. @property (nonatomic, copy) NSString *uid; //!< POI全局唯一ID
  61. @property (nonatomic, copy) NSString *name; //!< 名称
  62. @property (nonatomic, copy) NSString *type; //!< 兴趣点类型
  63. @property (nonatomic, copy) AMapGeoPoint *location; //!< 经纬度
  64. @property (nonatomic, copy) NSString *address; //!< 地址
  65. @property (nonatomic, copy) NSString *tel; //!< 电话
  66. @property (nonatomic, assign) NSInteger distance; //!< 距中心点距离
  67. // 扩展信息
  68. @property (nonatomic, copy) NSString *postcode; //!< 邮编
  69. @property (nonatomic, copy) NSString *website; //!< 网址
  70. @property (nonatomic, copy) NSString *email; //!< 电子邮件
  71. @property (nonatomic, copy) NSString *province; //!< 省
  72. @property (nonatomic, copy) NSString *pcode; //!< 省编码
  73. @property (nonatomic, copy) NSString *city; //!< 城市名称
  74. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  75. @property (nonatomic, copy) NSString *district; //!< 区域名称
  76. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  77. @property (nonatomic, copy) NSString *gridcode; //!< 地理格ID
  78. @property (nonatomic, copy) AMapGeoPoint *enterLocation; //!< 入口经纬度
  79. @property (nonatomic, copy) AMapGeoPoint *exitLocation; //!< 出口经纬度
  80. @property (nonatomic, copy) NSString *direction; //!< 方向
  81. @property (nonatomic, assign) BOOL hasIndoorMap; //!< 是否有室内地图
  82. @property (nonatomic, copy) NSString *businessArea; //!< 所在商圈
  83. @end
  84. #pragma mark - 逆地理编码 && 地理编码
  85. /// 道路
  86. @interface AMapRoad : AMapSearchObject
  87. @property (nonatomic, copy) NSString *uid; //!< 道路ID
  88. @property (nonatomic, copy) NSString *name; //!< 道路名称
  89. @property (nonatomic, assign) NSInteger distance; //!< 距离(单位:米)
  90. @property (nonatomic, copy) NSString *direction; //!< 方向
  91. @property (nonatomic, copy) AMapGeoPoint *location; //!< 坐标点
  92. @end
  93. /// 道路交叉口
  94. @interface AMapRoadInter : AMapSearchObject
  95. @property (nonatomic, assign) NSInteger distance; //!< 距离(单位:米)
  96. @property (nonatomic, copy) NSString *direction; //!< 方向
  97. @property (nonatomic, copy) AMapGeoPoint *location; //!< 经纬度
  98. @property (nonatomic, copy) NSString *firstId; //!< 第一条道路ID
  99. @property (nonatomic, copy) NSString *firstName; //!< 第一条道路名称
  100. @property (nonatomic, copy) NSString *secondId; //!< 第二条道路ID
  101. @property (nonatomic, copy) NSString *secondName; //!< 第二条道路名称
  102. @end
  103. /// 门牌信息
  104. @interface AMapStreetNumber : AMapSearchObject
  105. @property (nonatomic, copy) NSString *street; //!< 街道名称
  106. @property (nonatomic, copy) NSString *number; //!< 门牌号
  107. @property (nonatomic, copy) AMapGeoPoint *location; //!< 坐标点
  108. @property (nonatomic, assign) NSInteger distance; //!< 距离(单位:米)
  109. @property (nonatomic, copy) NSString *direction; //!< 方向
  110. @end
  111. /// 地址组成要素
  112. @interface AMapAddressComponent : AMapSearchObject
  113. @property (nonatomic, copy) NSString *province; //!< 省/直辖市
  114. @property (nonatomic, copy) NSString *city; //!< 市
  115. @property (nonatomic, copy) NSString *district; //!< 区
  116. @property (nonatomic, copy) NSString *township; //!< 乡镇
  117. @property (nonatomic, copy) NSString *neighborhood; //!< 社区
  118. @property (nonatomic, copy) NSString *building; //!< 建筑
  119. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  120. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  121. @property (nonatomic, strong) AMapStreetNumber *streetNumber; //!< 门牌信息
  122. @property (nonatomic, strong) NSArray *businessAreas; //!< 商圈列表 AMapBusinessArea 数组
  123. @end
  124. /// 商圈
  125. @interface AMapBusinessArea : AMapSearchObject
  126. @property (nonatomic, strong) NSString *name; //!< 名称
  127. @property (nonatomic, copy) AMapGeoPoint *location; //!< 中心坐标
  128. @end
  129. /// 逆地理编码
  130. @interface AMapReGeocode : AMapSearchObject
  131. // 基础信息
  132. @property (nonatomic, copy) NSString *formattedAddress; //!< 格式化地址
  133. @property (nonatomic, strong) AMapAddressComponent *addressComponent; //!< 地址组成要素
  134. // 扩展信息
  135. @property (nonatomic, strong) NSArray *roads; //!< 道路信息 AMapRoad 数组
  136. @property (nonatomic, strong) NSArray *roadinters; //!< 道路路口信息 AMapRoadInter 数组
  137. @property (nonatomic, strong) NSArray *pois; //!< 兴趣点信息 AMapPOI 数组
  138. @end
  139. /// 地理编码
  140. @interface AMapGeocode : AMapSearchObject
  141. @property (nonatomic, copy) NSString *formattedAddress; //<! 格式化地址
  142. @property (nonatomic, copy) NSString *province; //<! 所在省/直辖市
  143. @property (nonatomic, copy) NSString *city; //<! 城市名
  144. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  145. @property (nonatomic, copy) NSString *district; //<! 区域名称
  146. @property (nonatomic, copy) NSString *township; //<! 所在乡镇
  147. @property (nonatomic, copy) NSString *neighborhood; //<! 社区
  148. @property (nonatomic, copy) NSString *building; //<! 楼
  149. @property (nonatomic, copy) NSString *adcode; //<! 区域编码
  150. @property (nonatomic, copy) AMapGeoPoint *location; //<! 坐标点
  151. @property (nonatomic, copy) NSString *level; //<! 匹配的等级
  152. @end
  153. #pragma mark - 公交查询
  154. @interface AMapBusStop : AMapSearchObject
  155. @property (nonatomic, copy) NSString *uid; //!< 公交站点ID
  156. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  157. @property (nonatomic, copy) NSString *name; //!< 公交站名
  158. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  159. @property (nonatomic, copy) AMapGeoPoint *location; //!<经纬度坐标
  160. @property (nonatomic, copy) NSString *timestamp; //!< 时间戳
  161. @property (nonatomic, strong) NSArray *buslines; //!< 途径此站的公交路线 AMapBusLine 数组
  162. @property (nonatomic, copy) NSString *sequence; //!< 查询公交线路时的第几站
  163. @end
  164. /// 公交线路
  165. @interface AMapBusLine : AMapSearchObject
  166. // 基础信息
  167. @property (nonatomic, copy) NSString *uid; //!< 公交线路ID
  168. @property (nonatomic, copy) NSString *type; //!< 公交类型
  169. @property (nonatomic, copy) NSString *name; //!< 公交线路名称
  170. @property (nonatomic, copy) NSString *polyline; //!< 坐标集合
  171. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  172. @property (nonatomic, copy) NSString *startStop; //!< 首发站
  173. @property (nonatomic, copy) NSString *endStop; //!< 终点站
  174. @property (nonatomic, copy) AMapGeoPoint *location; //!< 当查询公交站点时,返回的AMapBusLine中含有该字段
  175. // 扩展信息
  176. @property (nonatomic, copy) NSString *startTime; //!< 首班车时间
  177. @property (nonatomic, copy) NSString *endTime; //!< 末班车时间
  178. @property (nonatomic, copy) NSString *company; //!< 所属公交公司
  179. @property (nonatomic, assign) CGFloat distance; //!< 距离。在公交线路查询时,该值为此线路的全程距离,单位为千米; 在公交路径规划时,该值为乘坐此路公交车的行驶距离,单位为米
  180. @property (nonatomic, assign) CGFloat basicPrice; //!< 起步价
  181. @property (nonatomic, assign) CGFloat totalPrice; //!< 全程票价
  182. @property (nonatomic, copy) AMapGeoPolygon *bounds; //!< 矩形区域左下、右上顶点坐标
  183. @property (nonatomic, strong) NSArray *busStops; //!< 途径公交站 AMapBusStop 数组
  184. // 公交路径规划信息
  185. @property (nonatomic, strong) AMapBusStop *departureStop; //!< 起程站
  186. @property (nonatomic, strong) AMapBusStop *arrivalStop; //!< 下车站
  187. @property (nonatomic, strong) NSArray *viaBusStops; //!< 途径公交站 AMapBusStop 数组
  188. @property (nonatomic, assign) NSInteger duration; //!< 预计行驶时间(单位:秒)
  189. @end
  190. #pragma mark - 行政区划
  191. @interface AMapDistrict : AMapSearchObject
  192. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  193. @property (nonatomic, copy) NSString *citycode; //!< 城市编码
  194. @property (nonatomic, copy) NSString *name; //!< 行政区名称
  195. @property (nonatomic, copy) NSString *level; //!< 级别
  196. @property (nonatomic, strong) NSArray *districts; //!< 下级行政区域数组
  197. @property (nonatomic, copy) AMapGeoPoint *center; //!< 城市中心点
  198. @property (nonatomic, strong) NSArray *polylines; //!< 行政区边界坐标点, NSString 数组
  199. @end
  200. #pragma mark - 路径规划
  201. /// 路径规划信息
  202. @interface AMapRoute : AMapSearchObject
  203. @property (nonatomic, copy) AMapGeoPoint *origin; //!< 起点坐标
  204. @property (nonatomic, copy) AMapGeoPoint *destination; //!< 终点坐标
  205. @property (nonatomic, assign) CGFloat taxiCost; //!< 出租车费用(单位:元)
  206. @property (nonatomic, strong) NSArray *paths; //!< 步行、驾车方案列表 AMapPath 数组
  207. @property (nonatomic, strong) NSArray *transits; //!< 公交换乘方案列表 AMapTransit 数组
  208. @end
  209. /// 步行、驾车方案
  210. @interface AMapPath : AMapSearchObject
  211. @property (nonatomic, assign) NSInteger distance; //!< 起点和终点的距离
  212. @property (nonatomic, assign) NSInteger duration; //!< 预计耗时(单位:秒)
  213. @property (nonatomic, copy) NSString *strategy; //!< 导航策略
  214. @property (nonatomic, strong) NSArray *steps; //!< 导航路段 AMapStep数组
  215. @property (nonatomic, assign) CGFloat tolls; //!< 此方案费用(单位:元)
  216. @property (nonatomic, assign) NSInteger tollDistance; //!< 此方案收费路段长度(单位:米)
  217. @end
  218. /// 路段基本信息
  219. @interface AMapStep : AMapSearchObject
  220. // 基础信息
  221. @property (nonatomic, copy) NSString *instruction; //!< 行走指示
  222. @property (nonatomic, copy) NSString *orientation; //!< 方向
  223. @property (nonatomic, copy) NSString *road; //!< 道路名称
  224. @property (nonatomic, assign) NSInteger distance; //!< 此路段长度(单位:米)
  225. @property (nonatomic, assign) NSInteger duration; //!< 此路段预计耗时(单位:秒)
  226. @property (nonatomic, copy) NSString *polyline; //!< 此路段坐标点串
  227. @property (nonatomic, copy) NSString *action; //!< 导航主要动作
  228. @property (nonatomic, copy) NSString *assistantAction; //!< 导航辅助动作
  229. @property (nonatomic, assign) CGFloat tolls; //!< 此段收费(单位:元)
  230. @property (nonatomic, assign) NSInteger tollDistance; //!< 收费路段长度(单位:米)
  231. @property (nonatomic, copy) NSString *tollRoad; //!< 主要收费路段
  232. // 扩展信息
  233. @property (nonatomic, strong) NSArray *cities; //!< 途径城市 AMapCity 数组
  234. @end
  235. /// 步行换乘信息
  236. @interface AMapWalking : AMapSearchObject
  237. @property (nonatomic, copy) AMapGeoPoint *origin; //!< 起点坐标
  238. @property (nonatomic, copy) AMapGeoPoint *destination; //!< 终点坐标
  239. @property (nonatomic, assign) NSInteger distance; //!< 起点和终点的步行距离
  240. @property (nonatomic, assign) NSInteger duration; //!< 步行预计时间
  241. @property (nonatomic, strong) NSArray *steps; //!< 步行路段 AMapStep 数组
  242. @end
  243. /// 公交换乘路段
  244. @interface AMapSegment : AMapSearchObject
  245. @property (nonatomic, strong) AMapWalking *walking; //!< 此路段步行导航信息
  246. @property (nonatomic, strong) NSArray *buslines; //!< 此路段可供选择的不同公交线路 AMapBusLine 数组
  247. @property (nonatomic, copy) NSString *enterName; //!< 入口名称
  248. @property (nonatomic, copy) AMapGeoPoint *enterLocation; //!< 入口经纬度
  249. @property (nonatomic, copy) NSString *exitName; //!< 出口名称
  250. @property (nonatomic, copy) AMapGeoPoint *exitLocation; //!< 出口经纬度
  251. @end
  252. /// 公交方案
  253. @interface AMapTransit : AMapSearchObject
  254. @property (nonatomic, assign) CGFloat cost; //!< 此公交方案价格(单位:元)
  255. @property (nonatomic, assign) NSInteger duration; //!< 此换乘方案预期时间(单位:秒)
  256. @property (nonatomic, assign) BOOL nightflag; //!< 是否是夜班车
  257. @property (nonatomic, assign) NSInteger walkingDistance; //!< 此方案总步行距离(单位:米)
  258. @property (nonatomic, strong) NSArray *segments; //!< 换乘路段 AMapSegment 数组
  259. @end
  260. #pragma mark - 天气查询
  261. /// 实况天气,仅支持中国大陆、香港、澳门的数据返回
  262. @interface AMapLocalWeatherLive : AMapSearchObject
  263. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  264. @property (nonatomic, copy) NSString *province; //!< 省份名
  265. @property (nonatomic, copy) NSString *city; //!< 城市名
  266. @property (nonatomic, copy) NSString *weather; //!< 天气现象
  267. @property (nonatomic, copy) NSString *temperature; //!< 实时温度
  268. @property (nonatomic, copy) NSString *windDirection; //!< 风向
  269. @property (nonatomic, copy) NSString *windPower; //!< 风力,单位:级
  270. @property (nonatomic, copy) NSString *humidity; //!< 空气湿度
  271. @property (nonatomic, copy) NSString *reportTime; //!<数据发布时间
  272. @end
  273. /// 天气预报类,支持当前时间在内的3天的天气进行预报
  274. @interface AMapLocalWeatherForecast : AMapSearchObject
  275. @property (nonatomic, copy) NSString *adcode; //!< 区域编码
  276. @property (nonatomic, copy) NSString *province; //!< 省份名
  277. @property (nonatomic, copy) NSString *city; //!< 城市名
  278. @property (nonatomic, copy) NSString *reportTime; //!<数据发布时间
  279. @property (nonatomic, strong) NSArray *casts; //!< 天气预报AMapLocalDayWeatherForecast数组
  280. @end
  281. /// 某一天的天气预报信息
  282. @interface AMapLocalDayWeatherForecast : AMapSearchObject
  283. @property (nonatomic, copy) NSString *date; //!< 日期
  284. @property (nonatomic, copy) NSString *week; //!< 星期
  285. @property (nonatomic, copy) NSString *dayWeather; //!< 白天天气现象
  286. @property (nonatomic, copy) NSString *nightWeather;//!< 晚上天气现象
  287. @property (nonatomic, copy) NSString *dayTemp; //!< 白天温度
  288. @property (nonatomic, copy) NSString *nightTemp; //!< 晚上温度
  289. @property (nonatomic, copy) NSString *dayWind; //!< 白天风向
  290. @property (nonatomic, copy) NSString *nightWind; //!< 晚上风向
  291. @property (nonatomic, copy) NSString *dayPower; //!< 白天风力
  292. @property (nonatomic, copy) NSString *nightPower; //!< 晚上风力
  293. @end
  294. #pragma mark - 附近搜索
  295. @interface AMapNearbyUserInfo : AMapSearchObject
  296. @property (nonatomic, copy) NSString *userID; //!< 用户ID
  297. @property (nonatomic, copy) AMapGeoPoint *location; //!< 最后更新位置
  298. @property (nonatomic, assign) CGFloat distance; //!< 与搜索点的距离,由搜索时searchType决定
  299. @property (nonatomic, assign) NSTimeInterval updatetime; //!< 最后更新的时间戳,单位秒
  300. @end