iOS高德地图SDK(基础)  V1.8.2
AMapUtility.h
Go to the documentation of this file.
1 //
2 // AMapUtility.h
3 // AMapFoundation
4 //
5 // Created by xiaoming han on 15/10/27.
6 // Copyright © 2015年 Amap. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import <CoreLocation/CoreLocation.h>
11 
12 //工具方法
13 
17 FOUNDATION_STATIC_INLINE NSString * AMapEmptyStringIfNil(NSString *s)
18 {
19  return s ? s : @"";
20 }
21 
23 typedef NS_ENUM(NSInteger, AMapCoordinateType)
24 {
25  AMapCoordinateTypeAMap = -1,
26  AMapCoordinateTypeBaidu = 0,
27  AMapCoordinateTypeMapBar,
28  AMapCoordinateTypeMapABC,
29  AMapCoordinateTypeSoSoMap,
30  AMapCoordinateTypeAliYun,
31  AMapCoordinateTypeGoogle,
32  AMapCoordinateTypeGPS,
33 };
34 
41 FOUNDATION_EXTERN CLLocationCoordinate2D AMapCoordinateConvert(CLLocationCoordinate2D coordinate, AMapCoordinateType type);
42 
48 FOUNDATION_EXTERN BOOL AMapDataAvailableForCoordinate(CLLocationCoordinate2D coordinate);
49 
50 
AMapCoordinateConvert
FOUNDATION_EXTERN CLLocationCoordinate2D AMapCoordinateConvert(CLLocationCoordinate2D coordinate, AMapCoordinateType type)
转换目标经纬度为高德坐标系,不在枚举范围内的经纬度将直接返回。
NS_ENUM
typedef NS_ENUM(NSInteger, AMapCoordinateType)
坐标类型枚举
Definition: AMapUtility.h:23
AMapEmptyStringIfNil
FOUNDATION_STATIC_INLINE NSString * AMapEmptyStringIfNil(NSString *s)
如果字符串为nil则返回空字符串
Definition: AMapUtility.h:17
AMapDataAvailableForCoordinate
FOUNDATION_EXTERN BOOL AMapDataAvailableForCoordinate(CLLocationCoordinate2D coordinate)
判断目标经纬度处是否有高德数据。输入参数为高德坐标系。此方法为粗略判断,在边界地区可能会不准确。
© 2017 高德信息技术有限公司 版权所有,保留所有权利。