Go to the documentation of this file.
9 #import <CoreGraphics/CoreGraphics.h>
10 #import <CoreLocation/CoreLocation.h>
11 #import <UIKit/UIKit.h>
55 MAMapRectCornerTopLeft = 1 << 0,
56 MAMapRectCornerTopRight = 1 << 1,
57 MAMapRectCornerBottomLeft = 1 << 2,
58 MAMapRectCornerBottomRight = 1 << 3,
59 MAMapRectCornerAllCorners = ~0UL
74 static inline MACoordinateBounds MACoordinateBoundsMake(CLLocationCoordinate2D northEast,CLLocationCoordinate2D southWest)
79 static inline MACoordinateSpan MACoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)
286 static inline MAMapPoint MAMapPointMake(
double x,
double y)
291 static inline MAMapSize MAMapSizeMake(
double width,
double height)
296 static inline MAMapRect MAMapRectMake(
double x,
double y,
double width,
double height)
298 return (
MAMapRect){MAMapPointMake(x, y), MAMapSizeMake(width, height)};
301 static inline double MAMapRectGetMinX(
MAMapRect rect)
306 static inline double MAMapRectGetMinY(
MAMapRect rect)
311 static inline double MAMapRectGetMidX(
MAMapRect rect)
316 static inline double MAMapRectGetMidY(
MAMapRect rect)
321 static inline double MAMapRectGetMaxX(
MAMapRect rect)
326 static inline double MAMapRectGetMaxY(
MAMapRect rect)
331 static inline double MAMapRectGetWidth(
MAMapRect rect)
336 static inline double MAMapRectGetHeight(
MAMapRect rect)
342 return point1.
x == point2.
x && point1.
y == point2.
y;
352 MAMapSizeEqualToSize(rect1.
size, rect2.
size);
355 static inline BOOL MAMapRectIsNull(
MAMapRect rect) {
359 static inline BOOL MAMapRectIsEmpty(
MAMapRect rect) {
363 static inline NSString *MAStringFromMapPoint(
MAMapPoint point) {
364 return [NSString stringWithFormat:
@"{%.1f, %.1f}", point.
x, point.
y];
367 static inline NSString *MAStringFromMapSize(
MAMapSize size) {
368 return [NSString stringWithFormat:
@"{%.1f, %.1f}", size.
width, size.
height];
371 static inline NSString *MAStringFromMapRect(
MAMapRect rect) {
372 return [NSString stringWithFormat:
@"{%@, %@}", MAStringFromMapPoint(rect.
origin), MAStringFromMapSize(rect.
size)];
378 MACoordinateTypeBaidu = 0,
379 MACoordinateTypeMapBar,
380 MACoordinateTypeMapABC,
381 MACoordinateTypeSoSoMap,
382 MACoordinateTypeAliYun,
383 MACoordinateTypeGoogle,
393 extern CLLocationCoordinate2D
MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated(
"已废弃,使用AMapFoundation中关于坐标转换的接口")));
442 + (NSValue *)valueWithMAMapPoint:(
MAMapPoint)mapPoint;
449 + (NSValue *)valueWithMAMapSize:(
MAMapSize)mapSize;
456 + (NSValue *)valueWithMAMapRect:(
MAMapRect)mapRect;
463 + (NSValue *)valueWithMACoordinate:(CLLocationCoordinate2D)coordinate;
CLLocationDirection MAGetDirectionFromCoords(CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord)
获取矢量坐标方向
平面投影大小结构定义
Definition: MAGeometry.h:43
struct MACoordinateBounds MACoordinateBounds
东北、西南两个点定义的四边形经纬度范围
CLLocationCoordinate2D center
中心点经纬度
Definition: MAGeometry.h:32
CLLocationDegrees latitudeDelta
纬度跨度
Definition: MAGeometry.h:26
MAMapRect MAMapRectInset(MAMapRect rect, double dx, double dy)
获取Inset后的MAMapRect
void MAGetTileProjectionFromBounds(MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection)
根据所给经纬度区域获取墨卡托投影切块信息
MAMapPoint MAGetNearestMapPointFromLine(MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point)
取在lineStart和lineEnd组成的线段上距离point距离最近的点
BOOL MAMapRectContainsRect(MAMapRect rect1, MAMapRect rect2)
判断矩形rect1是否包含矩形rect2
typedef NS_OPTIONS(NSUInteger, MAMapRectCorner)
Definition: MAGeometry.h:54
struct MAMapPoint MAMapPoint
平面投影坐标结构定义
CLLocationCoordinate2D MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("已废弃,使用AMapFoundation中关于坐标转换的接口")))
转换目标经纬度为高德坐标系
void(^ AMapTileProjectionBlock)(int offsetX, int offsetY, int minX, int maxX, int minY, int maxY)
获取墨卡托投影切块回调block,如果是无效的映射,则返回(-1, -1, 0, 0, 0, 0)
Definition: MAGeometry.h:268
MAMapRect MAMapRectValue()
返回NSValue对象包含的MAMapRect结构体对象
utils方法,方便c结构体对象和NSValue对象间相互转化
Definition: MAGeometry.h:435
经度、纬度定义的经纬度跨度范围
Definition: MAGeometry.h:25
MAMapRect MAMapRectUnion(MAMapRect rect1, MAMapRect rect2)
合并两个MAMapRect
BOOL MAMapRectContainsPoint(MAMapRect rect, MAMapPoint point)
判断点是否在矩形内
BOOL MACircleContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius)
判断经纬度点是否在圆内
double MAMapPointsPerMeterAtLatitude(CLLocationDegrees latitude)
1米对应的投影
double MAAreaBetweenCoordinates(CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest)
经纬度间的面积(单位 平方米)
struct MAMapRect MAMapRect
平面投影矩形结构定义
struct MACoordinateSpan MACoordinateSpan
经度、纬度定义的经纬度跨度范围
东北、西南两个点定义的四边形经纬度范围
Definition: MAGeometry.h:19
double height
高度
Definition: MAGeometry.h:45
MAMapSize MAMapSizeValue()
返回NSValue对象包含的MAMapSize结构体对象
平面投影矩形结构定义
Definition: MAGeometry.h:49
double x
x坐标
Definition: MAGeometry.h:38
double y
y坐标
Definition: MAGeometry.h:39
CLLocationCoordinate2D southWest
西南角经纬度
Definition: MAGeometry.h:21
BOOL MAPolygonContainsPoint(MAMapPoint point, MAMapPoint *polygon, NSUInteger count)
判断点是否在多边形内
const MAMapRect MAMapRectNull
(MAMapRect){{INFINITY, INFINITY}, {0, 0}};
CLLocationCoordinate2D northEast
东北角经纬度
Definition: MAGeometry.h:20
BOOL MAPolylineHitTest(MAMapPoint *linePoints, NSUInteger count, MAMapPoint tappedPoint, CGFloat lineWidth)
判断线是否被点击选中
MACoordinateRegion MACoordinateRegionMakeWithDistance(CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters)
生成一个新的MACoordinateRegion
double width
宽度
Definition: MAGeometry.h:44
MAMapSize size
大小
Definition: MAGeometry.h:51
struct MACoordinateRegion MACoordinateRegion
中心点、跨度范围定义的四边形经纬度范围
CLLocationCoordinate2D MACoordinateForMapPoint(MAMapPoint mapPoint)
平面投影坐标转经纬度坐标
MAMapPoint origin
左上角坐标
Definition: MAGeometry.h:50
BOOL MAMapRectIntersectsRect(MAMapRect rect1, MAMapRect rect2)
判断两矩形是否相交
BOOL MACircleContainsPoint(MAMapPoint point, MAMapPoint center, double radius)
判断点是否在圆内
CLLocationDistance MAMetersPerMapPointAtLatitude(CLLocationDegrees latitude)
单位投影的距离
BOOL MAPolygonContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count)
判断经纬度点是否在多边形内
double MAAreaForPolygon(CLLocationCoordinate2D *coordinates, int count)
计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
double MAGetDistanceFromPointToLine(MAMapPoint point, MAMapPoint lineBegin, MAMapPoint lineEnd)
获取点到线的垂直距离
MAMapPoint MAMapPointForCoordinate(CLLocationCoordinate2D coordinate)
经纬度坐标转平面投影坐标
const MAMapSize MAMapSizeWorld
世界范围大小
const MAMapRect MAMapRectZero
(MAMapRect){{0, 0}, {0, 0}}
MAMapPoint MAMapPointValue()
返回NSValue对象包含的MAMapPoint结构体对象
double MAZoomScale
比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint,...
Definition: MAGeometry.h:60
const MAMapRect MAMapRectWorld
世界范围四边形
MAMapRect MAMapRectForCoordinateRegion(MACoordinateRegion region)
region转平面投影矩形
struct MAMapSize MAMapSize
平面投影大小结构定义
中心点、跨度范围定义的四边形经纬度范围
Definition: MAGeometry.h:31
MACoordinateRegion MACoordinateRegionForMapRect(MAMapRect rect)
平面投影矩形转region
CLLocationCoordinate2D MACoordinateValue()
返回NSValue对象包含的CLLocationCoordinate2D结构体对象
MAMapPoint MAGetNearestMapPointFromPolyline(MAMapPoint point, MAMapPoint *polyline, NSUInteger count)
获取某坐标点距线上最近的坐标点
MACoordinateSpan span
跨度范围
Definition: MAGeometry.h:33
CLLocationDirection MAGetDirectionFromPoints(MAMapPoint fromPoint, MAMapPoint toPoint)
获取矢量坐标方向
typedef NS_ENUM(NSUInteger, MACoordinateType)
坐标系类型枚举
Definition: MAGeometry.h:376
BOOL MAMapSizeContainsSize(MAMapSize size1, MAMapSize size2)
判断size1是否包含size2
平面投影坐标结构定义
Definition: MAGeometry.h:37
CLLocationDegrees longitudeDelta
经度跨度
Definition: MAGeometry.h:27
CLLocationDistance MAMetersBetweenMapPoints(MAMapPoint a, MAMapPoint b)
投影两点之间的距离
© 2020 高德信息技术有限公司版权所有,保留所有权利。