10 #import <CoreGraphics/CoreGraphics.h> 11 #import <CoreLocation/CoreLocation.h> 12 #import <UIKit/UIKit.h> 80 static inline MACoordinateSpan MACoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)
285 extern double MAAreaForPolygon(CLLocationCoordinate2D *coordinates,
int count);
287 static inline MAMapPoint MAMapPointMake(
double x,
double y)
292 static inline MAMapSize MAMapSizeMake(
double width,
double height)
297 static inline MAMapRect MAMapRectMake(
double x,
double y,
double width,
double height)
299 return (
MAMapRect){MAMapPointMake(x, y), MAMapSizeMake(width, height)};
302 static inline double MAMapRectGetMinX(
MAMapRect rect)
307 static inline double MAMapRectGetMinY(
MAMapRect rect)
312 static inline double MAMapRectGetMidX(
MAMapRect rect)
317 static inline double MAMapRectGetMidY(
MAMapRect rect)
322 static inline double MAMapRectGetMaxX(
MAMapRect rect)
327 static inline double MAMapRectGetMaxY(
MAMapRect rect)
332 static inline double MAMapRectGetWidth(
MAMapRect rect)
337 static inline double MAMapRectGetHeight(
MAMapRect rect)
343 return point1.
x == point2.
x && point1.
y == point2.
y;
353 MAMapSizeEqualToSize(rect1.
size, rect2.
size);
356 static inline BOOL MAMapRectIsNull(
MAMapRect rect) {
360 static inline BOOL MAMapRectIsEmpty(
MAMapRect rect) {
364 static inline NSString *MAStringFromMapPoint(
MAMapPoint point) {
365 return [NSString stringWithFormat:
@"{%.1f, %.1f}", point.
x, point.
y];
368 static inline NSString *MAStringFromMapSize(
MAMapSize size) {
369 return [NSString stringWithFormat:
@"{%.1f, %.1f}", size.
width, size.
height];
372 static inline NSString *MAStringFromMapRect(
MAMapRect rect) {
373 return [NSString stringWithFormat:
@"{%@, %@}", MAStringFromMapPoint(rect.
origin), MAStringFromMapSize(rect.
size)];
402 extern CLLocationDirection
MAGetDirectionFromCoords(CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord);
443 + (NSValue *)valueWithMAMapPoint:(
MAMapPoint)mapPoint;
450 + (NSValue *)valueWithMAMapSize:(
MAMapSize)mapSize;
457 + (NSValue *)valueWithMAMapRect:(
MAMapRect)mapRect;
464 + (NSValue *)valueWithMACoordinate:(CLLocationCoordinate2D)coordinate;
MACoordinateSpan span
跨度范围
Definition: MAGeometry.h:34
struct MAMapRect MAMapRect
平面投影矩形结构定义
CLLocationDistance MAMetersBetweenMapPoints(MAMapPoint a, MAMapPoint b)
投影两点之间的距离
MAMapPoint MAGetNearestMapPointFromPolyline(MAMapPoint point, MAMapPoint *polyline, NSUInteger count)
获取某坐标点距线上最近的坐标点
Baidu.
Definition: MAGeometry.h:379
double y
y坐标
Definition: MAGeometry.h:40
BOOL MAMapSizeContainsSize(MAMapSize size1, MAMapSize size2)
判断size1是否包含size2
经度、纬度定义的经纬度跨度范围
Definition: MAGeometry.h:26
BOOL MAMapRectContainsRect(MAMapRect rect1, MAMapRect rect2)
判断矩形rect1是否包含矩形rect2
SoSoMap.
Definition: MAGeometry.h:382
CLLocationCoordinate2D MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("已废弃,使用AMapFoundation中关于坐标转换的接口")))
转换目标经纬度为高德坐标系
Definition: MAGeometry.h:56
void(^ AMapTileProjectionBlock)(int offsetX, int offsetY, int minX, int maxX, int minY, int maxY)
获取墨卡托投影切块回调block,如果是无效的映射,则返回(-1, -1, 0, 0, 0, 0)
Definition: MAGeometry.h:269
平面投影坐标结构定义
Definition: MAGeometry.h:38
void MAGetTileProjectionFromBounds(MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection)
根据所给经纬度区域获取墨卡托投影切块信息
Definition: MAGeometry.h:57
MAMapRect MAMapRectUnion(MAMapRect rect1, MAMapRect rect2)
合并两个MAMapRect
中心点、跨度范围定义的四边形经纬度范围
Definition: MAGeometry.h:32
CLLocationCoordinate2D southWest
西南角经纬度
Definition: MAGeometry.h:22
double MAMapPointsPerMeterAtLatitude(CLLocationDegrees latitude)
1米对应的投影
MAMapRect MAMapRectValue()
返回NSValue对象包含的MAMapRect结构体对象
CLLocationCoordinate2D northEast
东北角经纬度
Definition: MAGeometry.h:21
double width
宽度
Definition: MAGeometry.h:45
double MAAreaBetweenCoordinates(CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest)
经纬度间的面积(单位 平方米)
BOOL MAPolygonContainsPoint(MAMapPoint point, MAMapPoint *polygon, NSUInteger count)
判断点是否在多边形内
Definition: MAGeometry.h:60
CLLocationDegrees longitudeDelta
经度跨度
Definition: MAGeometry.h:28
BOOL MAPolylineHitTest(MAMapPoint *linePoints, NSUInteger count, MAMapPoint tappedPoint, CGFloat lineWidth)
判断线是否被点击选中
MAMapPoint origin
左上角坐标
Definition: MAGeometry.h:51
BOOL MAMapRectContainsPoint(MAMapRect rect, MAMapPoint point)
判断点是否在矩形内
BOOL MACircleContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius)
判断经纬度点是否在圆内
const MAMapRect MAMapRectNull
(MAMapRect){{INFINITY, INFINITY}, {0, 0}};
BOOL MAPolygonContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count)
判断经纬度点是否在多边形内
double MAAreaForPolygon(CLLocationCoordinate2D *coordinates, int count)
计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
MAMapSize size
大小
Definition: MAGeometry.h:52
MAMapSize MAMapSizeValue()
返回NSValue对象包含的MAMapSize结构体对象
BOOL MACircleContainsPoint(MAMapPoint point, MAMapPoint center, double radius)
判断点是否在圆内
double x
x坐标
Definition: MAGeometry.h:39
const MAMapSize MAMapSizeWorld
世界范围大小
MACoordinateRegion MACoordinateRegionMakeWithDistance(CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters)
生成一个新的MACoordinateRegion
Definition: MAGeometry.h:58
CLLocationCoordinate2D MACoordinateForMapPoint(MAMapPoint mapPoint)
平面投影坐标转经纬度坐标
BOOL MAMapRectIntersectsRect(MAMapRect rect1, MAMapRect rect2)
判断两矩形是否相交
GPS.
Definition: MAGeometry.h:385
MapABC.
Definition: MAGeometry.h:381
MAMapPoint MAMapPointForCoordinate(CLLocationCoordinate2D coordinate)
经纬度坐标转平面投影坐标
double height
高度
Definition: MAGeometry.h:46
平面投影大小结构定义
Definition: MAGeometry.h:44
MAMapPoint MAMapPointValue()
返回NSValue对象包含的MAMapPoint结构体对象
struct MAMapSize MAMapSize
平面投影大小结构定义
Google.
Definition: MAGeometry.h:384
MapBar.
Definition: MAGeometry.h:380
CLLocationDistance MAMetersPerMapPointAtLatitude(CLLocationDegrees latitude)
单位投影的距离
struct MACoordinateRegion MACoordinateRegion
中心点、跨度范围定义的四边形经纬度范围
AliYun.
Definition: MAGeometry.h:383
CLLocationCoordinate2D MACoordinateValue()
返回NSValue对象包含的CLLocationCoordinate2D结构体对象
CLLocationDegrees latitudeDelta
纬度跨度
Definition: MAGeometry.h:27
MAMapRectCorner
Definition: MAGeometry.h:55
double MAGetDistanceFromPointToLine(MAMapPoint point, MAMapPoint lineBegin, MAMapPoint lineEnd)
获取点到线的垂直距离
平面投影矩形结构定义
Definition: MAGeometry.h:50
MAMapRect MAMapRectForCoordinateRegion(MACoordinateRegion region)
region转平面投影矩形
CLLocationDirection MAGetDirectionFromCoords(CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord)
获取矢量坐标方向
const MAMapRect MAMapRectZero
(MAMapRect){{0, 0}, {0, 0}}
CLLocationDirection MAGetDirectionFromPoints(MAMapPoint fromPoint, MAMapPoint toPoint)
获取矢量坐标方向
double MAZoomScale
比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint...
Definition: MAGeometry.h:64
MACoordinateRegion MACoordinateRegionForMapRect(MAMapRect rect)
平面投影矩形转region
const MAMapRect MAMapRectWorld
世界范围四边形
东北、西南两个点定义的四边形经纬度范围
Definition: MAGeometry.h:20
MACoordinateType
坐标系类型枚举
Definition: MAGeometry.h:377
struct MACoordinateBounds MACoordinateBounds
东北、西南两个点定义的四边形经纬度范围
MAMapRect MAMapRectInset(MAMapRect rect, double dx, double dy)
获取Inset后的MAMapRect
utils方法,方便c结构体对象和NSValue对象间相互转化
Definition: MAGeometry.h:436
struct MAMapPoint MAMapPoint
平面投影坐标结构定义
Definition: MAGeometry.h:59
CLLocationCoordinate2D center
中心点经纬度
Definition: MAGeometry.h:33
struct MACoordinateSpan MACoordinateSpan
经度、纬度定义的经纬度跨度范围
MAMapPoint MAGetNearestMapPointFromLine(MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point)
取在lineStart和lineEnd组成的线段上距离point距离最近的点