iOS高德地图SDK(2D)
v5.6.0
|
#import <CoreGraphics/CoreGraphics.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
Go to the source code of this file.
Classes | |
struct | MACoordinateBounds |
东北、西南两个点定义的四边形经纬度范围 More... | |
struct | MACoordinateSpan |
经度、纬度定义的经纬度跨度范围 More... | |
struct | MACoordinateRegion |
中心点、跨度范围定义的四边形经纬度范围 More... | |
struct | MAMapPoint |
平面投影坐标结构定义 More... | |
struct | MAMapSize |
平面投影大小结构定义 More... | |
struct | MAMapRect |
平面投影矩形结构定义 More... | |
category | NSValue(NSValueMAGeometryExtensions) |
utils方法,方便c结构体对象和NSValue对象间相互转化 More... | |
Typedefs | |
typedef struct MACoordinateBounds | MACoordinateBounds |
typedef struct MACoordinateSpan | MACoordinateSpan |
typedef struct MACoordinateRegion | MACoordinateRegion |
typedef struct MAMapPoint | MAMapPoint |
typedef struct MAMapSize | MAMapSize |
typedef struct MAMapRect | MAMapRect |
typedef double | MAZoomScale |
比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint, 当MAZoomScale = 0.5时, 1 screen point = 2 MAMapPoints More... | |
typedef void(^ | AMapTileProjectionBlock) (int offsetX, int offsetY, int minX, int maxX, int minY, int maxY) |
获取墨卡托投影切块回调block,如果是无效的映射,则返回(-1, -1, 0, 0, 0, 0) More... | |
Enumerations | |
enum | MACoordinateType : NSUInteger { MACoordinateTypeBaidu = 0, MACoordinateTypeMapBar, MACoordinateTypeMapABC, MACoordinateTypeSoSoMap, MACoordinateTypeAliYun, MACoordinateTypeGoogle, MACoordinateTypeGPS } |
坐标系类型枚举 More... | |
Functions | |
MACoordinateRegion | MACoordinateRegionMakeWithDistance (CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters) |
生成一个新的MACoordinateRegion More... | |
MAMapPoint | MAMapPointForCoordinate (CLLocationCoordinate2D coordinate) |
经纬度坐标转平面投影坐标 More... | |
CLLocationCoordinate2D | MACoordinateForMapPoint (MAMapPoint mapPoint) |
平面投影坐标转经纬度坐标 More... | |
MACoordinateRegion | MACoordinateRegionForMapRect (MAMapRect rect) |
平面投影矩形转region More... | |
MAMapRect | MAMapRectForCoordinateRegion (MACoordinateRegion region) |
region转平面投影矩形 More... | |
CLLocationDistance | MAMetersPerMapPointAtLatitude (CLLocationDegrees latitude) |
单位投影的距离 More... | |
double | MAMapPointsPerMeterAtLatitude (CLLocationDegrees latitude) |
1米对应的投影 More... | |
CLLocationDistance | MAMetersBetweenMapPoints (MAMapPoint a, MAMapPoint b) |
投影两点之间的距离 More... | |
double | MAAreaBetweenCoordinates (CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest) |
经纬度间的面积(单位 平方米) More... | |
MAMapRect | MAMapRectInset (MAMapRect rect, double dx, double dy) |
获取Inset后的MAMapRect More... | |
MAMapRect | MAMapRectUnion (MAMapRect rect1, MAMapRect rect2) |
合并两个MAMapRect More... | |
BOOL | MAMapSizeContainsSize (MAMapSize size1, MAMapSize size2) |
判断size1是否包含size2 More... | |
BOOL | MAMapRectContainsPoint (MAMapRect rect, MAMapPoint point) |
判断点是否在矩形内 More... | |
BOOL | MAMapRectIntersectsRect (MAMapRect rect1, MAMapRect rect2) |
判断两矩形是否相交 More... | |
BOOL | MAMapRectContainsRect (MAMapRect rect1, MAMapRect rect2) |
判断矩形rect1是否包含矩形rect2 More... | |
BOOL | MACircleContainsPoint (MAMapPoint point, MAMapPoint center, double radius) |
判断点是否在圆内 More... | |
BOOL | MACircleContainsCoordinate (CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius) |
判断经纬度点是否在圆内 More... | |
BOOL | MAPolygonContainsPoint (MAMapPoint point, MAMapPoint *polygon, NSUInteger count) |
判断点是否在多边形内 More... | |
BOOL | MAPolygonContainsCoordinate (CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count) |
判断经纬度点是否在多边形内 More... | |
MAMapPoint | MAGetNearestMapPointFromLine (MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point) |
取在lineStart和lineEnd组成的线段上距离point距离最近的点 More... | |
void | MAGetTileProjectionFromBounds (MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection) |
根据所给经纬度区域获取墨卡托投影切块信息 More... | |
CLLocationCoordinate2D | MACoordinateConvert (CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("已废弃,使用AMapFoundation中关于坐标转换的接口"))) |
转换目标经纬度为高德坐标系 More... | |
CLLocationDirection | MAGetDirectionFromCoords (CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord) |
获取矢量坐标方向 More... | |
Variables | |
const MAMapSize | MAMapSizeWorld |
世界范围大小 More... | |
const MAMapRect | MAMapRectWorld |
世界范围四边形 More... | |
const MAMapRect | MAMapRectNull |
(MAMapRect){{INFINITY, INFINITY}, {0, 0}}; More... | |
const MAMapRect | MAMapRectZero |
(MAMapRect){{0, 0}, {0, 0}} More... | |
typedef void(^ AMapTileProjectionBlock) (int offsetX, int offsetY, int minX, int maxX, int minY, int maxY) |
获取墨卡托投影切块回调block,如果是无效的映射,则返回(-1, -1, 0, 0, 0, 0)
offsetX | 左上点距离所属tile的位移X, 单位像素 |
offsetY | 左上点距离所属tile的位移Y, 单位像素 |
minX | 覆盖tile的最小x |
maxX | 覆盖tile的最大x |
minY | 覆盖tile的最小y |
maxY | 覆盖tile的最大y |
typedef struct MACoordinateBounds MACoordinateBounds |
typedef struct MACoordinateRegion MACoordinateRegion |
typedef struct MACoordinateSpan MACoordinateSpan |
typedef struct MAMapPoint MAMapPoint |
typedef double MAZoomScale |
比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint, 当MAZoomScale = 0.5时, 1 screen point = 2 MAMapPoints
enum MACoordinateType : NSUInteger |
double MAAreaBetweenCoordinates | ( | CLLocationCoordinate2D | northEast, |
CLLocationCoordinate2D | southWest | ||
) |
经纬度间的面积(单位 平方米)
northEast | 东北经纬度 |
southWest | 西南经纬度 |
BOOL MACircleContainsCoordinate | ( | CLLocationCoordinate2D | point, |
CLLocationCoordinate2D | center, | ||
double | radius | ||
) |
判断经纬度点是否在圆内
point | 经纬度 |
center | 圆的中心经纬度 |
radius | 圆的半径 |
BOOL MACircleContainsPoint | ( | MAMapPoint | point, |
MAMapPoint | center, | ||
double | radius | ||
) |
判断点是否在圆内
point | 点 |
center | 圆的中心点 |
radius | 圆的半径 |
CLLocationCoordinate2D MACoordinateConvert | ( | CLLocationCoordinate2D | coordinate, |
MACoordinateType | type | ||
) |
转换目标经纬度为高德坐标系
coordinate | 待转换的经纬度 |
type | 坐标系类型 |
CLLocationCoordinate2D MACoordinateForMapPoint | ( | MAMapPoint | mapPoint | ) |
平面投影坐标转经纬度坐标
mapPoint | 要转化的平面投影坐标 |
MACoordinateRegion MACoordinateRegionForMapRect | ( | MAMapRect | rect | ) |
平面投影矩形转region
rect | 要转化的平面投影矩形 |
MACoordinateRegion MACoordinateRegionMakeWithDistance | ( | CLLocationCoordinate2D | centerCoordinate, |
CLLocationDistance | latitudinalMeters, | ||
CLLocationDistance | longitudinalMeters | ||
) |
生成一个新的MACoordinateRegion
centerCoordinate | 中心点坐标 |
latitudinalMeters | 垂直跨度(单位 米) |
longitudinalMeters | 水平跨度(单位 米) |
CLLocationDirection MAGetDirectionFromCoords | ( | CLLocationCoordinate2D | fromCoord, |
CLLocationCoordinate2D | toCoord | ||
) |
获取矢量坐标方向
fromCoord | 矢量坐标起点 |
toCoord | 矢量坐标终点 |
MAMapPoint MAGetNearestMapPointFromLine | ( | MAMapPoint | lineStart, |
MAMapPoint | lineEnd, | ||
MAMapPoint | point | ||
) |
取在lineStart和lineEnd组成的线段上距离point距离最近的点
lineStart | 线段起点 |
lineEnd | 线段终点 |
point | 测试点 |
void MAGetTileProjectionFromBounds | ( | MACoordinateBounds | bounds, |
int | levelOfDetails, | ||
AMapTileProjectionBlock | tileProjection | ||
) |
根据所给经纬度区域获取墨卡托投影切块信息
bounds | 经纬度区域 |
levelOfDetails | 对应缩放级别, 取值0-20 |
tileProjection | 返回的切块信息block |
MAMapPoint MAMapPointForCoordinate | ( | CLLocationCoordinate2D | coordinate | ) |
经纬度坐标转平面投影坐标
coordinate | 要转化的经纬度坐标 |
double MAMapPointsPerMeterAtLatitude | ( | CLLocationDegrees | latitude | ) |
1米对应的投影
latitude | 经纬度 |
BOOL MAMapRectContainsPoint | ( | MAMapRect | rect, |
MAMapPoint | point | ||
) |
判断点是否在矩形内
rect | 矩形rect |
point | 点 |
判断矩形rect1是否包含矩形rect2
rect1 | rect1 |
rect2 | rect2 |
MAMapRect MAMapRectForCoordinateRegion | ( | MACoordinateRegion | region | ) |
region转平面投影矩形
region | region 要转化的region |
判断两矩形是否相交
rect1 | rect1 |
rect2 | rect2 |
合并两个MAMapRect
rect1 | rect1 |
rect2 | rect2 |
判断size1是否包含size2
size1 | size1 |
size2 | size2 |
CLLocationDistance MAMetersBetweenMapPoints | ( | MAMapPoint | a, |
MAMapPoint | b | ||
) |
投影两点之间的距离
a | a点 |
b | b点 |
CLLocationDistance MAMetersPerMapPointAtLatitude | ( | CLLocationDegrees | latitude | ) |
单位投影的距离
latitude | 经纬度 |
BOOL MAPolygonContainsCoordinate | ( | CLLocationCoordinate2D | point, |
CLLocationCoordinate2D * | polygon, | ||
NSUInteger | count | ||
) |
判断经纬度点是否在多边形内
point | 经纬度点 |
polygon | 多边形 |
count | 多边形点的数量 |
BOOL MAPolygonContainsPoint | ( | MAMapPoint | point, |
MAMapPoint * | polygon, | ||
NSUInteger | count | ||
) |
判断点是否在多边形内
point | 点 |
polygon | 多边形 |
count | 多边形点的数量 |
const MAMapRect MAMapRectWorld |
世界范围四边形
const MAMapSize MAMapSizeWorld |
世界范围大小