iOS高德轻量版地图SDK
1.2.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 |
东北、西南两个点定义的四边形经纬度范围 More... | |
typedef struct MACoordinateSpan | MACoordinateSpan |
经度、纬度定义的经纬度跨度范围 More... | |
typedef struct MACoordinateRegion | MACoordinateRegion |
中心点、跨度范围定义的四边形经纬度范围 More... | |
typedef struct MAMapPoint | MAMapPoint |
平面投影坐标结构定义 More... | |
typedef struct MAMapSize | MAMapSize |
平面投影大小结构定义 More... | |
typedef struct MAMapRect | MAMapRect |
平面投影矩形结构定义 More... | |
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... | |
Functions | |
typedef | NS_OPTIONS (NSUInteger, MAMapRectCorner) |
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... | |
MAMapPoint | MAGetNearestMapPointFromPolyline (MAMapPoint point, MAMapPoint *polyline, NSUInteger count) |
获取某坐标点距线上最近的坐标点 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... | |
double | MAAreaForPolygon (CLLocationCoordinate2D *coordinates, int count) |
计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连 More... | |
typedef | NS_ENUM (NSUInteger, MACoordinateType) |
坐标系类型枚举 More... | |
CLLocationCoordinate2D | MACoordinateConvert (CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("已废弃,使用AMapFoundation中关于坐标转换的接口"))) |
转换目标经纬度为高德坐标系 More... | |
CLLocationDirection | MAGetDirectionFromCoords (CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord) |
获取矢量坐标方向 More... | |
CLLocationDirection | MAGetDirectionFromPoints (MAMapPoint fromPoint, MAMapPoint toPoint) |
获取矢量坐标方向 More... | |
double | MAGetDistanceFromPointToLine (MAMapPoint point, MAMapPoint lineBegin, MAMapPoint lineEnd) |
获取点到线的垂直距离 More... | |
BOOL | MAPolylineHitTest (MAMapPoint *linePoints, NSUInteger count, MAMapPoint tappedPoint, CGFloat lineWidth) |
判断线是否被点击选中 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
double MAAreaBetweenCoordinates | ( | CLLocationCoordinate2D | northEast, |
CLLocationCoordinate2D | southWest | ||
) |
经纬度间的面积(单位 平方米)
northEast | 东北经纬度 |
southWest | 西南经纬度 |
double MAAreaForPolygon | ( | CLLocationCoordinate2D * | coordinates, |
int | count | ||
) |
计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
coordinates | 指定的经纬度坐标点数组,C数组,调用者负责内存管理 |
count | 坐标点的个数 |
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 | 矢量坐标终点 |
CLLocationDirection MAGetDirectionFromPoints | ( | MAMapPoint | fromPoint, |
MAMapPoint | toPoint | ||
) |
获取矢量坐标方向
fromPoint | 矢量坐标起点 |
toPoint | 矢量坐标终点 |
double MAGetDistanceFromPointToLine | ( | MAMapPoint | point, |
MAMapPoint | lineBegin, | ||
MAMapPoint | lineEnd | ||
) |
获取点到线的垂直距离
point | 起点 |
lineBegin | 线的起点 |
lineEnd | 线的终点 |
MAMapPoint MAGetNearestMapPointFromLine | ( | MAMapPoint | lineStart, |
MAMapPoint | lineEnd, | ||
MAMapPoint | point | ||
) |
取在lineStart和lineEnd组成的线段上距离point距离最近的点
lineStart | 线段起点 |
lineEnd | 线段终点 |
point | 测试点 |
MAMapPoint MAGetNearestMapPointFromPolyline | ( | MAMapPoint | point, |
MAMapPoint * | polyline, | ||
NSUInteger | count | ||
) |
获取某坐标点距线上最近的坐标点
point | 点 |
polyline | 线 |
count | 线里点的数量 |
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 | 多边形点的数量 |
BOOL MAPolylineHitTest | ( | MAMapPoint * | linePoints, |
NSUInteger | count, | ||
MAMapPoint | tappedPoint, | ||
CGFloat | lineWidth | ||
) |
判断线是否被点击选中
linePoints | 构成线的点 |
count | 点的个数 |
tappedPoint | 点击点 |
lineWidth | 线宽,单位:MAMapPoint点 |
typedef NS_ENUM | ( | NSUInteger | , |
MACoordinateType | |||
) |
坐标系类型枚举
< Baidu
< MapBar
< MapABC
< SoSoMap
< AliYun
< GPS
typedef NS_OPTIONS | ( | NSUInteger | , |
MAMapRectCorner | |||
) |
|
extern |
世界范围四边形
|
extern |
世界范围大小