10#import <CoreGraphics/CoreGraphics.h>
11#import <CoreLocation/CoreLocation.h>
12#import <UIKit/UIKit.h>
56 MAMapRectCornerTopLeft = 1 << 0,
57 MAMapRectCornerTopRight = 1 << 1,
58 MAMapRectCornerBottomLeft = 1 << 2,
59 MAMapRectCornerBottomRight = 1 << 3,
60 MAMapRectCornerAllCorners = ~0UL
75 static inline MACoordinateBounds MACoordinateBoundsMake(CLLocationCoordinate2D northEast,CLLocationCoordinate2D southWest)
80 static inline MACoordinateSpan MACoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)
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)];
436@interface NSValue (NSValueMAGeometryExtensions)
443+ (NSValue *)valueWithMAMapPoint:(
MAMapPoint)mapPoint;
450+ (NSValue *)valueWithMAMapSize:(
MAMapSize)mapSize;
457+ (NSValue *)valueWithMAMapRect:(
MAMapRect)mapRect;
464+ (NSValue *)valueWithMACoordinate:(CLLocationCoordinate2D)coordinate;
double MAMapPointsPerMeterAtLatitude(CLLocationDegrees latitude)
1米对应的投影
MAMapRect MAMapRectInset(MAMapRect rect, double dx, double dy)
获取Inset后的MAMapRect
double MAZoomScale
比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint,...
Definition MAGeometry.h:64
const MAMapSize MAMapSizeWorld
世界范围大小
CLLocationCoordinate2D MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("已废弃,使用AMapFoundation中关于坐标转换的接口")))
转换目标经纬度为高德坐标系
MAMapPoint MAMapPointForCoordinate(CLLocationCoordinate2D coordinate)
经纬度坐标转平面投影坐标
const MAMapRect MAMapRectWorld
世界范围四边形
BOOL MACircleContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius)
判断经纬度点是否在圆内
BOOL MAPolylineHitTest(MAMapPoint *linePoints, NSUInteger count, MAMapPoint tappedPoint, CGFloat lineWidth)
判断线是否被点击选中
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
MAMapPoint MAGetNearestMapPointFromPolyline(MAMapPoint point, MAMapPoint *polyline, NSUInteger count)
获取某坐标点距线上最近的坐标点
BOOL MACircleContainsPoint(MAMapPoint point, MAMapPoint center, double radius)
判断点是否在圆内
MAMapPoint MAGetNearestMapPointFromLine(MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point)
取在lineStart和lineEnd组成的线段上距离point距离最近的点
CLLocationDirection MAGetDirectionFromCoords(CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord)
获取矢量坐标方向
MAMapRect MAMapRectUnion(MAMapRect rect1, MAMapRect rect2)
合并两个MAMapRect
MAMapRect MAMapRectForCoordinateRegion(MACoordinateRegion region)
region转平面投影矩形
CLLocationCoordinate2D MACoordinateForMapPoint(MAMapPoint mapPoint)
平面投影坐标转经纬度坐标
void MAGetTileProjectionFromBounds(MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection)
根据所给经纬度区域获取墨卡托投影切块信息
BOOL MAPolygonContainsPoint(MAMapPoint point, MAMapPoint *polygon, NSUInteger count)
判断点是否在多边形内
BOOL MAMapSizeContainsSize(MAMapSize size1, MAMapSize size2)
判断size1是否包含size2
double MAAreaBetweenCoordinates(CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest)
经纬度间的面积(单位 平方米)
const MAMapRect MAMapRectZero
(MAMapRect){{0, 0}, {0, 0}}
const MAMapRect MAMapRectNull
(MAMapRect){{INFINITY, INFINITY}, {0, 0}};
typedef NS_OPTIONS(NSUInteger, MAMapRectCorner)
Definition MAGeometry.h:55
MACoordinateRegion MACoordinateRegionMakeWithDistance(CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters)
生成一个新的MACoordinateRegion
CLLocationDirection MAGetDirectionFromPoints(MAMapPoint fromPoint, MAMapPoint toPoint)
获取矢量坐标方向
BOOL MAMapRectIntersectsRect(MAMapRect rect1, MAMapRect rect2)
判断两矩形是否相交
double MAGetDistanceFromPointToLine(MAMapPoint point, MAMapPoint lineBegin, MAMapPoint lineEnd)
获取点到线的垂直距离
BOOL MAMapRectContainsRect(MAMapRect rect1, MAMapRect rect2)
判断矩形rect1是否包含矩形rect2
MACoordinateRegion MACoordinateRegionForMapRect(MAMapRect rect)
平面投影矩形转region
CLLocationDistance MAMetersPerMapPointAtLatitude(CLLocationDegrees latitude)
单位投影的距离
BOOL MAMapRectContainsPoint(MAMapRect rect, MAMapPoint point)
判断点是否在矩形内
MACoordinateType
Definition MAGeometry.h:378
@ MACoordinateTypeMapABC
MapABC.
Definition MAGeometry.h:381
@ MACoordinateTypeBaidu
Baidu.
Definition MAGeometry.h:379
@ MACoordinateTypeAliYun
AliYun.
Definition MAGeometry.h:383
@ MACoordinateTypeGoogle
Google.
Definition MAGeometry.h:384
@ MACoordinateTypeSoSoMap
SoSoMap.
Definition MAGeometry.h:382
@ MACoordinateTypeMapBar
MapBar.
Definition MAGeometry.h:380
@ MACoordinateTypeGPS
GPS.
Definition MAGeometry.h:385
BOOL MAPolygonContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count)
判断经纬度点是否在多边形内
CLLocationDistance MAMetersBetweenMapPoints(MAMapPoint a, MAMapPoint b)
投影两点之间的距离
double MAAreaForPolygon(CLLocationCoordinate2D *coordinates, int count)
计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
MAMapRect MAMapRectValue()
返回NSValue对象包含的MAMapRect结构体对象
MAMapPoint MAMapPointValue()
返回NSValue对象包含的MAMapPoint结构体对象
MAMapSize MAMapSizeValue()
返回NSValue对象包含的MAMapSize结构体对象
CLLocationCoordinate2D MACoordinateValue()
返回NSValue对象包含的CLLocationCoordinate2D结构体对象
东北、西南两个点定义的四边形经纬度范围
Definition MAGeometry.h:20
CLLocationCoordinate2D northEast
东北角经纬度
Definition MAGeometry.h:21
CLLocationCoordinate2D southWest
西南角经纬度
Definition MAGeometry.h:22
中心点、跨度范围定义的四边形经纬度范围
Definition MAGeometry.h:32
CLLocationCoordinate2D center
中心点经纬度
Definition MAGeometry.h:33
MACoordinateSpan span
跨度范围
Definition MAGeometry.h:34
经度、纬度定义的经纬度跨度范围
Definition MAGeometry.h:26
CLLocationDegrees latitudeDelta
纬度跨度
Definition MAGeometry.h:27
CLLocationDegrees longitudeDelta
经度跨度
Definition MAGeometry.h:28
平面投影坐标结构定义
Definition MAGeometry.h:38
double x
x坐标
Definition MAGeometry.h:39
double y
y坐标
Definition MAGeometry.h:40
平面投影矩形结构定义
Definition MAGeometry.h:50
MAMapPoint origin
左上角坐标
Definition MAGeometry.h:51
MAMapSize size
大小
Definition MAGeometry.h:52
平面投影大小结构定义
Definition MAGeometry.h:44
double width
宽度
Definition MAGeometry.h:45
double height
高度
Definition MAGeometry.h:46