提交 CocoaPods 依赖目录

This commit is contained in:
2026-07-07 14:43:51 +08:00
parent cdf2266705
commit 854a66689f
444 changed files with 22857 additions and 3 deletions

View File

@ -0,0 +1,78 @@
//
// MAAnimatedAnnotation.h
// MAMapKit
//
// Created by shaobin on 16/12/8.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MAPointAnnotation.h"
#import "MAAnnotationMoveAnimation.h"
///支持动画效果的点标注
///Point annotation with animation support
@interface MAAnimatedAnnotation : MAPointAnnotation<MAAnimatableAnnotation>
///移动方向. 正北为0度顺时针方向。即正东90正南180正西270。since 4.5.0
///Movement direction. 0 degrees is true north, clockwise. That is, 90 degrees is east, 180 degrees is south, and 270 degrees is west. since 4.5.0
@property (nonatomic, assign) CLLocationDirection movingDirection;
/**
@brief 添加移动动画, 第一个添加的动画以当前coordinate为起始点沿传入的coordinates点移动否则以上一个动画终点为起始点. since 4.5.0
Add a movement animation, the first added animation starts from the current coordinate and moves along the passed coordinates, otherwise it starts from the endpoint of the previous animation. since 4.5.0
@param coordinates c数组由调用者负责coordinates指向内存的管理
C array, the caller is responsible for the management of the memory pointed to by coordinates
@param count coordinates数组大小
coordinates array size
@param duration 动画时长0或<0为无动画
animation duration, 0 or <0 means no animation
@param name 名字如不指定可传nil
name, can pass nil if not specified
@param completeCallback 动画完成回调isFinished: 动画是否执行完成
animation completion callback, isFinished: whether the animation is completed
*/
- (MAAnnotationMoveAnimation *)addMoveAnimationWithKeyCoordinates:(CLLocationCoordinate2D *)coordinates
count:(NSUInteger)count
withDuration:(CGFloat)duration
withName:(NSString *)name
completeCallback:(void(^)(BOOL isFinished))completeCallback;
/**
@brief 添加移动动画, 第一个添加的动画以当前coordinate为起始点沿传入的coordinates点移动否则以上一个动画终点为起始点. since 5.4.0
Add a movement animation, the first added animation starts from the current coordinate and moves along the passed coordinates, otherwise it starts from the endpoint of the previous animation. since 5.4.0
@param coordinates c数组由调用者负责coordinates指向内存的管理
C array, the caller is responsible for the management of the memory pointed to by coordinates
@param count coordinates数组大小
coordinates array size
@param duration 动画时长0或<0为无动画
animation duration, 0 or <0 means no animation
@param name 名字如不指定可传nil
name, can pass nil if not specified
@param completeCallback 动画完成回调isFinished: 动画是否执行完成
animation completion callback, isFinished: whether the animation is completed
@param stepCallback 动画每一帧回调
Animation frame callback
*/
- (MAAnnotationMoveAnimation *)addMoveAnimationWithKeyCoordinates:(CLLocationCoordinate2D *)coordinates
count:(NSUInteger)count
withDuration:(CGFloat)duration
withName:(NSString *)name
completeCallback:(void(^)(BOOL isFinished))completeCallback
stepCallback:(void(^)(MAAnnotationMoveAnimation* currentAni))stepCallback;
/**
* @brief 获取所有未完成的移动动画, 返回数组内为MAAnnotationMoveAnimation对象. since 4.5.0
* Retrieve all unfinished move animations, returning an array of MAAnnotationMoveAnimation objects. since 4.5.0
* @return 返回所有移动动画,数组内元素类型为 MAAnnotationMoveAnimation
* Return all move animations, the elements in the array are of type MAAnnotationMoveAnimation
*/
- (NSArray<MAAnnotationMoveAnimation*> *)allMoveAnimations;
/**
* @brief 设置需要开始动画,自定义其他类型动画时需要调用. since 6.0.0
* Settings require starting animation, which needs to be called when customizing other types of animations. since 6.0.0
*/
- (void)setNeedsStart;
@end

View File

@ -0,0 +1,89 @@
//
// MAAnnotation.h
// MAMapKit
//
// Created by yin cai on 11-12-13.
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <CoreGraphics/CoreGraphics.h>
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import "MAGeometry.h"
///该类为标注点的protocol提供了标注类的基本信息函数
///This class is the protocol for annotation points, providing basic information functions for the annotation class
@protocol MAAnnotation <NSObject>
///标注view中心坐标
///the center coordinates of the annotation view
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@optional
///annotation标题
///the annotation title
@property (nonatomic, copy) NSString *title;
///annotation副标题
///the annotation subtitle
@property (nonatomic, copy) NSString *subtitle;
/**
* @brief 设置标注的坐标,在拖拽时会被调用.
* Set the coordinates of the annotation, which will be called during dragging
* @param newCoordinate 新的坐标值
* New coordinate values
*/
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate;
///annotation海拔高度单位米默认0
///the annotation altitude, in meters, default is 0
@property (nonatomic, assign) double altitude;
@end
/**
* 支持动画需要实现的协议. since 4.5.0
*/
/**
* Protocol that needs to be implemented to support animation. since 4.5.0
*/
@protocol MAAnimatableAnnotation <NSObject>
@required
/**
* @brief 动画帧更新回调接口实现者可在内部做更新处理如更新coordinate. since 4.5.0
* Animation frame update callback interface, implementers can perform update processing internally, such as updating coordinates. since 4.5.0
* @param timeDelta 时间步长,单位秒
* time step, unit seconds
*/
- (void)step:(CGFloat)timeDelta;
/**
* @brief 动画是否已完成. 通过此方法判断是否需要将动画annotation移出渲染执行过程。since 4.5.0
* Whether the animation has been completed. This method is used to determine whether the animation annotation needs to be removed from the rendering execution process.since 4.5.0
* @return YES动画已完成NO没有完成
* YES animation is completed, NO not completed
*/
- (BOOL)isAnimationFinished;
/**
* @brief 动画是否可以开始. 通过此方法判断是否需要将动画annotation加入渲染过程已经start且尚未finish的动画标注才会调用step方法。since 6.0.0
* Whether the animation can start. This method determines whether the animation annotation needs to be added to the rendering process. Only animations that have started but not yet finished will call the step method.since 6.0.0
* @return YES 可以开始NO 尚未开始。
* YES can start, NO has not started yet.
*/
- (BOOL)shouldAnimationStart;
@optional
/**
* @brief 动画更新时调用此接口获取annotationView的旋转角度不实现默认为0. since 4.5.0
* This interface is called when the animation is updated to get the rotation angle of the annotationView. If not implemented, it defaults to 0. since 4.5.0
* @return 当前annotation的旋转角度正北为0度顺时针方向。即正东90正南180正西270。
* The rotation angle of the current annotation, with true north as 0 degrees, in a clockwise direction. That is, 90 degrees for due east, 180 degrees for due south, and 270 degrees for due west.
*/
- (CLLocationDirection)rotateDegree;
@end

View File

@ -0,0 +1,81 @@
//
// MAAnnotationMoveAnimation.h
// MAMapKit
//
// Created by shaobin on 16/11/21.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import "MAAnnotation.h"
///annotation移动动画. since 4.5.0
///annotation animation since 4.5.0
@interface MAAnnotationMoveAnimation : NSObject
/**
* @brief 获取动画名字
* get animation name
* @return 添加动画时传入的名字
* name passed when adding animation
*/
- (NSString *)name;
/**
* @brief 获取经纬度坐标点数组
* get latitude and longitude coordinate point array
* @return 返回经纬度坐标点数组
* return latitude and longitude coordinate point array
*/
- (CLLocationCoordinate2D *)coordinates;
/**
* @brief 获取coordinates数组内坐标点个数
* get number of coordinate points in the coordinates array
* @return coordinates数组内坐标点个数
* Number of coordinate points in the coordinates array
*/
- (NSUInteger)count;
/**
* @brief 获取动画时长
* Get animation duration
* @return 动画时长
* Animation duration
*/
- (CGFloat)duration;
/**
* @brief 获取动画已执行的时长
* Get elapsed animation duration
* @return 动画已执行的时长
* Elapsed animation duration
*/
- (CGFloat)elapsedTime;
/**
* @brief 取消
* Cancel
*/
- (void)cancel;
/**
* @brief 是否已取消
* Is canceled
* @return YES已取消NO未取消
* YES canceled, NO not canceled
*/
- (BOOL)isCancelled;
/**
* @brief 获取当前动画已走过点的总个数
* Get the total number of points the current animation has passed
* @return 个数
* count
*/
- (NSInteger)passedPointCount;
@end

View File

@ -0,0 +1,140 @@
//
// MAAnnotationView.h
// MAMapKitDemo
//
// Created by songjian on 13-1-7.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import "MACustomCalloutView.h"
///MAAnnotationView拖动状态
///MAAnnotationView drag state
typedef NS_ENUM(NSInteger, MAAnnotationViewDragState)
{
MAAnnotationViewDragStateNone = 0, ///< 静止状态 stationary state
MAAnnotationViewDragStateStarting, ///< 开始拖动 start dragging
MAAnnotationViewDragStateDragging, ///< 拖动中 dragging
MAAnnotationViewDragStateCanceling, ///< 取消拖动 cancel dragging
MAAnnotationViewDragStateEnding ///< 拖动结束 end dragging
};
@protocol MAAnnotation;
///标注view
///annotation view
@interface MAAnnotationView : UIView
///复用标识
///reuse identifier
@property (nonatomic, readonly, copy) NSString *reuseIdentifier;
///z值大值在上默认为0。类似CALayer的zPosition。zIndex属性只有在viewForAnnotation或者didAddAnnotationViews回调中设置有效。
///z-value, larger values on top, default is 0. Similar to CALayer's zPosition. The zIndex property only takes effect when set in the viewForAnnotation or didAddAnnotationViews callbacks.
@property (nonatomic, assign) NSInteger zIndex;
///关联的annotation
///associated annotation
@property (nonatomic, strong) id <MAAnnotation> annotation;
///显示的image
///Displayed image
@property (nonatomic, strong) UIImage *image;
///image所对应的UIImageView since 5.0.0
///UIImageView corresponding to the image. since 5.0.0
@property (nonatomic, strong, readonly) UIImageView *imageView;
///自定制弹出框view, 用于替换默认弹出框. 注意:此弹出框不会触发-(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0
///Custom pop-up view, used to replace the default pop-up. Note: This pop-up will not trigger -(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0
@property (nonatomic, strong) MACustomCalloutView *customCalloutView;
///annotationView的中心默认位于annotation的坐标位置可以设置centerOffset改变view的位置正的偏移使view朝右下方移动负的朝左上方单位是屏幕坐标
///The center of the annotationView is by default located at the coordinate position of the annotation. You can set the centerOffset to change the position of the view. A positive offset moves the view towards the lower right, while a negative one moves it towards the upper left, with units in screen coordinates.
@property (nonatomic) CGPoint centerOffset;
///弹出框默认位于view正中上方可以设置calloutOffset改变view的位置正的偏移使view朝右下方移动负的朝左上方单位是屏幕坐标
///The pop-up box is by default located above the center of the view, and the position of the view can be changed by setting calloutOffset. A positive offset moves the view to the lower right, and a negative offset moves it to the upper left, in screen coordinates.
@property (nonatomic) CGPoint calloutOffset;
///默认为YES,当为NO时view忽略触摸事件
///Default is YES, when NO the view ignores touch events
@property (nonatomic, getter=isEnabled) BOOL enabled;
///是否高亮
///Whether to highlight
@property (nonatomic, getter=isHighlighted) BOOL highlighted;
///设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法
///Set whether it is in the selected state. To select externally, use the selectAnnotation method of mapView
@property (nonatomic, getter=isSelected) BOOL selected;
///是否允许弹出callout
///Whether to allow callout to pop up
@property (nonatomic) BOOL canShowCallout;
///显示在默认弹出框左侧的view
///The view displayed on the left side of the default popup
@property (nonatomic, strong) UIView *leftCalloutAccessoryView;
///显示在默认弹出框右侧的view
///the view displayed on the right side of the default popup
@property (nonatomic, strong) UIView *rightCalloutAccessoryView;
///是否支持拖动
///whether dragging is supported
@property (nonatomic, getter=isDraggable) BOOL draggable;
///当前view的拖动状态
///the dragging state of the current view
@property (nonatomic) MAAnnotationViewDragState dragState;
///弹出默认弹出框时是否允许地图调整到合适位置来显示弹出框默认为YES
///whether the map is allowed to adjust to a suitable position to display the popup when the default popup is displayed, default is YES
@property (nonatomic) BOOL canAdjustPositon;
///是否开启碰撞检测默认为NO。开启后标注会在地图缩放和密集显示时进行碰撞检测避免重叠显示
///Whether to enable collision detection, default is NO. When enabled, annotations will perform collision detection during map zooming and dense display to avoid overlapping display
@property (nonatomic) BOOL isOpenCollisionDetection;
/**
* @brief 设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法
* Set whether it is in the selected state, if you want to select it externally, use the selectAnnotation method of mapView
* @param selected 是否选中
* whether it is selected
* @param animated 是否使用动画效果
* whether to use animation effects
*/
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
/**
* @brief 初始化并返回一个annotation view
* Initialize and return an annotation view
* @param annotation 关联的annotation对象
* associated annotation object
* @param reuseIdentifier 如果要重用view,传入一个字符串,否则设为nil,建议重用view
* if you want to reuse the view, pass a string, otherwise set it to nil, it is recommended to reuse the view
* @return 初始化成功则返回annotation view,否则返回nil
* Returns the annotation view if initialization is successful, otherwise returns nil
*/
- (id)initWithAnnotation:(id <MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier;
/**
* @brief 当从reuse队列里取出时被调用, 子类重新必须调用super
* Called when taken out of the reuse queue, the subclass must call super
*/
- (void)prepareForReuse;
/**
* @brief 设置view的拖动状态
* set the drag state of the view
* @param newDragState 新的拖动状态
* the new drag state
* @param animated 是否使用动画动画
* whether to use animation
*/
- (void)setDragState:(MAAnnotationViewDragState)newDragState animated:(BOOL)animated;
@end

View File

@ -0,0 +1,49 @@
//
// MAArc.h
// MAMapKit
//
// Created by liubo on 2018/4/10.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_ARC
#import "MAShape.h"
#import "MAOverlay.h"
///该类用于定义一个圆弧, 通常MAArc是MAArcRenderer的model
///This class is used to define an arc, usually MAArc serves as the model for MAArcRenderer
@interface MAArc : MAShape <MAOverlay>
///起点经纬度坐标,无效坐标按照{00}处理
///Starting point latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
@property (nonatomic, assign) CLLocationCoordinate2D startCoordinate;
///途径点经纬度坐标,无效坐标按照{00}处理
///Waypoint latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
@property (nonatomic, assign) CLLocationCoordinate2D passedCoordinate;
///终点经纬度坐标,无效坐标按照{00}处理
///Destination latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
@property (nonatomic, assign) CLLocationCoordinate2D endCoordinate;
/**
* @brief 根据起点、途经点和终点生成圆弧
* Generate an arc based on the starting point, waypoints, and endpoint
* @param startCoordinate 起点的经纬度坐标,无效坐标按照{00}处理
* Starting point latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
* @param passedCoordinate 途径点的经纬度坐标,无效坐标按照{00}处理
* Waypoint latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
* @param endCoordinate 终点的经纬度坐标,无效坐标按照{00}处理
* Destination latitude and longitude coordinates, invalid coordinates are treated as {0, 0}
* @return 新生成的圆弧
* the newly generated arc
*/
+ (instancetype)arcWithStartCoordinate:(CLLocationCoordinate2D)startCoordinate
passedCoordinate:(CLLocationCoordinate2D)passedCoordinate
endCoordinate:(CLLocationCoordinate2D)endCoordinate;
@end
#endif

View File

@ -0,0 +1,35 @@
//
// MAArcRenderer.h
// MAMapKit
//
// Created by liubo on 2018/4/10.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_ARC
#import "MAArc.h"
#import "MAOverlayPathRenderer.h"
///此类用于绘制MAArc,可以通过MAOverlayPathRenderer修改其stroke attributes
///This class is used to draw MAArc, and its stroke attributes can be modified via MAOverlayPathRenderer
@interface MAArcRenderer : MAOverlayPathRenderer
///关联的MAArc model
///Associated MAArc model
@property (nonatomic, readonly) MAArc *arc;
/**
* @brief 根据指定的MAArc生成一个圆弧Renderer
* Generate an arc Renderer based on the specified MAArc
* @param arc 指定MAArc
* Specify MAArc
* @return 新生成的圆弧Renderer
* The newly generated arc Renderer
*/
- (instancetype)initWithArc:(MAArc *)arc;
@end
#endif

View File

@ -0,0 +1,18 @@
//
// MABaseEngineOverlay.h
// MAMapKit
//
// Created by linshiqing on 2024/1/23.
// Copyright © 2024 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MABaseEngineOverlay : NSObject
/// 移除Overlay Remove Overlay
- (void)removeOverlay;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,31 @@
//
// MABaseOverlay.h
// MAMapKit
//
// Created by cuishaobin on 2020/6/17.
// Copyright © 2020 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MAOverlay.h"
NS_ASSUME_NONNULL_BEGIN
@interface MABaseOverlay : NSObject<MAOverlay> {
double _altitude; ///<海拔 Elevation
}
///返回区域中心坐标
///Return to regional center coordinates
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///区域外接矩形
///Regional bounding rectangle
@property (nonatomic, assign) MAMapRect boundingMapRect;
///海拔单位米默认0
///Elevation, in meters, default 0
@property (nonatomic, assign) double altitude;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,64 @@
//
// MACircle.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
#import "MAConfig.h"
#import "MAShape.h"
#import "MAOverlay.h"
#import "MAGeometry.h"
///该类用于定义一个圆, 通常MACircle是MACircleView的model
///This class is used to define a circle, usually MACircle is the model of MACircleView
@interface MACircle : MAShape <MAOverlay>
///设置中空区域用来创建中间带空洞的复杂图形。注意传入的overlay只支持MAPolgon类型和MACircle类型,不支持与此circle边相交或在circle外部,不支持hollowShapes彼此间相交,和空洞顺序有关,不支持嵌套. since 5.5.0
///Set the hollow area to create complex shapes with holes in the middle. Note: The overlay passed in only supports MAPolygon type and MACircle type,Intersection with the edge of this circle or being outside the circle is not supported, intersection between hollowShapes is not supported, it is related to the order of voids, nesting is not supported. since 5.5.0
@property (nonatomic, strong) NSArray<id<MAOverlay>> *hollowShapes;
///中心点经纬度坐标,无效坐标按照{00}处理
///Center point latitude and longitude coordinates, invalid coordinates are processed as {0, 0}
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///半径,单位:米 负数按照0处理
///Radius, unit: meters, negative numbers are treated as 0
@property (nonatomic, assign) CLLocationDistance radius;
/**
* @brief 根据中心点和半径生成圆
* Generate a circle based on the center point and radius
* @param coord 中心点的经纬度坐标,无效坐标按照{00}处理
* Latitude and longitude coordinates of the center point, invalid coordinates are treated as {0, 0}
* @param radius 半径,单位:米, 负数按照0处理
* Radius, unit: meters, negative values are treated as 0
* @return 新生成的圆
* Newly generated circle
*/
+ (instancetype)circleWithCenterCoordinate:(CLLocationCoordinate2D)coord
radius:(CLLocationDistance)radius;
/**
* @brief 根据map rect生成圆
* Generate a circle based on map rect
* @param mapRect mapRect 圆的最小外界矩形
* mapRect is the minimum bounding rectangle of the circle
* @return 新生成的圆
* the newly generated circle
*/
+ (instancetype)circleWithMapRect:(MAMapRect)mapRect;
/**
* @brief 设置圆的中心点和半径. since 5.0.0
* set the center point and radius of the circle. since 5.0.0
* @param coord 中心点的经纬度坐标,无效坐标按照{00}处理
* Latitude and longitude coordinates of the center point, invalid coordinates are treated as {0, 0}
* @param radius 半径,单位:米 负数按照0处理
* Radius, unit: meters, negative values are treated as 0
* @return 是否设置成功
* whether the setting is successful
*/
- (BOOL)setCircleWithCenterCoordinate:(CLLocationCoordinate2D)coord radius:(CLLocationDistance)radius;
@end

View File

@ -0,0 +1,31 @@
//
// MACircleRenderer.h
// MAMapKit
//
// Created by yin cai on 11-12-30.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MACircle.h"
#import "MAOverlayPathRenderer.h"
///该类是MACircle的显示圆Renderer,可以通过MAOverlayPathRenderer修改其fill和stroke attributes
///This class is the renderer for MACircle's display circle. Its fill and stroke attributes can be modified via MAOverlayPathRenderer
@interface MACircleRenderer : MAOverlayPathRenderer
///关联的MAcirlce model
///Associated MAcircle model
@property (nonatomic, readonly) MACircle *circle;
/**
* @brief 根据指定圆生成对应的Renderer
* Generate corresponding Renderer based on specified circle
* @param circle 指定的MACircle model
* Specified MACircle model
* @return 生成的Renderer
* Generated Renderer
*/
- (instancetype)initWithCircle:(MACircle *)circle;
@end

View File

@ -0,0 +1,146 @@
/*
* @Author: hunk.lc
* @Date: 2022-08-17 15:09:58
* @Description:
*/
#pragma once
#pragma mark - iOS 平台特有的宏
#ifndef MA_INCLUDE_OFFLINE
#define MA_INCLUDE_OFFLINE 1
#endif
#ifndef MA_INCLUDE_TRACE_CORRECT
#define MA_INCLUDE_TRACE_CORRECT 1
#endif
#ifndef MA_INCLUDE_INDOOR
#define MA_INCLUDE_INDOOR 1
#endif
#ifndef MA_INCLUDE_CACHE
#define MA_INCLUDE_CACHE 1
#endif
#ifndef MA_INCLUDE_CUSTOM_MAP_STYLE
#define MA_INCLUDE_CUSTOM_MAP_STYLE 1
#endif
#ifndef MA_INCLUDE_WORLD_EN_MAP
#define MA_INCLUDE_WORLD_EN_MAP 1
#endif
#ifndef MA_INCLUDE_OVERLAY_TILE
#define MA_INCLUDE_OVERLAY_TILE 1
#endif
#ifndef MA_INCLUDE_OVERLAY_HEATMAP
#define MA_INCLUDE_OVERLAY_HEATMAP 1
#endif
#ifndef MA_INCLUDE_QUARDTREE
#define MA_INCLUDE_QUARDTREE 1
#endif
#ifndef MA_INCLUDE_OVERLAY_ARC
#define MA_INCLUDE_OVERLAY_ARC 1
#endif
#ifndef MA_INCLUDE_OVERLAY_CUSTOMBUILDING
#define MA_INCLUDE_OVERLAY_CUSTOMBUILDING 1
#endif
#ifndef MA_INCLUDE_OVERLAY_GROUND
#define MA_INCLUDE_OVERLAY_GROUND 1
#endif
#ifndef MA_INCLUDE_OVERLAY_GEODESIC
#define MA_INCLUDE_OVERLAY_GEODESIC 1
#endif
#ifndef MA_INCLUDE_OVERLAY_MAMultiPolyline
#define MA_INCLUDE_OVERLAY_MAMultiPolyline 1
#endif
#ifndef MA_INCLUDE_OVERLAY_MAMultiPoint
#define MA_INCLUDE_OVERLAY_MAMultiPoint 1
#endif
#ifndef MA_INCLUDE_OVERLAY_ParticleSystem
#define MA_INCLUDE_OVERLAY_ParticleSystem 1
#endif
#ifndef MA_INCLUDE_OVERSEA
#define MA_INCLUDE_OVERSEA 0
#endif
#ifndef MA_ENABLE_ThirdPartyLog
#define MA_ENABLE_ThirdPartyLog 0
#endif
//标识是否支持异步等待引擎线程池结束
#ifndef MA_INCLUDE_END_THEADPOOL_ASYN
#define MA_INCLUDE_END_THEADPOOL_ASYN 1
#endif
//国际图
#ifndef AMC_INCLUDE_Global
#define AMC_INCLUDE_Global 1
#endif
#pragma mark - iOS和android 双平台都用到的宏
#ifndef AMC_INCLUDE_GNaviSearch
#define AMC_INCLUDE_GNaviSearch 1
#endif
#ifndef AMC_INCLUDE_MAMapVectorOverlay
#define AMC_INCLUDE_MAMapVectorOverlay 1
#endif
//自定义楼块
#ifndef AMC_INCLUDE_CustomBuilding
#define AMC_INCLUDE_CustomBuilding 1
#endif
//粒子系统
#ifndef AMC_INCLUDE_ParticleSystem
#define AMC_INCLUDE_ParticleSystem 1
#endif
// 3d模型
#ifndef MA_INCLUDE_3DModel
#define MA_INCLUDE_3DModel 1
#endif
// gltf
#ifndef FEATURE_GLTF
#define FEATURE_GLTF 1
#endif
// mvt
#ifndef FEATURE_MVT
#define FEATURE_MVT 1
#endif
// 3dtiles
#ifndef FEATURE_3DTiles
#define FEATURE_3DTiles 1
#endif
// location
#ifndef FEATURE_LOCATION
#define FEATURE_LOCATION 1
#endif
// engine routeoverlay
#ifndef FEATURE_ROUTE_OVERLAY
#define FEATURE_ROUTE_OVERLAY 1
#endif
// arrowOverlay
#ifndef FEATURE_ARROWOVERLAY
#define FEATURE_ARROWOVERLAY 1
#endif

View File

@ -0,0 +1,101 @@
//
// MACustomBuildingOverlay.h
// MAMapKit
//
// Created by liubo on 2018/5/23.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_CUSTOMBUILDING
#import "MAShape.h"
#import "MAOverlay.h"
#import "MAMultiPoint.h"
#pragma mark - MACustomBuildingOverlayOption
///该类用于定义一个楼块显示选项. since 6.3.0
///This class is used to define a building block display option. since 6.3.0
@interface MACustomBuildingOverlayOption : MAMultiPoint
///楼块的高度. 修改该属性会使option范围内的所有楼块为同一个高度. (范围 (-1 U [1, 1000]). 默认-1,显示为默认高度.)
///The height of the building block. Modifying this property will set all building blocks within the option scope to the same height. (Range (-1 U [1, 1000]). Default -1, displayed as the default height.
@property (nonatomic, assign) CGFloat height;
///楼块的高度缩放比例. 修改该属性会使option范围内的所有楼块高度放大或者缩小heightScale倍. (默认1. 如果指定了height则此值将被忽略.)
///The height scaling ratio of the building blocks. Modifying this attribute will scale the height of all building blocks within the option range by a factor of heightScale. (Default is 1. If height is specified, this value will be ignored.)
@property (nonatomic, assign) CGFloat heightScale;
///楼块的顶面颜色. (默认[UIColor lightGrayColor], 不支持透明度)
///The top color of the building block. (Default [UIColor lightGrayColor], transparency not supported)
@property (nonatomic, strong) UIColor *topColor;
///楼块的侧面颜色. (默认[UIColor darkGrayColor], 不支持透明度)
///The side color of the building block. (Default [UIColor darkGrayColor], transparency not supported)
@property (nonatomic, strong) UIColor *sideColor;
///option选项是否可见. (默认YES)
///Whether the option is visible. (Default: YES)
@property (nonatomic, assign) BOOL visibile;
/**
* @brief 根据经纬度坐标数据生成楼块显示选项option
* Generate building block display options based on latitude and longitude coordinate data
* @param coords 经纬度坐标点数据,coords对应的内存会拷贝,调用者负责该内存的释放
* Latitude and longitude coordinate point data, the memory corresponding to coords will be copied, the caller is responsible for releasing this memory
* @param count 经纬度坐标点数组个数
* Number of latitude and longitude coordinate points array
* @return 新生成的楼块显示选项option
* Newly generated building block display option
*/
+ (instancetype)optionWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
* @brief 重新设置option范围.
* Reset the option range
* @param coords 指定的经纬度坐标点数组, C数组内部会做copy调用者负责内存管理
* Specified latitude and longitude coordinate points array, C array, internal copy will be made, caller is responsible for memory management
* @param count 坐标点的个数
* Number of coordinate points
* @return 是否设置成功
* Whether the setup was successful
*/
- (BOOL)setOptionWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
@end
#pragma mark - MACustomBuildingOverlay
///该类用于定义一个自定义楼块MACustomBuildingOverlay, 通常MACustomBuildingOverlay是MACustomBuildingOverlayRenderer的model.(注意: 自定义楼块仅支持在zoomLevel>=15级时显示) since 6.3.0
///This class is used to define a custom building block MACustomBuildingOverlay,Generally, MACustomBuildingOverlay is the model of MACustomBuildingOverlayRenderer. (Note: Custom buildings are only displayed when zoomLevel>=15) since 6.3.0
@interface MACustomBuildingOverlay : MAShape<MAOverlay>
///默认的楼块显示option, 将显示所有的楼块. (如果不需要显示所有的楼块,可以设置defaultOption.visibile = NO)
///The default building block display option will show all building blocks. (If you do not need to display all building blocks, you can set defaultOption.visible = NO)
@property (nonatomic, readonly) MACustomBuildingOverlayOption *defaultOption;
///当前自定义的楼块显示options. (options按添加顺序, 后添加的在最上层显示)
///Current customized building block display options. (Options are displayed in the order they are added, with the last added on top)
@property (nonatomic, readonly) NSArray<MACustomBuildingOverlayOption *> *customOptions;
/**
* @brief 增加自定义楼块显示的option
* Add custom building display options
* @param option 要增加的自定义楼块显示option
* Custom building display options to be added
*/
- (void)addCustomOption:(MACustomBuildingOverlayOption *)option;
/**
* @brief 移除自定义楼块显示的option
* Remove the option for displaying custom building blocks
* @param option 要移除的自定义楼块显示option
* The custom building block display option to be removed
*/
- (void)removeCustomOption:(MACustomBuildingOverlayOption *)option;
@end
#endif

View File

@ -0,0 +1,34 @@
//
// MACustomBuildingOverlayRenderer.h
// MAMapKit
//
// Created by liubo on 2018/5/23.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_CUSTOMBUILDING
#import "MAOverlayRenderer.h"
#import "MACustomBuildingOverlay.h"
///该类是MACustomBuildingOverlay的显示Renderer. since 6.3.0
///This class is the renderer for MACustomBuildingOverlay display. since 6.3.0
@interface MACustomBuildingOverlayRenderer : MAOverlayRenderer
///关联的MACustomBuildingOverlay model
///Associated with the MACustomBuildingOverlay model
@property (nonatomic, readonly) MACustomBuildingOverlay *customBuildingOverlay;
/**
* @brief 根据指定MACustomBuildingOverlay生成对应的Renderer
* Generate the corresponding Renderer based on the specified MACustomBuildingOverlay
* @param customBuildingOverlay 指定的MACustomBuildingOverlay model
* The specified MACustomBuildingOverlay model
* @return 生成的Renderer
* The generated Renderer
*/
- (instancetype)initWithCustomBuildingOverlay:(MACustomBuildingOverlay *)customBuildingOverlay;
@end
#endif

View File

@ -0,0 +1,35 @@
//
// MACustomCalloutView.h
// MAMapKit
//
// Created by shaobin on 17/1/6.
// Copyright © 2017年 Amap. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MAConfig.h"
///自定义annotationView的弹出框. 注意:不会触发-(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0
///Customize the popup of annotationView. Note: It will not trigger -(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0
@interface MACustomCalloutView : UIView
///init时传入的customView since 5.0.0
///CustomView passed during init since 5.0.0
@property (nonatomic, strong, readonly) UIView *customView;
///用户自定义数据,内部不做处理 since 5.0.0
///User-defined data, no internal processing since 5.0.0
@property (nonatomic, strong) id userData;
/**
* @brief 初始化并返回一个MACustomCalloutView since 5.0.0
* Initialize and return a MACustomCalloutView since 5.0.0
* @param customView 自定义View不能为nil
* Custom View, cannot be nil
* @return 初始化成功则返回MACustomCalloutView,否则返回nil
* Returns MACustomCalloutView if initialization is successful, otherwise returns nil
*/
- (id)initWithCustomView:(UIView *)customView;
@end

View File

@ -0,0 +1,68 @@
//
// MAGeodesicPolyline.h
// MapKit_static
//
// Created by songjian on 13-10-23.
// Copyright © 2016 Amap. All rights reserved.
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_GEODESIC
#import "MAPolyline.h"
///大地曲线
///Earth's curvature
@interface MAGeodesicPolyline : MAPolyline
/**
* @brief 根据MAMapPoints生成大地曲线
* Generate geodesic curves based on MAMapPoints
* @param points MAMapPoint点
* MAMapPoint points
* @param count 点的个数
* Number of points
* @return 生成的大地曲线
* Generated geodesic curves
*/
+ (instancetype)polylineWithPoints:(MAMapPoint *)points count:(NSUInteger)count;
/**
* @brief 根据经纬度生成大地曲线
* Generate geodesic curves based on latitude and longitude
* @param coords 经纬度
* Latitude and longitude
* @param count 点的个数
* Number of points
* @return 生成的大地曲线
* Generated geodesic curves
*/
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
* @brief 重新设置坐标点. since 5.0.0
* Reset coordinate points. since 5.0.0
* @param points 指定的直角坐标点数组C数组内部会做copy调用者负责内存管理。
* Specified rectangular coordinate points array, C array, internal copy will be made, caller is responsible for memory management
* @param count 坐标点的个数
* Number of coordinate points
* @return 是否设置成功
* Whether the setup is successful
*/
- (BOOL)setPolylineWithPoints:(MAMapPoint *)points count:(NSInteger)count;
/**
* @brief 重新设置坐标点. since 5.0.0
* Reset coordinate points. since 5.0.0
* @param coords 指定的经纬度坐标点数组C数组内部会做copy调用者负责内存管理
* Specified array of latitude and longitude coordinate points, C array, internal copy will be performed, caller is responsible for memory management
* @param count 坐标点的个数
* Number of coordinate points
* @return 是否设置成功
* Whether the setup is successful
*/
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger)count;
@end
#endif

View File

@ -0,0 +1,634 @@
//
// MAGeometry.h
// MAMapKit
//
// Created by AutoNavi.
// Copyright (c) 2013年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <CoreGraphics/CoreGraphics.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
#ifdef __cplusplus
extern "C" {
#endif
///东北、西南两个点定义的四边形经纬度范围
///Latitude and longitude range of the quadrilateral defined by the northeast and southwest points
typedef struct MACoordinateBounds{
CLLocationCoordinate2D northEast; ///< 东北角经纬度 Latitude and longitude of the northeast corner
CLLocationCoordinate2D southWest; ///< 西南角经纬度 Latitude and longitude of the southwest corner
} MACoordinateBounds;
///经度、纬度定义的经纬度跨度范围
///Latitude and longitude span range defined by longitude and latitude
typedef struct MACoordinateSpan{
CLLocationDegrees latitudeDelta; ///< 纬度跨度 Latitude span
CLLocationDegrees longitudeDelta; ///< 经度跨度 Longitude span
} MACoordinateSpan;
///中心点、跨度范围定义的四边形经纬度范围
///Quadrilateral latitude and longitude range defined by center point and span
typedef struct MACoordinateRegion{
CLLocationCoordinate2D center; ///< 中心点经纬度 Center point latitude and longitude
MACoordinateSpan span; ///< 跨度范围 Span range
} MACoordinateRegion;
///平面投影坐标结构定义
///Plane projection coordinate structure definition
typedef struct MAMapPoint{
double x; ///<x坐标 x coordinate
double y; ///<y坐标 y coordinate
} MAMapPoint;
///平面投影大小结构定义
///Plane projection size structure definition
typedef struct MAMapSize{
double width; ///<宽度 Width
double height; ///<高度 Height
} MAMapSize;
///平面投影矩形结构定义
///Planar projection rectangle structure definition
typedef struct MAMapRect{
MAMapPoint origin; ///<左上角坐标 Top-left corner coordinates
MAMapSize size; ///<大小 Size
} MAMapRect;
typedef NS_OPTIONS(NSUInteger, MAMapRectCorner) {
MAMapRectCornerTopLeft = 1 << 0,
MAMapRectCornerTopRight = 1 << 1,
MAMapRectCornerBottomLeft = 1 << 2,
MAMapRectCornerBottomRight = 1 << 3,
MAMapRectCornerAllCorners = ~0UL
};
///比例关系:MAZoomScale = Screen Point / MAMapPoint, 当MAZoomScale = 1时, 1 screen point = 1 MAMapPoint, 当MAZoomScale = 0.5时, 1 screen point = 2 MAMapPoints
///Proportional relationship: MAZoomScale = Screen Point / MAMapPoint, when MAZoomScale = 1, 1 screen point = 1 MAMapPoint, when MAZoomScale = 0.5, 1 screen point = 2 MAMapPoints
typedef double MAZoomScale;
///世界范围大小
///World extent size
extern const MAMapSize MAMapSizeWorld;
///世界范围四边形
///World extent quadrilateral
extern const MAMapRect MAMapRectWorld;
///(MAMapRect){{INFINITY, INFINITY}, {0, 0}};
extern const MAMapRect MAMapRectNull;
///(MAMapRect){{0, 0}, {0, 0}}
extern const MAMapRect MAMapRectZero;
static inline MACoordinateBounds MACoordinateBoundsMake(CLLocationCoordinate2D northEast,CLLocationCoordinate2D southWest)
{
return (MACoordinateBounds){northEast, southWest};
}
static inline MACoordinateSpan MACoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)
{
return (MACoordinateSpan){latitudeDelta, longitudeDelta};
}
static inline MACoordinateRegion MACoordinateRegionMake(CLLocationCoordinate2D centerCoordinate, MACoordinateSpan span)
{
return (MACoordinateRegion){centerCoordinate, span};
}
/**
* @brief 生成一个新的MACoordinateRegion
* Generate a new MACoordinateRegion
* @param centerCoordinate 中心点坐标
* center coordinate
* @param latitudinalMeters 垂直跨度(单位 米)
* vertical span (in meters)
* @param longitudinalMeters 水平跨度(单位 米)
* horizontal span (in meters)
* @return 新的MACoordinateRegion
* new MACoordinateRegion
*/
extern MACoordinateRegion MACoordinateRegionMakeWithDistance(CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters);
/**
* @brief 经纬度坐标转平面投影坐标
* Convert latitude and longitude coordinates to planar projection coordinates
* @param coordinate 要转化的经纬度坐标
* Latitude and longitude coordinates to be converted
* @return 平面投影坐标
* Planar projection coordinates
*/
extern MAMapPoint MAMapPointForCoordinate(CLLocationCoordinate2D coordinate);
/**
* @brief 平面投影坐标转经纬度坐标
* Convert planar projection coordinates to latitude and longitude coordinates
* @param mapPoint 要转化的平面投影坐标
* Planar projection coordinates to be converted
* @return 经纬度坐标
* Latitude and longitude coordinates
*/
extern CLLocationCoordinate2D MACoordinateForMapPoint(MAMapPoint mapPoint);
/**
* @brief 平面投影矩形转region
* Planar projection rectangle to region
* @param rect 要转化的平面投影矩形
* Planar projection rectangle to be converted
* @return region
*/
extern MACoordinateRegion MACoordinateRegionForMapRect(MAMapRect rect);
/**
* @brief region转平面投影矩形
* Region to planar projection rectangle
* @param region region 要转化的region
* Region to be converted
* @return 平面投影矩形
* Planar projection rectangle
*/
extern MAMapRect MAMapRectForCoordinateRegion(MACoordinateRegion region);
/**
* @brief 单位投影的距离
* Unit projection distance
* @param latitude 经纬度
* Latitude and longitude
* @return 距离
* Distance
*/
extern CLLocationDistance MAMetersPerMapPointAtLatitude(CLLocationDegrees latitude);
/**
* @brief 1米对应的投影
* Projection corresponding to 1 meter
* @param latitude 经纬度
* Latitude and longitude
* @return 1米对应的投影
* Projection corresponding to 1 meter
*/
extern double MAMapPointsPerMeterAtLatitude(CLLocationDegrees latitude);
/**
* @brief 投影两点之间的距离
* Distance between two projection points
* @param a a点
* Point a
* @param b b点
* Point b
* @return 距离
* Distance
*/
extern CLLocationDistance MAMetersBetweenMapPoints(MAMapPoint a, MAMapPoint b);
/**
* @brief 经纬度间的面积(单位 平方米)
* Area between latitude and longitude (unit: square meters)
* @param northEast 东北经纬度
* Northeast latitude and longitude
* @param southWest 西南经纬度
* Southwest latitude and longitude
* @return 面积
* Area
*/
extern double MAAreaBetweenCoordinates(CLLocationCoordinate2D northEast, CLLocationCoordinate2D southWest);
/**
* @brief 获取Inset后的MAMapRect
* Get the MAMapRect after Inset
* @param rect rect
* @param dx x点
* Point x
* @param dy y点
* Point y
* @return MAMapRect
*/
extern MAMapRect MAMapRectInset(MAMapRect rect, double dx, double dy);
/**
* @brief 合并两个MAMapRect
* Merge two MAMapRects
* @param rect1 rect1
* @param rect2 rect2
* @return 合并后的rect
* Merged rect
*/
extern MAMapRect MAMapRectUnion(MAMapRect rect1, MAMapRect rect2);
/**
* @brief 判断size1是否包含size2
* Determine if size1 contains size2
* @param size1 size1
* @param size2 size2
* @return 判断结果
* Judgment result
*/
extern BOOL MAMapSizeContainsSize(MAMapSize size1, MAMapSize size2);
/**
* @brief 判断点是否在矩形内
* Determine if the point is inside the rectangle
* @param rect 矩形rect
* Rectangle rect
* @param point 点
* Point
* @return 判断结果
* Judgment result
*/
extern BOOL MAMapRectContainsPoint(MAMapRect rect, MAMapPoint point);
/**
* @brief 判断两矩形是否相交
* Determine if two rectangles intersect
* @param rect1 rect1
* @param rect2 rect2
* @return 判断结果
* Judgment result
*/
extern BOOL MAMapRectIntersectsRect(MAMapRect rect1, MAMapRect rect2);
/**
* @brief 判断矩形rect1是否包含矩形rect2
* Determine if rectangle rect1 contains rectangle rect2
* @param rect1 rect1
* @param rect2 rect2
* @return 判断结果
* Judgment result
*/
extern BOOL MAMapRectContainsRect(MAMapRect rect1, MAMapRect rect2);
/**
* @brief 判断点是否在圆内
* Determine if a point is inside a circle
* @param point 点
* Point
* @param center 圆的中心点
* Center point of the circle
* @param radius 圆的半径,单位米
* Radius of the circle, in meters
* @return 判断结果
* Judgment result
*/
extern BOOL MACircleContainsPoint(MAMapPoint point, MAMapPoint center, double radius);
/**
* @brief 判断经纬度点是否在圆内
* Determine if a latitude and longitude point is within a circle
* @param point 经纬度
* Latitude and longitude
* @param center 圆的中心经纬度
* Center latitude and longitude of the circle
* @param radius 圆的半径,单位米
* Radius of the circle, in meters
* @return 判断结果
* Judgment result
*/
extern BOOL MACircleContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D center, double radius);
/**
* @brief 获取某坐标点距线上最近的坐标点
* Get the nearest point on a line from a coordinate point
* @param point 点
* Point
* @param polyline 线
* Line
* @param count 线里点的数量
* Number of points in the line
* @return 某点到线上最近的点
* Nearest point on the line from a point
*/
extern MAMapPoint MAGetNearestMapPointFromPolyline(MAMapPoint point, MAMapPoint *polyline, NSUInteger count);
/**
* @brief 判断点是否在多边形内
* Determine if a point is inside a polygon
* @param point 点
* Point
* @param polygon 多边形
* Polygon
* @param count 多边形点的数量
* Number of polygon points
* @return 判断结果
* Judgment result
*/
extern BOOL MAPolygonContainsPoint(MAMapPoint point, MAMapPoint *polygon, NSUInteger count);
/**
* @brief 判断经纬度点是否在多边形内
* Determine if a latitude and longitude point is inside a polygon
* @param point 经纬度点
* Latitude and longitude point
* @param polygon 多边形
* Polygon
* @param count 多边形点的数量
* Number of polygon points
* @return 判断结果
* Judgment result
*/
extern BOOL MAPolygonContainsCoordinate(CLLocationCoordinate2D point, CLLocationCoordinate2D *polygon, NSUInteger count);
/**
* @brief 取在lineStart和lineEnd组成的线段上距离point距离最近的点
* Take the point on the line segment formed by lineStart and lineEnd that is closest to point
* @param lineStart 线段起点
* Line segment starting point
* @param lineEnd 线段终点
* Line segment ending point
* @param point 测试点
* Test point
* @return 距离point最近的点坐标
* Coordinates of the point closest to point
*/
extern MAMapPoint MAGetNearestMapPointFromLine(MAMapPoint lineStart, MAMapPoint lineEnd, MAMapPoint point);
/**
* @brief 获取墨卡托投影切块回调block如果是无效的映射则返回(-1, -1, 0, 0, 0, 0)
* Get the Mercator projection tile callback block, if it is an invalid mapping, return (-1, -1, 0, 0, 0, 0);
* @param offsetX 左上点距离所属tile的位移X, 单位像素
* The displacement X of the top-left point from the tile it belongs to, in pixels
* @param offsetY 左上点距离所属tile的位移Y, 单位像素
* The displacement Y of the top-left point from the tile it belongs to, in pixels
* @param minX 覆盖tile的最小x
* Minimum x of the covered tile
* @param maxX 覆盖tile的最大x
* Maximum x of the covered tile
* @param minY 覆盖tile的最小y
* Minimum y of the covered tile
* @param maxY 覆盖tile的最大y
* Maximum y of the covered tile
*/
typedef void (^AMapTileProjectionBlock)(int offsetX, int offsetY, int minX, int maxX, int minY, int maxY);
/**
* @brief 根据所给经纬度区域获取墨卡托投影切块信息
* Obtain Mercator projection tile information based on the given latitude and longitude area
* @param bounds 经纬度区域
* Latitude and longitude area
* @param levelOfDetails 对应缩放级别, 取值0-20
* Corresponding zoom level, value range 0-20
* @param tileProjection 返回的切块信息block
* Returned tile information block
*/
extern void MAGetTileProjectionFromBounds(MACoordinateBounds bounds, int levelOfDetails, AMapTileProjectionBlock tileProjection);
/**
* @brief 计算多边形面积,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
* Calculate the area of a polygon, where points are connected sequentially from tail to head, and the first point is connected to the last point
* @param coordinates 指定的经纬度坐标点数组C数组调用者负责内存管理
* The specified array of latitude and longitude coordinate points, a C array, memory management is the responsibility of the caller
* @param count 坐标点的个数
* The number of coordinate points
* @return 多边形的面积
* The area of the polygon
*/
extern double MAAreaForPolygon(CLLocationCoordinate2D *coordinates, int count);
static inline MAMapPoint MAMapPointMake(double x, double y)
{
return (MAMapPoint){x, y};
}
static inline MAMapSize MAMapSizeMake(double width, double height)
{
return (MAMapSize){width, height};
}
static inline MAMapRect MAMapRectMake(double x, double y, double width, double height)
{
return (MAMapRect){MAMapPointMake(x, y), MAMapSizeMake(width, height)};
}
static inline double MAMapRectGetMinX(MAMapRect rect)
{
return rect.origin.x;
}
static inline double MAMapRectGetMinY(MAMapRect rect)
{
return rect.origin.y;
}
static inline double MAMapRectGetMidX(MAMapRect rect)
{
return rect.origin.x + rect.size.width / 2.0;
}
static inline double MAMapRectGetMidY(MAMapRect rect)
{
return rect.origin.y + rect.size.height / 2.0;
}
static inline double MAMapRectGetMaxX(MAMapRect rect)
{
return rect.origin.x + rect.size.width;
}
static inline double MAMapRectGetMaxY(MAMapRect rect)
{
return rect.origin.y + rect.size.height;
}
static inline double MAMapRectGetWidth(MAMapRect rect)
{
return rect.size.width;
}
static inline double MAMapRectGetHeight(MAMapRect rect)
{
return rect.size.height;
}
static inline BOOL MAMapPointEqualToPoint(MAMapPoint point1, MAMapPoint point2) {
return point1.x == point2.x && point1.y == point2.y;
}
static inline BOOL MAMapSizeEqualToSize(MAMapSize size1, MAMapSize size2) {
return size1.width == size2.width && size1.height == size2.height;
}
static inline BOOL MAMapRectEqualToRect(MAMapRect rect1, MAMapRect rect2) {
return
MAMapPointEqualToPoint(rect1.origin, rect2.origin) &&
MAMapSizeEqualToSize(rect1.size, rect2.size);
}
static inline BOOL MAMapRectIsNull(MAMapRect rect) {
return isinf(rect.origin.x) || isinf(rect.origin.y);
}
static inline BOOL MAMapRectIsEmpty(MAMapRect rect) {
return MAMapRectIsNull(rect) || (rect.size.width == 0.0 && rect.size.height == 0.0);
}
static inline NSString *MAStringFromMapPoint(MAMapPoint point) {
return [NSString stringWithFormat:@"{%.1f, %.1f}", point.x, point.y];
}
static inline NSString *MAStringFromMapSize(MAMapSize size) {
return [NSString stringWithFormat:@"{%.1f, %.1f}", size.width, size.height];
}
static inline NSString *MAStringFromMapRect(MAMapRect rect) {
return [NSString stringWithFormat:@"{%@, %@}", MAStringFromMapPoint(rect.origin), MAStringFromMapSize(rect.size)];
}
///坐标系类型枚举
///Coordinate system type enumeration
typedef NS_ENUM(NSUInteger, MACoordinateType)
{
MACoordinateTypeBaidu = 0, ///< Baidu
MACoordinateTypeMapBar, ///< MapBar
MACoordinateTypeMapABC, ///< MapABC
MACoordinateTypeSoSoMap, ///< SoSoMap
MACoordinateTypeAliYun, ///< AliYun
MACoordinateTypeGoogle, ///< Google
MACoordinateTypeGPS, ///< GPS
};
/**
* @brief 转换目标经纬度为高德坐标系
* Convert target coordinates to AutoNavi coordinate system
* @param coordinate 待转换的经纬度
* Coordinates to be converted
* @param type 坐标系类型
* Coordinate system type
* @return 高德坐标系经纬度
* AutoNavi coordinate system coordinates
*/
extern CLLocationCoordinate2D MACoordinateConvert(CLLocationCoordinate2D coordinate, MACoordinateType type) __attribute((deprecated("Deprecated, use the coordinate conversion interface in AMapFoundation")));
/**
* @brief 获取矢量坐标方向
* Get vector coordinate direction
* @param fromCoord 矢量坐标起点
* Vector coordinate start point
* @param toCoord 矢量坐标终点
* Vector coordinate end point
* @return 方向,详情参考系统 CLLocationDirection
* Direction, refer to system CLLocationDirection for details
*/
extern CLLocationDirection MAGetDirectionFromCoords(CLLocationCoordinate2D fromCoord, CLLocationCoordinate2D toCoord);
/**
* @brief 获取矢量坐标方向
* Get vector coordinate direction
* @param fromPoint 矢量坐标起点
* Vector coordinate start point
* @param toPoint 矢量坐标终点
* Vector coordinate end point
* @return 方向,详情参考系统 CLLocationDirection
* Direction, refer to system CLLocationDirection for details
*/
extern CLLocationDirection MAGetDirectionFromPoints(MAMapPoint fromPoint, MAMapPoint toPoint);
/**
* @brief 获取点到线的垂直距离
* Get perpendicular distance from point to line
* @param point 起点
* Start point
* @param lineBegin 线的起点
* Start point of the line
* @param lineEnd 线的终点
* End point of the line
* @return 距离,单位米
* Distance in meters
*/
extern double MAGetDistanceFromPointToLine(MAMapPoint point, MAMapPoint lineBegin, MAMapPoint lineEnd);
/**
* @brief 判断线是否被点击选中
* Determine if the line is clicked and selected
* @param linePoints 构成线的点
* Points that form the line
* @param count 点的个数
* Number of points
* @param tappedPoint 点击点
* Click point
* @param lineWidth 线宽单位MAMapPoint点
* Line width, unit: MAMapPoint
* @return 是否选中
* Whether selected
*/
extern BOOL MAPolylineHitTest(MAMapPoint *linePoints, NSUInteger count, MAMapPoint tappedPoint, CGFloat lineWidth);
#ifdef __cplusplus
}
#endif
///utils方法方便c结构体对象和NSValue对象间相互转化
///utils method for convenient conversion between C struct objects and NSValue objects
@interface NSValue (NSValueMAGeometryExtensions)
/**
* @brief 创建 MAMapPoint 的NSValue对象
* Create NSValue object for MAMapPoint
* @param mapPoint MAMapPoint结构体对象
* MAMapPoint struct object
* @return NSValue对象
* NSValue object
*/
+ (NSValue *)valueWithMAMapPoint:(MAMapPoint)mapPoint;
/**
* @brief 创建 MAMapSize 的NSValue对象
* Create NSValue object for MAMapSize
* @param mapSize MAMapSize结构体对象
* MAMapSize struct object
* @return NSValue对象
* NSValue object
*/
+ (NSValue *)valueWithMAMapSize:(MAMapSize)mapSize;
/**
* @brief 创建 MAMapRect 的NSValue对象
* Create NSValue object for MAMapRect
* @param mapRect MAMapRect结构体对象
* MAMapRect struct object
* @return NSValue对象
* NSValue object
*/
+ (NSValue *)valueWithMAMapRect:(MAMapRect)mapRect;
/**
* @brief 创建 CLLocationCoordinate2D 的NSValue对象
* Create NSValue object for CLLocationCoordinate2D
* @param coordinate CLLocationCoordinate2D结构体对象
* CLLocationCoordinate2D struct object
* @return NSValue对象
* NSValue object
*/
+ (NSValue *)valueWithMACoordinate:(CLLocationCoordinate2D)coordinate;
/**
@brief 返回NSValue对象包含的MAMapPoint结构体对象
Returns the MAMapPoint structure contained in the NSValue object
@return 当前对象包含的MAMapPoint结构体对象
The MAMapPoint structure contained in the current object
*/
- (MAMapPoint)MAMapPointValue;
/**
@brief 返回NSValue对象包含的MAMapSize结构体对象
Returns the MAMapSize structure contained in the NSValue object
@return 当前对象包含的MAMapSize结构体对象
The MAMapSize structure contained in the current object
*/
- (MAMapSize)MAMapSizeValue;
/**
@brief 返回NSValue对象包含的MAMapRect结构体对象
Returns the MAMapRect structure contained in the NSValue object
@return 当前对象包含的MAMapRect结构体对象
The MAMapRect structure contained in the current object
*/
- (MAMapRect)MAMapRectValue;
/**
@brief 返回NSValue对象包含的CLLocationCoordinate2D结构体对象
Returns the CLLocationCoordinate2D structure contained in the NSValue object
@return 当前对象包含的CLLocationCoordinate2D结构体对象
The CLLocationCoordinate2D structure contained in the current object
*/
- (CLLocationCoordinate2D)MACoordinateValue;
@end

View File

@ -0,0 +1,96 @@
//
// MAGroundOverlay.h
// MapKit_static
//
// Created by Li Fei on 11/12/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_GROUND
#import <UIKit/UIKit.h>
#import "MAShape.h"
#import "MAOverlay.h"
///该类用于确定覆盖在地图上的图片,及其覆盖区域, 通常MAGroundOverlay是MAGroundOverlayRenderer的model
///This class is used to determine the images overlaid on the map and their coverage areas. Typically, MAGroundOverlay is the model of MAGroundOverlayRenderer.
@interface MAGroundOverlay : MAShape<MAOverlay>
///绘制在地图上的覆盖图片
///Overlay image drawn on the map
@property (nonatomic, readonly) UIImage *icon;
///透明度. 最终透明度 = 纹理透明度 * alpha. 有效范围为[0.f, 1.f], 默认为1.f
///Transparency. Final transparency = texture transparency * alpha. Valid range is [0.f, 1.f], default is 1.f
@property (nonatomic, assign) CGFloat alpha __attribute((deprecated("Deprecated, since 7.7.0, please use alpha in MAGroundOverlayRenderer")));
///覆盖图片在地图尺寸等同于其像素的zoom值
///The zoom level at which the overlay image's size on the map equals its pixel dimensions.
@property (nonatomic, readonly) CGFloat zoomLevel;
///图片在地图中的覆盖范围
///Image coverage area on the map
@property (nonatomic, readonly) MACoordinateBounds bounds;
/**
* @brief 根据bounds值和icon生成GroundOverlay
* Generate GroundOverlay based on bounds and icon
* @param bounds 图片的在地图的覆盖范围
* Image coverage area on the map
* @param icon 覆盖图片
* Overlay image
* @return 以bounds和icon 新生成GroundOverlay
* Create a new GroundOverlay with bounds and icon
*/
+ (instancetype)groundOverlayWithBounds:(MACoordinateBounds)bounds
icon:(UIImage *)icon;
/**
* @brief 根据coordinate,icon,zoomLevel生成GroundOverlay
* Generate GroundOverlay based on coordinate, icon, and zoomLevel
* @param coordinate 图片的在地图上的中心点
* The center point of the image on the map
* @param zoomLevel 图片在地图尺寸等同于像素的zoom值
* The zoom value where the image size on the map equals its pixel dimensions
* @param icon 覆盖图片
* Overlay image
* @return 以coordinate,icon,zoomLevel 新生成GroundOverlay
* Create a new GroundOverlay with coordinate, icon, zoomLevel
*/
+ (instancetype)groundOverlayWithCoordinate:(CLLocationCoordinate2D)coordinate
zoomLevel:(CGFloat)zoomLevel
icon:(UIImage *)icon;
/**
* @brief 更新GroundOverlay. since 5.0.0
* Update GroundOverlay. since 5.0.0
* @param bounds 图片的在地图的覆盖范围
* Image coverage on the map
* @param icon 覆盖图片
* Overlay image
* @return 返回是否成功
* Return success status
*/
- (BOOL)setGroundOverlayWithBounds:(MACoordinateBounds)bounds icon:(UIImage *)icon;
/**
* @brief 更新GroundOverlay, 内部会自动计算覆盖物大小以满足zoomLevel下显示大小为icon大小. since 5.0.0
* Update GroundOverlay, the system will automatically calculate the overlay size to ensure the display size matches the icon size at the zoomLevel. since 5.0.0
* @param coordinate 图片在地图上的中心点
* The center point of the image on the map
* @param zoomLevel 图片在地图尺寸等同于像素的zoom值
* The zoom value where the image size on the map equals its pixel dimensions
* @param icon 覆盖图片
* Overlay image
* @return 返回是否成功
* Return success status
*/
- (BOOL)setGroundOverlayWithCoordinate:(CLLocationCoordinate2D)coordinate
zoomLevel:(CGFloat)zoomLevel
icon:(UIImage *)icon;
@end
#endif

View File

@ -0,0 +1,36 @@
//
// MAGroundOverlayRenderer.h
// MapKit_static
//
// Created by Li Fei on 11/13/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_GROUND
#import "MAOverlayRenderer.h"
#import "MAGroundOverlay.h"
///此类是将MAGroundOverlay中的覆盖图片显示在地图上的renderer
///This class is the renderer that displays the overlay image from MAGroundOverlay on the map
@interface MAGroundOverlayRenderer : MAOverlayRenderer
///具有覆盖图片,以及图片覆盖的区域
///It has the overlay image and the area covered by the image
@property (nonatomic ,readonly) MAGroundOverlay *groundOverlay;
/**
* @brief 根据指定的GroundOverlay生成将图片显示在地图上Renderer
* Generate a Renderer to display the image on the map based on the specified GroundOverlay
* @param groundOverlay 制定了覆盖图片以及图片的覆盖区域的groundOverlay
* Defined the overlay image and the groundOverlay area of the image
* @return 以GroundOverlay新生成Renderer
* It generates a new Renderer with GroundOverlay
*/
- (instancetype)initWithGroundOverlay:(MAGroundOverlay *)groundOverlay;
@end
#endif

View File

@ -0,0 +1,82 @@
//
// MAHeatMapTileOverlay.h
// test2D
//
// Created by xiaoming han on 15/4/21.
// Copyright (c) 2015年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_HEATMAP
#import "MATileOverlay.h"
///热力图节点
///Heatmap node
@interface MAHeatMapNode : NSObject
///经纬度
///Latitude and longitude
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///强度
///Intensity
@property (nonatomic, assign) float intensity;
@end
///热力图渐变属性
///Heatmap gradient properties
@interface MAHeatMapGradient : NSObject<NSCopying>
///颜色变化数组。 default [blue,green,red]
///Color gradient array. default [blue,green,red]
@property (nonatomic, readonly) NSArray<UIColor *> *colors;
///颜色变化起点,需为递增数组,区间为(0, 1)。default[@(0.2),@(0.5),@(0,9)]
///Starting point of color gradient, must be an increasing array, range (0, 1). default[@(0.2),@(0.5),@(0,9)]
@property (nonatomic, readonly) NSArray<NSNumber *> *startPoints;
/**
* @brief 重新设置gradient的时候需要执行 MATileOverlayRenderer 的 reloadData 方法重刷新渲染缓存。
* When resetting the gradient, you need to execute the reloadData method of MATileOverlayRenderer to refresh the rendering cache.
* @param colors 颜色
* Color
* @param startPoints startPoints
* @return instance
*/
- (instancetype)initWithColor:(NSArray<UIColor *> *)colors andWithStartPoints:(NSArray<NSNumber *> *)startPoints;
@end
///热力图tileOverlay
///Heatmap tileOverlay
@interface MAHeatMapTileOverlay : MATileOverlay
///MAHeatMapNode array
@property (nonatomic, strong) NSArray<MAHeatMapNode *> *data;
///热力图半径默认为12范围:10-200 screen point
///Heatmap radius, default is 12, range: 10-200 screen points
@property (nonatomic, assign) NSInteger radius;
///透明度默认为0.6范围0-1
///Opacity, default is 0.6, range: 0-1
@property (nonatomic, assign) CGFloat opacity;
///热力图梯度
///Heatmap gradient
@property (nonatomic, strong) MAHeatMapGradient *gradient;
///是否开启高清热力图,默认关闭
///Whether to enable high-definition heatmap, default is off
@property (nonatomic, assign) BOOL allowRetinaAdapting;
@end
#endif

View File

@ -0,0 +1,83 @@
//
// MAHeatMapVectorGridOverlay.h
// MAMapKit
//
// Created by ldj on 2019/7/25.
// Copyright © 2019 Amap. All rights reserved.
// 热力图网格覆盖物(通过顶点直接绘制)
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_HEATMAP
#import "MAShape.h"
#import "MAOverlay.h"
#import "MAHeatMapVectorOverlay.h"
///单个点对象
///Single point object
@interface MAHeatMapVectorGridNode : NSObject
///经纬度
///Latitude and longitude
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@end
///单个网格
///Single grid
@interface MAHeatMapVectorGrid : NSObject
/// 网格顶点
/// Grid vertices
@property (nonatomic, copy) NSArray<MAHeatMapVectorGridNode *> *inputNodes;
/// 网格颜色
/// Grid color
@property (nonatomic, strong) UIColor *color;
@end
/// 该类用于定义热力图属性.
/// This class is used to define heatmap attributes.
@interface MAHeatMapVectorGridOverlayOptions : NSObject
/// 热力图类型 (默认为蜂窝类型MAHeatMapTypeHoneycomb)
/// Heatmap type (default is honeycomb type MAHeatMapTypeHoneycomb)
@property (nonatomic, assign) MAHeatMapType type;
/// option选项是否可见. (默认YES)
/// whether the option is visible (default YES
@property (nonatomic, assign) BOOL visible;
/// 网格数据
/// grid data
@property (nonatomic, copy) NSArray<MAHeatMapVectorGrid *> *inputGrids;
/// 最小显示级别 default 3
/// minimum display level, default 3
@property (nonatomic, assign) CGFloat minZoom;
/// 最大显示级别 default 20
/// maximum display level, default 20
@property (nonatomic, assign) CGFloat maxZoom;
@end
///矢量热力图支持类型详见MAHeatMapType
///Vector heatmap, supported types can be found in MAHeatMapType
@interface MAHeatMapVectorGridOverlay : MAShape<MAOverlay>
///热力图的配置属性
///Configuration properties of the heatmap
@property (nonatomic, strong) MAHeatMapVectorGridOverlayOptions *option;
/**
* @brief 根据配置属性option生成MAHeatMapVectorGridOverlay
* Generate MAHeatMapVectorGridOverlay based on configuration property option
* @param option 热力图配置属性option
* Heatmap configuration property option
* @return 新生成的热力图MAHeatMapVectorGridOverlay
* Newly generated heatmap MAHeatMapVectorGridOverlay
*/
+ (instancetype)heatMapOverlayWithOption:(MAHeatMapVectorGridOverlayOptions *)option;
@end
#endif

View File

@ -0,0 +1,33 @@
//
// MAHeatMapVectorGridOverlayRenderer.h
// MAMapKit
//
// Created by ldj on 2019/7/26.
// Copyright © 2019 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_HEATMAP
#import "MAOverlayRenderer.h"
#import "MAHeatMapVectorGridOverlay.h"
///矢量热力图绘制类
///Vector heatmap rendering class
@interface MAHeatMapVectorGridOverlayRenderer : MAOverlayRenderer
///关联的MAHeatMapVectorOverlay
///Associated MAHeatMapVectorOverlay
@property (nonatomic, readonly) MAHeatMapVectorGridOverlay *heatOverlay;
/**
* @brief 根据指定的MAHeatMapVectorOverlay生成一个Renderer
* Generate a Renderer based on the specified MAHeatMapVectorOverlay
* @param heatOverlay 指定MAHeatMapVectorOverlay
* Specify MAHeatMapVectorOverlay
* @return 新生成的MAHeatMapVectorOverlayRender
* Newly generated MAHeatMapVectorOverlayRender
*/
- (instancetype)initWithHeatOverlay:(MAHeatMapVectorGridOverlay *)heatOverlay;
@end
#endif

View File

@ -0,0 +1,146 @@
//
// MAHeatMapVectorOverlay.h
// MAMapKit
//
// Created by ldj on 2019/7/25.
// Copyright © 2019 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_HEATMAP
#import "MAShape.h"
#import "MAOverlay.h"
///热力图类型
///Heatmap Type
typedef NS_ENUM(NSInteger, MAHeatMapType)
{
MAHeatMapTypeSquare = 1, ///< 网格热力图 Grid Heatmap
MAHeatMapTypeHoneycomb = 2 ///< 蜂窝热力图 Hexagonal Heatmap
};
///单个点对象
///Single Point Object
@interface MAHeatMapVectorNode : NSObject
///经纬度
///Latitude and Longitude
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///权重
///Weight
@property (nonatomic, assign) float weight;
@end
///热力图展示节点(用以描述一个蜂窝或一个网格)
///Heatmap Display Node (used to describe a hexagon or a grid)
@interface MAHeatMapVectorItem : NSObject
///中心点坐标
///Center Point Coordinates
@property (nonatomic, readonly) MAMapPoint center;
///当前热力值,求和后的权重
///Current heat value, summed weight
@property (nonatomic, readonly) float intensity;
///落在此节点区域内的所有热力点的索引数组
///Index array of all heat points within this node area
@property (nonatomic, readonly) NSArray<NSNumber *> *nodeIndices;
@end
///该类用于定义热力图属性.
///This class is used to define heatmap properties
@interface MAHeatMapVectorOverlayOptions : NSObject
///热力图类型 (默认为蜂窝类型MAHeatMapTypeHoneycomb)
///Heatmap type (default is honeycomb type MAHeatMapTypeHoneycomb)
@property (nonatomic, assign) MAHeatMapType type;
///option选项是否可见. (默认YES)
///Whether the option is visible. (Default: YES)
@property (nonatomic, assign) BOOL visible;
///MAHeatMapVectorNode array
@property (nonatomic, strong) NSArray<MAHeatMapVectorNode *> *inputNodes;
/**
@verbatim
节点的宽 单位:米 负数按照0处理 default 2000
—— —— —— ——
丨 丨 丨 丨
丨 丨 丨 丨
—— —— —— ——
每个方框的宽就是 size六边形同理
两个方框之间的间隔就是 gap (六边形同理)
@endverbatim
*/
/**
@verbatim
Node width in meters (negative values treated as 0, default 2000)
—— —— —— ——
丨 丨 丨 丨
丨 丨 丨 丨
—— —— —— ——
The width of each box is size (same for hexagons)
The gap between two boxes is gap (same for hexagons)
@endverbatim
*/
@property (nonatomic, assign) CLLocationDistance size;
///节点之间的间隔 单位:米 负数按照0处理。注意改变gap可能会改变热力节点的计算内部会用size+gap来计算热力最终用size来画方框。
///The spacing between nodes, unit: meters, negative values are treated as 0. Note: Changing the gap may alter the calculation of heat nodes; internally, size + gap is used to calculate the heat, and finally, size is used to draw the box.
@property (nonatomic, assign) CGFloat gap;
///颜色变化数组。 注意colors和startPoints两数组长度必须一致且不能为0
///Color gradient array. Note: The lengths of the colors and startPoints arrays must be equal and cannot be 0.
@property (nonatomic, strong) NSArray<UIColor *> *colors;
///颜色变化起点,需为递增数组,区间为[0, 1]。 注意colors和startPoints两数组长度必须一致且不能为0。例如startPoints @[@(0), @(0.3),@(0.7)] 表示区间 [0,0.3)使用第一个颜色,区间[0.3,0.7)使用第二个颜色,区间[0.7,1]使用第三个颜色。注意startPoints首位需设置成0如果首位不是0内部也会把首位当成0来处理。
///The starting point of color change must be an increasing array within the range [0, 1]. Note: the lengths of the colors and startPoints arrays must be the same and cannot be zero.For example: startPoints @[@(0), @(0.3),@(0.7)] means the interval [0,0.3) uses the first color, the interval [0.3,0.7) uses the second color, and the interval [0.7,1] uses the third color.Note: The first element of startPoints must be set to 0. If it is not 0, the system will treat the first element as 0 internally.
@property (nonatomic, strong) NSArray<NSNumber *> *startPoints;
///透明度,取值范围[0,1] default为1不透明
///Transparency, value range [0,1], default is 1 for opaque
@property (nonatomic, assign) CGFloat opacity __attribute((deprecated("Deprecated, since 7.9.0, please use alpha in MAHeatMapVectorOverlayRender")));;
///权重的最大值default为0表示不填不填则取数组inputNodes中权重的最大值
///Maximum weight, default is 0, indicating not filled, if not filled, the maximum weight in the array inputNodes is taken
@property (nonatomic, assign) int maxIntensity;
///最小显示级别 default 3
///Minimum display level, default 3
@property (nonatomic, assign) CGFloat minZoom;
///最大显示级别 default 20
///Maximum display level, default 20
@property (nonatomic, assign) CGFloat maxZoom;
@end
///矢量热力图支持类型详见MAHeatMapType
///Vector heatmap, supported types refer to MAHeatMapType
@interface MAHeatMapVectorOverlay : MAShape<MAOverlay>
///热力图的配置属性
///Configuration properties of heatmap
@property (nonatomic, strong) MAHeatMapVectorOverlayOptions *option;
/**
* @brief 根据配置属性option生成MAHeatMapVectorOverlay
* Generate MAHeatMapVectorOverlay based on configuration attribute option
* @param option 热力图配置属性option
* Heatmap configuration attribute option
* @return 新生成的热力图MAHeatMapVectorOverlay
* Newly generated heatmap MAHeatMapVectorOverlay
*/
+ (instancetype)heatMapOverlayWithOption:(MAHeatMapVectorOverlayOptions *)option;
@end
#endif

View File

@ -0,0 +1,43 @@
//
// MAHeatMapVectorOverlayRender.h
// MAMapKit
//
// Created by ldj on 2019/7/26.
// Copyright © 2019 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_HEATMAP
#import "MAOverlayRenderer.h"
#import "MAHeatMapVectorOverlay.h"
///矢量热力图绘制类
///Vector Heatmap Drawing Class
@interface MAHeatMapVectorOverlayRender : MAOverlayRenderer
///关联的MAHeatMapVectorOverlay
///Associated MAHeatMapVectorOverlay
@property (nonatomic, readonly) MAHeatMapVectorOverlay *heatOverlay;
/**
* @brief 根据指定的MAHeatMapVectorOverlay生成一个Renderer
* Generate a Renderer based on the specified MAHeatMapVectorOverlay
* @param heatOverlay 指定MAHeatMapVectorOverlay
* Specify MAHeatMapVectorOverlay
* @return 新生成的MAHeatMapVectorOverlayRender
* Newly generated MAHeatMapVectorOverlayRender
*/
- (instancetype)initWithHeatOverlay:(MAHeatMapVectorOverlay *)heatOverlay;
/**
* @brief 根据经纬度获取对应的热力节点信息MAHeatMapVectorItem
* Obtain corresponding heatmap node information MAHeatMapVectorItem based on latitude and longitude
* @param coordinate 经纬度
* Latitude and longitude
*/
- (MAHeatMapVectorItem *)getHeatMapItem:(CLLocationCoordinate2D )coordinate;
@end
#endif

View File

@ -0,0 +1,64 @@
//
// MAIndoorInfo.h
// MAMapKit
//
// Created by 翁乐 on 5/6/16.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_INDOOR
#import <Foundation/Foundation.h>
///室内楼层信息
///Indoor floor information
@interface MAIndoorFloorInfo : NSObject
///楼层名
///Floor name
@property (nonatomic, readonly) NSString *floorName;
///楼层index
///Floor index
@property (nonatomic, readonly) int floorIndex;
///楼层别名
///Floor alias
@property (nonatomic, readonly) NSString *floorNona;
///是否属于停车场
///Whether it belongs to a parking lot
@property (nonatomic, readonly) BOOL isPark;
@end
///室内图信息
///Indoor map information
@interface MAIndoorInfo : NSObject
///室内地图中文名
///Indoor map Chinese name
@property (nonatomic, readonly) NSString *cnName;
///室内地图英文名
///Indoor map English name
@property (nonatomic, readonly) NSString *enName;
///室内地图poiID
///Indoor map poiID
@property (nonatomic, readonly) NSString *poiID;
///建筑类型
///Building type
@property (nonatomic, readonly) NSString *buildingType;
///当前楼层index和floorInfo内部的index相关
///Current floor index, related to the index inside floorInfo
@property (nonatomic, readonly) int activeFloorIndex;
///当前激活的楼层只和floorInfo相关与floorInfo内部元素的index无关
///Currently active floor, only related to floorInfo, not related to the index of elements inside floorInfo
@property (nonatomic, readonly) int activeFloorInfoIndex;
///由 MAIndoorFloorInfo 组成,可直接通过 activeFloorInfoIndex 取出当前楼层
///Composed of MAIndoorFloorInfo, the current floor can be directly retrieved through activeFloorInfoIndex
@property (nonatomic, readonly) NSArray *floorInfo;
///楼层数量
///Number of floors
@property (nonatomic, readonly) int numberOfFloor;
///停车场楼层数量
///Number of parking floors
@property (nonatomic, readonly) int numberOfParkFloor;
@end
#endif

View File

@ -0,0 +1,40 @@
//
// MALineDrawType.h
// MapKit_static
//
// Created by yi chen on 14-7-30.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#ifndef MapKit_static_MALineDrawType_h
#define MapKit_static_MALineDrawType_h
enum MALineJoinType
{
kMALineJoinBevel, ///< 斜面连接点 Bevel join
kMALineJoinMiter, ///< 斜接连接点 Miter join
kMALineJoinRound ///< 圆角连接点 Round join
};
typedef enum MALineJoinType MALineJoinType;
enum MALineCapType
{
kMALineCapButt, ///< 普通头 Butt cap
kMALineCapSquare, ///< 扩展头 Square cap
kMALineCapArrow, ///< 箭头 Arrow
kMALineCapRound ///< 圆形头 Round cap
};
typedef enum MALineCapType MALineCapType;
///虚线类型
enum MALineDashType
{
kMALineDashTypeNone = 0, ///<不画虚线 No dash
kMALineDashTypeSquare, ///<方块样式 Square style
kMALineDashTypeDot, ///<圆点样式 Dot style
};
typedef enum MALineDashType MALineDashType;
#endif

View File

@ -0,0 +1,29 @@
//
// MAMVTTileOverlay.h
// MapKit_static
//
// Created by Li Fei on 11/22/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_TILE
#if FEATURE_MVT
#import "MATileOverlay.h"
#import "MABaseOverlay.h"
@interface MAMVTTileOverlayOptions : NSObject
@property (nonatomic, copy) NSString *url; // URL
@property (nonatomic, copy) NSString *key; // key
@property (nonatomic, copy) NSString *Id; // id
@property (nonatomic, assign) BOOL visible; // 是否可见 默认YES Visible, default YES
@end
/// MVT瓦片数据 MVT tile data
@interface MAMVTTileOverlay : MATileOverlay
/// MVT配置选项 MVT configuration options
@property (nonatomic, strong, readonly) MAMVTTileOverlayOptions *option;
+ (instancetype)mvtTileOverlayWithOption:(MAMVTTileOverlayOptions *)option;
@end
#endif
#endif

View File

@ -0,0 +1,22 @@
//
// MAMVTTileOverlayRenderer.h
// MapKit_static
//
// Created by Li Fei on 11/25/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_TILE
#if FEATURE_MVT
#import "MATileOverlayRenderer.h"
#import "MAMVTTileOverlay.h"
/// 此类是将MAMVTOverlayRenderer中的覆盖tiles显示在地图上的Renderer
/// This class is a Renderer that displays the overlay tiles from MAMVTOverlayRenderer on the map
@interface MAMVTTileOverlayRenderer : MATileOverlayRenderer
@end
#endif
#endif

View File

@ -0,0 +1,27 @@
//
// MAMapAccessibilityIdentifier.h
// MAMapKit
//
// Created by hanxiaoming on 17/1/9.
// Copyright © 2017年 Amap. All rights reserved.
//
#ifndef MAMapAccessibilityIdentifier_h
#define MAMapAccessibilityIdentifier_h
#define kMAAcceIdForMapView @"mamapview"
#define kMAAcceIdForRender @"marender"
#define kMAAcceIdForLogoView @"malogo"
#define kMAAcceIdForAnnotationContainer @"maannotationcontainer"
#define kMAAcceIdForOverlayContainer @"maoverlaycontainer"
#define kMAAcceIdForAnnotationView @"maannotationview"
#define kMAAcceIdForCalloutView @"macalloutview"
#define kMAAcceIdForUserLocationView @"mauserlocationview"
#define kMAAcceIdForScaleView @"mascaleview"
#define kMAAcceIdForCompassView @"macompassview"
#define kMAAcceIdForIndoorView @"maindoorview"
#endif /* MAMapAccessibilityIdentifier_h */

View File

@ -0,0 +1,34 @@
//
// MAMapCustomStyleOptions.h
// MAMapKit
//
// Created by ldj on 2018/11/27.
// Copyright © 2018 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MAMapCustomStyleOptions : NSObject
///自定义样式二进制
///Custom style binary
@property (nonatomic, strong) NSData *styleData;
///海外自定义样式文件路径
///Overseas custom style file path
@property (nonatomic, strong) NSString *styleDataOverseaPath;
///设置地图自定义样式对应的styleID从官网获取
///Set the styleID corresponding to the map custom style, obtained from the official website
@property (nonatomic, strong) NSString *styleId;
///设置自定义纹理文件二进制
///Set custom texture file binary
@property (nonatomic, strong) NSData *styleTextureData;
///样式额外的配置,比如路况,背景颜色等 since 6.7.0
///Additional style configurations, such as traffic conditions, background color, etc. since 6.7.0
@property (nonatomic, strong) NSData *styleExtraData;
@end

View File

@ -0,0 +1,84 @@
//
// MAMapKit.h
// MAMapKit
//
// Created by 翁乐 on 12/2/15.
// Copyright © 2015 Amap. All rights reserved.
//
#import <MAMapKit/MAConfig.h>
#import <MAMapKit/MAMapAccessibilityIdentifier.h>
#import <MAMapKit/MAMapVersion.h>
#import <MAMapKit/MAMapView.h>
#import <MAMapKit/MAMapStatus.h>
#import <MAMapKit/MAGeometry.h>
#import <MAMapKit/MAAnnotation.h>
#import <MAMapKit/MAAnnotationView.h>
#import <MAMapKit/MAAnnotationMoveAnimation.h>
#import <MAMapKit/MAPointAnnotation.h>
#import <MAMapKit/MAAnimatedAnnotation.h>
#import <MAMapKit/MAPinAnnotationView.h>
#import <MAMapKit/MAUserLocation.h>
#import <MAMapKit/MAOverlay.h>
#import <MAMapKit/MAOverlayPathRenderer.h>
#import <MAMapKit/MAOverlayRenderer.h>
#import <MAMapKit/MAShape.h>
#import <MAMapKit/MACircle.h>
#import <MAMapKit/MACircleRenderer.h>
#import <MAMapKit/MAArc.h>
#import <MAMapKit/MAArcRenderer.h>
#import <MAMapKit/MAPolygon.h>
#import <MAMapKit/MAPolygonRenderer.h>
#import <MAMapKit/MAPolyline.h>
#import <MAMapKit/MAPolylineRenderer.h>
#import <MAMapKit/MAGeodesicPolyline.h>
#import <MAMapKit/MAMultiPoint.h>
#import <MAMapKit/MAMultiPolyline.h>
#import <MAMapKit/MAMultiTexturePolylineRenderer.h>
#import <MAMapKit/MAMultiColoredPolylineRenderer.h>
#import <MAMapKit/MAGroundOverlay.h>
#import <MAMapKit/MAGroundOverlayRenderer.h>
#import <MAMapKit/MATileOverlay.h>
#import <MAMapKit/MATileOverlayRenderer.h>
#import <MAMapKit/MACustomBuildingOverlay.h>
#import <MAMapKit/MACustomBuildingOverlayRenderer.h>
#import <MAMapKit/MAParticleOverlayOptions.h>
#import <MAMapKit/MAParticleOverlay.h>
#import <MAMapKit/MAParticleOverlayRenderer.h>
#import <MAMapKit/MAHeatMapVectorOverlay.h>
#import <MAMapKit/MAHeatMapVectorOverlayRender.h>
#import <MAMapKit/MAMultiPointOverlay.h>
#import <MAMapKit/MAMultiPointOverlayRenderer.h>
#import <MAMapKit/MAHeatMapTileOverlay.h>
#import <MAMapKit/MATouchPoi.h>
#import <MAMapKit/MAIndoorInfo.h>
#import <MAMapKit/MAOfflineMap.h>
#import <MAMapKit/MAOfflineItem.h>
#import <MAMapKit/MAOfflineCity.h>
#import <MAMapKit/MAOfflineItemCommonCity.h>
#import <MAMapKit/MAOfflineItemMunicipality.h>
#import <MAMapKit/MAOfflineItemNationWide.h>
#import <MAMapKit/MAOfflineProvince.h>
#import <MAMapKit/MAOfflineMapViewController.h>
#import <MAMapKit/MAUserLocationRepresentation.h>
#import <MAMapKit/MACustomCalloutView.h>
#import <MAMapKit/MATraceLocation.h>
#import <MAMapKit/MATraceManager.h>
#import <MAMapKit/MALineDrawType.h>
#import <MAMapKit/MAHeatMapVectorGridOverlay.h>
#import <MAMapKit/MAHeatMapVectorGridOverlayRenderer.h>
#import <MAMapKit/MAMVTTileOverlay.h>
#import <MAMapKit/MAMVTTileOverlayRenderer.h>
#import <MAMapKit/MABaseEngineOverlay.h>
#import <MAMapKit/MARouteOverlay.h>
#import <MAMapKit/MARouteOverlayModel.h>
#if __has_include(<MAMapKit/MAMapView+Resource.h>)
#import <MAMapKit/MAMapView+Resource.h>
#endif

View File

@ -0,0 +1,64 @@
//
// MAMapSnapshot.h
// MAMapKit
//
// Created by ZhaoRui on 2022/3/30.
// Copyright © 2022 Amap. All rights reserved.
//
#import "MAMapKit/MAMapKit.h"
@interface MAMapSnapshotModel : NSObject
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint position;
@property (nonatomic, assign) MAMapPoint tlPoint;
@property (nonatomic, assign) MAMapPoint trPoint;
@property (nonatomic, strong) UIImage* image;
@end
@interface MAMapSnapshot : NSObject
@property (nonatomic, readonly) CGSize minSize;
@property (nonatomic, readonly) CGSize maxSize;
- (instancetype)init:(MAMapView*)mapview;
/**
* @brief 异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调
* Asynchronously capture a screenshot within the specified area (by default, it will include the annotationView within that area), callback when the map is fully loaded
* @param size 指定的区域
* The specified area
* @param tl 左上
* Top left
* @param tr 右上
* Top right
* @param block 回调block(resultImages:返回的图片集合,state0载入不完整1完整
* Callback block(resultImages: returned image collection, state: 0 incomplete loading, 1 complete)
*/
typedef void(^CaptureResultBlock)(NSArray<MAMapSnapshotModel*> *resultImages, NSInteger state);
- (BOOL)captureBigPicture:(CGSize)pixelSize
topLeft:(CLLocationCoordinate2D)tl
topRight:(CLLocationCoordinate2D)tr
complete:(CaptureResultBlock)block;
/**
* @brief 异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调
* Asynchronously capture a screenshot within the specified area (by default, it will include the annotationView within that area), callback when the map is fully loaded
* @param size 指定的区域
* The specified area
* @param tl 左上
* Top left
* @param tr 右上
* Top right
* @param block 回调block(resultImage:返回的图片,state0载入不完整1完整
* Callback block(resultImage: returned image, state: 0 incomplete loading, 1 complete)
*/
typedef void(^Observer)(UIImage *resultImage, NSInteger state);
- (BOOL)capture:(CGSize)size
topLeft:(CLLocationCoordinate2D)tl
topRight:(CLLocationCoordinate2D)tr
complete:(Observer)block;
@end

View File

@ -0,0 +1,83 @@
//
// MAMapStatus.h
// MapKit_static
//
// Created by yi chen on 1/27/15.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import <CoreLocation/CLLocation.h>
///地图状态对象
///Map status object
@interface MAMapStatus : NSObject
///地图的中心点,改变该值时,地图的比例尺级别不会发生变化
///The center point of the map, when this value is changed, the scale level of the map will not change
@property (nonatomic) CLLocationCoordinate2D centerCoordinate;
///缩放级别
///Zoom level
@property (nonatomic) CGFloat zoomLevel;
///设置地图旋转角度(逆时针为正向), 单位度, [0,360)
///Set the rotation angle of the map (counterclockwise is positive), in degrees, [0,360)
@property (nonatomic) CGFloat rotationDegree;
///设置地图相机角度(范围为[0.f, 45.f])
///Set the map camera angle (range [0.f, 45.f])
@property (nonatomic) CGFloat cameraDegree;
///地图的视图锚点。坐标系归一化,(0, 0)为MAMapView左上角(1, 1)为右下角。默认为(0.5, 0.5),即当前地图的视图中心
///The view anchor point of the map. The coordinate system is normalized, with (0, 0) at the top-left corner of MAMapView and (1, 1) at the bottom-right corner. Default is (0.5, 0.5), which is the center of the current map view.
@property (nonatomic) CGPoint screenAnchor;
/**
* @brief 根据指定参数生成对应的status
* Generate the corresponding status based on the specified parameters
* @param coordinate 地图的中心点,改变该值时,地图的比例尺级别不会发生变化
* The center point of the map, changing this value will not affect the map's scale level
* @param zoomLevel 缩放级别
* Zoom level
* @param rotationDegree 设置地图旋转角度(逆时针为正向)
* Set the map rotation angle (counterclockwise is positive)
* @param cameraDegree 设置地图相机角度(范围为[0.f, 45.f])
* Set the map camera angle (range [0.f, 45.f])
* @param screenAnchor 地图的视图锚点。坐标系归一化,(0, 0)为MAMapView左上角(1, 1)为右下角。默认为(0.5, 0.5),即当前地图的视图中心
* The view anchor point of the map. The coordinate system is normalized, with (0, 0) being the top-left corner of MAMapView and (1, 1) being the bottom-right corner. Default is (0.5, 0.5), which is the center of the current map view.
* @return 生成的Status
* Generated Status
*/
+ (instancetype)statusWithCenterCoordinate:(CLLocationCoordinate2D)coordinate
zoomLevel:(CGFloat)zoomLevel
rotationDegree:(CGFloat)rotationDegree
cameraDegree:(CGFloat)cameraDegree
screenAnchor:(CGPoint)screenAnchor;
/**
* @brief 根据指定参数初始化对应的status
* Initialize the corresponding status according to the specified parameters
* @param coordinate 地图的中心点,改变该值时,地图的比例尺级别不会发生变化
* The center point of the map, changing this value will not affect the map's scale level
* @param zoomLevel 缩放级别
* Zoom level
* @param rotationDegree 设置地图旋转角度(逆时针为正向)
* Set the map rotation angle (counterclockwise is positive)
* @param cameraDegree 设置地图相机角度(范围为[0.f, 45.f])
* Set the map camera angle (range [0.f, 45.f])
* @param screenAnchor 地图的视图锚点。坐标系归一化,(0, 0)为MAMapView左上角(1, 1)为右下角。默认为(0.5, 0.5),即当前地图的视图中心
* The view anchor point of the map. The coordinate system is normalized, with (0, 0) being the top-left corner of MAMapView and (1, 1) being the bottom-right corner. Default is (0.5, 0.5), which is the center of the current map view.
* @return 生成的Status
* Generated Status
*/
- (id)initWithCenterCoordinate:(CLLocationCoordinate2D)coordinate
zoomLevel:(CGFloat)zoomLevel
rotationDegree:(CGFloat)rotationDegree
cameraDegree:(CGFloat)cameraDegree
screenAnchor:(CGPoint)screenAnchor;
@end

View File

@ -0,0 +1,27 @@
//
// MAMapVersion.h
// MAMapKit
//
// Created by yi chen on 2/24/16.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <AMapFoundationKit/AMapFoundationVersion.h>
#ifndef MAMapVersion_h
#define MAMapVersion_h
#define MAMapVersionNumber 11020000
#define MAMapMinRequiredFoundationVersion 10900
// 依赖库版本检测
#if AMapFoundationVersionNumber < MAMapMinRequiredFoundationVersion
#error "The AMapFoundationKit version is less than minimum required, please update! Any questions please to visit http://lbs.amap.com"
#endif
FOUNDATION_EXTERN NSString * const MAMapKitVersion;
FOUNDATION_EXTERN NSString * const MAMapKitName;
#endif /* MAMapVersion_h */

View File

@ -0,0 +1,24 @@
//
// MAMapView+Resource.h
// MAMapKit
//
// Created by caowei on 2025/4/8.
// Copyright © 2025 Amap. All rights reserved.
//
#import "MAMapView.h"
NS_ASSUME_NONNULL_BEGIN
@interface MAMapView (Resource)
/// 设置地图资源路径
/// @note 在初始化地图前使用
/// - Parameter path: Amap.bundle的路径
/// - Returns: 返回值 0:成功 1:版本号校验失败 2 路径不存在
/// @since 10.5.0
+ (NSInteger)setBundlePath:(NSString *)path;
@end
NS_ASSUME_NONNULL_END

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
//
// MAMultiColoredPolylineRenderer.h
// MapKit_static
//
// Created by yi chen on 12/11/15.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_MAMultiPolyline
#import "MAPolylineRenderer.h"
#import "MAMultiPolyline.h"
///此类用于绘制 MAMultiPolyline 对应的多彩线,支持分段颜色绘制
///This class is used to draw the colorful line corresponding to MAMultiPolyline, supporting segmented color rendering
@interface MAMultiColoredPolylineRenderer : MAPolylineRenderer
///关联的MAMultiPolyline model
///Associated MAMultiPolyline model
@property (nonatomic, readonly) MAMultiPolyline *multiPolyline;
///分段绘制的颜色,需要分段颜色绘制时必须设置内容必须为UIColor。根据multiPolyline.drawStyleIndexes属性指示的索引进行渲染。
///The color for segmented drawing must be set (the content must be UIColor) when segmented color drawing is required. It is rendered according to the index indicated by the multiPolyline.drawStyleIndexes property.
@property (nonatomic, strong) NSArray<UIColor *> *strokeColors;
///颜色是否渐变, 默认为NO。如果设置为YES则为多彩渐变线。
///Whether the color is gradient, default is NO. If set to YES, it becomes a colorful gradient line.
@property (nonatomic, getter=isGradient) BOOL gradient;
/**
* @brief 根据指定的MAPolyline生成一个多段线Renderer
* Generate a polyline Renderer based on the specified MAPolyline
* @param multiPolyline 指定MAMultiPolyline
* Specify MAMultiPolyline
* @return 新生成的多段线Renderer
* Newly generated polyline Renderer
*/
- (instancetype)initWithMultiPolyline:(MAMultiPolyline *)multiPolyline;
@end
#endif

View File

@ -0,0 +1,40 @@
//
// MAMultiPoint.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import "MAShape.h"
#import "MAGeometry.h"
///该类是个由多个点组成的虚基类, 不能直接实例化对象, 要使用其子类MAPolyline,MAPolygon来实例化
///This class is an abstract base class composed of multiple points and cannot be directly instantiated. Use its subclasses MAPolyline and MAPolygon for instantiation
@interface MAMultiPoint : MAShape
///坐标点数组
///coordinate point array
@property (nonatomic, readonly) MAMapPoint *points;
///坐标点的个数
///number of coordinate points
@property (nonatomic, readonly) NSUInteger pointCount;
///是否跨越180度经度线默认NO since 6.4.0
///Whether to cross the 180th meridian, default NO since 6.4.0
@property (nonatomic, assign, readonly) BOOL cross180Longitude;
/**
* @brief 将内部的坐标点数据转化为经纬度坐标并拷贝到coords内存中
* Convert the internal coordinate point data into latitude and longitude coordinates and copy them to the coords memory
* @param coords 调用者提供的内存空间, 该空间长度必须大于等于要拷贝的坐标点的个数range.length
* The memory space provided by the caller must be greater than or equal to the number of coordinate points to be copied.range.length
* @param range 要拷贝的数据范围
* Data range to be copied
*/
- (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range;
@end

View File

@ -0,0 +1,52 @@
//
// MAMultiPointOverlay.h
// MAMapKit
//
// Created by hanxiaoming on 2017/4/11.
// Copyright © 2017年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_MAMultiPoint
#import "MAShape.h"
#import "MAOverlay.h"
///海量点overlay单个点对象since 5.1.0
///Massive point overlay single point object since 5.1.0
@interface MAMultiPointItem : NSObject<NSCopying, MAAnnotation>
///经纬度
/// Latitude and longitude
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///唯一标识默认为nil。
///Unique identifier, default is nil
@property (nonatomic, copy) NSString *customID;
///标题
///Title
@property (nonatomic, copy) NSString *title;
///副标题
///Subtitle
@property (nonatomic, copy) NSString *subtitle;
@end
///海量点overlaysince 5.1.0
///Massive point overlay since 5.1.0
@interface MAMultiPointOverlay : MAShape<MAOverlay>
///点对象集合注意MAMultiPointItem属性不支持动态更新
///Point object collection (Note: MAMultiPointItem properties do not support dynamic updates)
@property (nonatomic, readonly) NSArray<MAMultiPointItem *> *items;
///初始化方法
///Initialization method
- (instancetype)initWithMultiPointItems:(NSArray<MAMultiPointItem *> *)items;
@end
#endif

View File

@ -0,0 +1,65 @@
//
// MAMultiPointOverlayRenderer.h
// MAMapKit
//
// Created by hanxiaoming on 2017/4/11.
// Copyright © 2017年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_MAMultiPoint
#import "MAMultiPointOverlay.h"
#import "MAOverlayRenderer.h"
@class MAMultiPointOverlayRenderer;
///MAMultiPointOverlayRenderer代理since 5.1.0
///MAMultiPointOverlayRenderer delegate since 5.1.0
@protocol MAMultiPointOverlayRendererDelegate <NSObject>
@optional
/**
@brief 点击海量点图层回调
Callback for clicking on a massive point layer
@param renderer 海量点图层渲染器
Massive point layer renderer
@param item 被点击的单个点对象
The single point object that was clicked
*/
- (void)multiPointOverlayRenderer:(MAMultiPointOverlayRenderer *)renderer didItemTapped:(MAMultiPointItem *)item;
@end
///海量点渲染renderersince 5.1.0)。 注意为了保证渲染效率纹理不受alpha参数影响如果需要设置透明度请更换icon。
///Massive point rendering renderer (since 5.1.0). Note: To ensure rendering efficiency, textures are not affected by the alpha parameter. If you need to set transparency, please change the icon.
@interface MAMultiPointOverlayRenderer : MAOverlayRenderer
///MAMultiPointOverlayRendererDelegate代理对象
///MAMultiPointOverlayRendererDelegate delegate object
@property (nonatomic, weak) id<MAMultiPointOverlayRendererDelegate> delegate;
///标注纹理图片
///Label texture image
@property (nonatomic, strong) UIImage *icon;
///纹理渲染大小默认为icon图片大小
///texture rendering size, default is the icon image size
@property (nonatomic, assign) CGSize pointSize;
///经纬度对应图片中的位置,默认为(0.5,0.5),范围[0-1] 负值自动取其绝对值 左上角为 (0,0) 右下角为 (1,1)
///latitude and longitude correspond to the position in the image, default is (0.5,0.5), range [0-1] negative values automatically take their absolute value, top-left corner is (0,0) bottom-right corner is (1,1)
@property (nonatomic, assign) CGPoint anchor;
///对应的overlay
///Corresponding overlay
@property (nonatomic, readonly) MAMultiPointOverlay *multiPointOverlay;
///初始化方法
///Initialization method
- (instancetype)initWithMultiPointOverlay:(MAMultiPointOverlay *)multiPointOverlay;
@end
#endif

View File

@ -0,0 +1,110 @@
//
// MAMultiPolyline.h
// MapKit_static
//
// Created by yi chen on 12/11/15.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_MAMultiPolyline
#import "MAPolyline.h"
///多彩线model类。此类用于定义一个由多个点相连的多段线绘制时支持分段采用不同颜色纹理绘制点与点之间尾部相连但第一点与最后一个点不相连, 通常MAMultiPolyline是MAMultiColoredPolylineRenderer分段颜色绘制或MAMultiTexturePolylineRenderer分段纹理绘制的model
///The MultiColorLine model class. This class is used to define a polyline connected by multiple points, supporting the use of different colors (textures) for each segment during drawing. The points are connected end to end, but the first and last points are not connected, usually MAMultiPolyline is a model of MAMultiColoredPolylineRenderer (segmented color rendering) or MAMultiTexturePolylineRenderer (segmented texture rendering)
@interface MAMultiPolyline : MAPolyline
/**
绘制索引数组(纹理、颜色索引数组), 成员为NSNumber, 且为非负数。
例子:[1,3,6] 表示 0-1使用第一种颜色\纹理1-3使用第二种3-6使用第三种6-最后使用第四种。
在渐变模式下MAMultiColoredPolylineRenderer.gradient = YES0-1使用第一种颜色3使用第二种6-最后使用第四种1-33-6使用渐变色进行填充。
注意polyline在渲染时会进行抽稀以提高渲染效率但是如果是设置为drawIndex的点则不会被抽稀。
在每一个点都是索引点的极端情况下,则抽稀过程不会生效,点数量很多时会极大的影响渲染效率。所以请尽量少的设置索引点的数量。
*/
/**
Draw index array (texture, color index array), members are NSNumber and non-negative.
Example: [1,3,6] means using the first color\\texture for 0-1, the second for 1-3, the third for 3-6, and the fourth from 6 to the end.
In gradient mode (MAMultiColoredPolylineRenderer.gradient = YES), use the first color for 0-1, the second for 3, and the fourth from 6 to the end. Use gradient colors for filling between 1-3 and 3-6.
Note: The polyline will be simplified during rendering to improve efficiency, but points set as drawIndex will not be simplified.
In the extreme case where every point is an index point, the thinning process will not take effect, and a large number of points will significantly affect rendering efficiency. Therefore, please try to minimize the number of index points.
*/
@property (nonatomic, strong) NSArray<NSNumber *> *drawStyleIndexes;
/**
* @brief 多彩线根据MAMapPoint数据生成多彩线
* Colorful line, generated based on MAMapPoint data;
*
* 分段纹理绘制其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。
* Segmented texture rendering: its corresponding MAMultiTexturePolylineRenderer must set the strokeTextureImages property; otherwise, the default gray texture will be used.
* 分段颜色绘制其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性
* Segmented color rendering: Its corresponding MAMultiColoredPolylineRenderer must set the strokeColors property
*
* @param points 指定的直角坐标点数组,注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
* Specified array of rectangular coordinate points, note: if there are consecutive duplicate points, deduplication is required, only one should be retained, otherwise it will cause issues in drawing.
* @param count 坐标点的个数
* Number of coordinate points
* @param drawStyleIndexes 纹理索引数组(颜色索引数组)
* Texture index array (color index array)
* @return 生成的折线对象
* Generated polyline object
*/
+ (instancetype)polylineWithPoints:(MAMapPoint *)points count:(NSUInteger)count drawStyleIndexes:(NSArray<NSNumber *> *) drawStyleIndexes;
/**
* @brief 多彩线,根据经纬度坐标数据生成多彩线
* Multicolored line, generated based on latitude and longitude coordinate data
*
* 分段纹理绘制其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。
* Segmented texture rendering: its corresponding MAMultiTexturePolylineRenderer must set the strokeTextureImages property; otherwise, the default gray texture will be used.
* 分段颜色绘制其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性。
* Segmented color rendering: Its corresponding MAMultiColoredPolylineRenderer must set the strokeColors property.
*
* @param coords 指定的经纬度坐标点数组,注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
* The array of specified latitude and longitude coordinate points, note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
* @param count 坐标点的个数
* Number of coordinate points
* @param drawStyleIndexes 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
* Texture index array (color index array), members are NSNumber, and are non-negative.
* @return 生成的折线对象
* Generated polyline object
*/
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count drawStyleIndexes:(NSArray<NSNumber *> *) drawStyleIndexes;
/**
* @brief 重新设置坐标点. since 5.0.0
* Reset the coordinate points . since 5.0.0
* @param points 指定的直角坐标点数组,C数组内部会做copy调用者负责内存管理。注意如果有连续重复点需要去重处理只保留一个否则会导致绘制有问题。
* Specified rectangular coordinate point array, C array, internal copy will be made, the caller is responsible for memory management, note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
* @param count 坐标点的个数
* Number of coordinate points
* @param drawStyleIndexes 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
* Texture index array (color index array), members are NSNumber, and are non-negative.
* @return 是否设置成功
* Whether the setup was successful
*/
- (BOOL)setPolylineWithPoints:(MAMapPoint *)points
count:(NSUInteger)count
drawStyleIndexes:(NSArray<NSNumber *> *)drawStyleIndexes;
/**
* @brief 重新设置坐标点. since 5.0.0
* Reset the coordinate points. since 5.0.0
* @param coords 指定的经纬度坐标点数组,C数组内部会做copy调用者负责内存管理。注意如果有连续重复点需要去重处理只保留一个否则会导致绘制有问题。
* Specified latitude and longitude coordinate point array, C array, internal copy will be made, the caller is responsible for memory management. Note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
* @param count 坐标点的个数
* Number of coordinate points
* @param drawStyleIndexes 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
* Texture index array (color index array), members are NSNumber, and are non-negative.
* @return 是否设置成功
* Whether the setup was successful
*/
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords
count:(NSUInteger)count
drawStyleIndexes:(NSArray<NSNumber *> *)drawStyleIndexes;
@end
#endif

View File

@ -0,0 +1,39 @@
//
// MAMultiTexturePolylineRenderer.h
// MapKit_static
//
// Created by yi chen on 12/11/15.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_MAMultiPolyline
#import "MAPolylineRenderer.h"
#import "MAMultiPolyline.h"
///此类用于绘制MAMultiPolyline对应的多彩线支持分段纹理绘制
///This class is used to draw the multi-colored lines corresponding to MAMultiPolyline, supporting segmented texture drawing
@interface MAMultiTexturePolylineRenderer : MAPolylineRenderer
///关联的MAMultiPolyline model
///The associated MAMultiPolyline model
@property (nonatomic, readonly) MAMultiPolyline *multiPolyline;
///分段纹理图片数组, 支持非PowerOfTwo图片
///An array of segmented texture images, supporting non-PowerOfTwo images
@property (nonatomic, strong) NSArray<UIImage*> *strokeTextureImages;
/**
* @brief 根据指定的MAMultiPolyline生成一个多段线Renderer
* Generate a polyline Renderer based on the specified MAMultiPolyline
* @param multiPolyline 指定MAMultiPolyline
* Specify MAMultiPolyline
* @return 新生成的多段线Renderer
* Newly generated polyline Renderer
*/
- (instancetype)initWithMultiPolyline:(MAMultiPolyline *)multiPolyline;
@end
#endif

View File

@ -0,0 +1,24 @@
//
// MAOfflineCity.h
//
// Copyright (c) 2013年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import <Foundation/Foundation.h>
#import "MAOfflineItem.h"
///离线地图,城市信息
///Offline Maps, City Information
@interface MAOfflineCity : MAOfflineItem
///城市编码
///City Codes
@property (nonatomic, copy, readonly) NSString *cityCode;
@end
#endif

View File

@ -0,0 +1,59 @@
//
// MAOfflineItem.h
// MapKit_static
//
// Created by songjian on 14-4-23.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import <Foundation/Foundation.h>
///离线地图item状态
///Offline map item status
typedef NS_ENUM(NSInteger, MAOfflineItemStatus)
{
MAOfflineItemStatusNone = 0, ///<不存在 Not exist
MAOfflineItemStatusCached, ///<缓存状态 Cache status
MAOfflineItemStatusInstalled, ///<已安装 Installed
MAOfflineItemStatusExpired ///<已过期 Expired
};
@interface MAOfflineItem : NSObject
///名字
///Name
@property (nonatomic, copy, readonly) NSString *name;
///简拼
///Abbreviation
@property (nonatomic, copy, readonly) NSString *jianpin;
///拼音
///Pinyin
@property (nonatomic, copy, readonly) NSString *pinyin;
///区域编码
///Region code
@property (nonatomic, copy, readonly) NSString *adcode;
///离线数据大小
///Offline data size
@property (nonatomic, assign, readonly) long long size;
///状态
///Status
@property (nonatomic, assign, readonly) MAOfflineItemStatus itemStatus;
///已下载大小(当itemStatus == MAOfflineItemStatusCached 时有效)
///Downloaded size (valid when itemStatus == MAOfflineItemStatusCached)
@property (nonatomic, assign, readonly) long long downloadedSize;
@end
#endif

View File

@ -0,0 +1,25 @@
//
// MAOfflineItemCommonCity.h
// MapKit_static
//
// Created by songjian on 14-4-23.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import "MAOfflineCity.h"
///普通城市
///Ordinary city
@interface MAOfflineItemCommonCity : MAOfflineCity
///所属省份
///Province
@property (nonatomic, weak) MAOfflineItem *province;
@end
#endif

View File

@ -0,0 +1,21 @@
//
// MAOfflineItemMunicipality.h
// MapKit_static
//
// Created by songjian on 14-4-23.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import "MAOfflineCity.h"
///直辖市
///Municipality
@interface MAOfflineItemMunicipality : MAOfflineCity
@end
#endif

View File

@ -0,0 +1,20 @@
//
// MAOfflineItemNationWide.h
// MapKit_static
//
// Created by songjian on 14-4-23.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import "MAOfflineCity.h"
///全国概要 National Summary
@interface MAOfflineItemNationWide : MAOfflineCity
@end
#endif

View File

@ -0,0 +1,188 @@
//
// MAOfflineMap.h
//
// Copyright (c) 2013年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import <Foundation/Foundation.h>
#import "MAOfflineProvince.h"
#import "MAOfflineItemNationWide.h"
#import "MAOfflineItemMunicipality.h"
///离线地图下载状态
///Offline map download status
typedef NS_ENUM(NSInteger, MAOfflineMapDownloadStatus)
{
MAOfflineMapDownloadStatusWaiting = 0, //!< 已插入队列,等待中 Inserted into the queue, waiting
MAOfflineMapDownloadStatusStart, //!< 开始下载 Download started
MAOfflineMapDownloadStatusProgress, //!< 下载过程中 Downloading
MAOfflineMapDownloadStatusCompleted, //!< 下载成功 Download successful
MAOfflineMapDownloadStatusCancelled, //!< 取消 Cancel
MAOfflineMapDownloadStatusUnzip, //!< 解压缩 Decompressing
MAOfflineMapDownloadStatusFinished, //!< 全部顺利完成 All completed successfully
MAOfflineMapDownloadStatusError //!< 发生错误 Error occurred
};
///离线下载错误domain
///Offline download error domain
extern NSString * const MAOfflineMapErrorDomain;
///离线地图下载错误类型
///Offline map download error type
typedef NS_ENUM(NSInteger, MAOfflineMapError)
{
MAOfflineMapErrorUnknown = -1, //!< 未知的错误 Unknown error
MAOfflineMapErrorCannotWriteToTmp = -2, //!< 写入临时目录失败 Failed to write to temporary directory
MAOfflineMapErrorCannotOpenZipFile = -3, //!< 打开归档文件失败 Failed to open archive file
MAOfflineMapErrorCannotExpand = -4 //!< 解归档文件失败 Failed to extract archive file
};
/**
* 当downloadStatus == MAOfflineMapDownloadStatusProgress 时, info参数是个NSDictionary,
* 如下两个key用来获取已下载和总和的数据大小(单位byte), 对应的是NSNumber(long long) 类型.
* 当downloadStatus == MAOfflineMapDownloadStatusError 时, info参数是NSError
*/
/**
* When downloadStatus == MAOfflineMapDownloadStatusProgress, the info parameter is an NSDictionary,
* The following two keys are used to obtain the size of the downloaded and total data (in bytes), corresponding to the NSNumber(long long) type.
* When downloadStatus == MAOfflineMapDownloadStatusError, the info parameter is NSError,
*/
///下载过程info的key表示已下载数据大小
///The key in the download process info, indicating the size of the downloaded data
extern NSString * const MAOfflineMapDownloadReceivedSizeKey;
///下载过程info的key表示总的数据大小
///The key in the download process info, indicating the total data size
extern NSString * const MAOfflineMapDownloadExpectedSizeKey;
/**
* @brief 离线地图下载过程回调block
* The callback block for the offline map download process
* @param downloadItem 下载的item
* Downloaded item
* @param downloadStatus 下载状态
* Download status
* @param info 下载过程中的附加信息
* Additional information during download
*/
typedef void(^MAOfflineMapDownloadBlock)(MAOfflineItem * downloadItem, MAOfflineMapDownloadStatus downloadStatus, id info);
/**
* @brief 离线地图检查更新回调block
* Offline map check update callback block
* @param hasNewestVersion 是否有新版本的布尔值
* Boolean value indicating whether there is a new version
*/
/**
* @brief
* @param hasNewestVersion
*/
typedef void(^MAOfflineMapNewestVersionBlock)(BOOL hasNewestVersion);
///离线地图管理类
///Offline map management class
@interface MAOfflineMap : NSObject
/**
* @brief 获取MAOfflineMap 单例
* Get MAOfflineMap singleton
* @return MAOfflineMap
*/
+ (MAOfflineMap *)sharedOfflineMap;
///省份数组(每个元素均是MAOfflineProvince类型)
///Province array (each element is of type MAOfflineProvince)
@property (nonatomic, readonly) NSArray<MAOfflineProvince *> *provinces;
///直辖市数组(每个元素均是MAOfflineItemMunicipality类型)
///Municipality array (each element is of type MAOfflineItemMunicipality)
@property (nonatomic, readonly) NSArray<MAOfflineItemMunicipality *> *municipalities;
///全国概要图
///National overview map
@property (nonatomic, readonly) MAOfflineItemNationWide *nationWide;
///城市数组, 包括普通城市与直辖市
///City array, including ordinary cities and municipalities
@property (nonatomic, readonly) NSArray<MAOfflineCity *> *cities;
///离线数据的版本号(由年月日组成, 如@"20130715")
///Version number of offline data (composed of year, month, and day, e.g., @"20130715")
@property (nonatomic, readonly) NSString *version;
/**
* @brief 初始化离线地图数据如果第一次运行且offlinePackage.plist文件不存在则需要首先执行此方法。否则MAOfflineMap中的省、市、版本号等数据都为空。
* Initialize the offline map data. If it is the first run and the offlinePackage.plist file does not exist, this method needs to be executed first. Otherwise, the data such as provinces, cities, and version numbers in MAOfflineMap will be empty.
* @param block 初始化完成回调
* Initialization completion callback
*/
- (void)setupWithCompletionBlock:(void(^)(BOOL setupSuccess))block;
/**
* @brief 启动下载
* Start download
* @param item 数据
* Data
* @param shouldContinueWhenAppEntersBackground 进入后台是否允许继续下载
* Whether to allow continued download in the background
* @param downloadBlock 下载过程block
* Download process block
*/
- (void)downloadItem:(MAOfflineItem *)item shouldContinueWhenAppEntersBackground:(BOOL)shouldContinueWhenAppEntersBackground downloadBlock:(MAOfflineMapDownloadBlock)downloadBlock;
/**
* @brief 监测是否正在下载
* Monitor whether downloading is in progress
* @param item 条目
* item
* @return 是否在下载
* whether downloading is in progress
*/
- (BOOL)isDownloadingForItem:(MAOfflineItem *)item;
/**
* @brief 暂停下载
* pause download
* @param item 条目
* item
* @return 是否在执行了cancel如果该item并未在下载中则返回NO
* whether cancel has been executed, if the item is not being downloaded, return NO
*/
- (BOOL)pauseItem:(MAOfflineItem *)item;
/**
* @brief 删除item对应离线地图数据
* delete the offline map data corresponding to the item
* @param item 条目
* item
*/
- (void)deleteItem:(MAOfflineItem *)item;
/**
* @brief 取消全部下载
* Cancel all downloads
*/
- (void)cancelAll;
/**
* @brief 清除所有在磁盘上的离线地图数据, 之后调用[mapView reloadMap]会使其立即生效
* Clear all offline map data on disk, calling [mapView reloadMap] will take effect immediately
*/
- (void)clearDisk;
/**
* @brief 监测新版本。注意如果有新版本会重建所有的数据包括provinces、municipalities、nationWide、cities外部使用应当在newestVersionBlock中更新所持有的对象。
* Monitor new versions. Note: If there is a new version, all data will be rebuilt, including provinces, municipalities, nationWide, cities. External usage should update the held objects in the newestVersionBlock.
* @param newestVersionBlock 回调block
* callback block
*/
- (void)checkNewestVersion:(MAOfflineMapNewestVersionBlock)newestVersionBlock;
@end
#endif

View File

@ -0,0 +1,29 @@
//
// MAOfflineMapViewController.h
// MAMapKit
//
// Created by hanxiaoming on 2017/12/14.
// Copyright © 2017年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import <UIKit/UIKit.h>
#import "MAOfflineMap.h"
///离线地图ViewControllersince 5.7.0
///Offline Map ViewControllersince 5.7.0
@interface MAOfflineMapViewController : UIViewController
/// MAOfflineMapViewController单例请使用单例以保证离线地图状态正确同步。
/// MAOfflineMapViewController singleton, please use the singleton to ensure correct synchronization of offline map status.
+ (instancetype)sharedInstance;
///MAOfflineMap实例
///MAOfflineMap instance
@property (nonatomic, readonly) MAOfflineMap *offlineMap;
@end
#endif

View File

@ -0,0 +1,26 @@
//
// MAOfflineProvince.h
// MapKit_static
//
// Created by songjian on 14-4-24.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OFFLINE
#import "MAOfflineItem.h"
#import "MAOfflineItemCommonCity.h"
///离线地图,省地图信息
///Offline map, provincial map information
@interface MAOfflineProvince : MAOfflineItem
///包含的城市数组(都是MAOfflineItemCommonCity类型)
///included city array (all of MAOfflineItemCommonCity type)
@property (nonatomic, strong, readonly) NSArray *cities;
@end
#endif

View File

@ -0,0 +1,26 @@
//
// MAOverlay.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MAAnnotation.h"
#import "MAGeometry.h"
///该类是地图覆盖物的基类,所有地图的覆盖物需要继承自此类
///This class is the base class for map overlays, all map overlays need to inherit from this class
@protocol MAOverlay <MAAnnotation>
@required
///返回区域中心坐标
///Return the center coordinates of the area
- (CLLocationCoordinate2D)coordinate;
///区域外接矩形
///The bounding rectangle of the area
- (MAMapRect)boundingMapRect;
@end

View File

@ -0,0 +1,49 @@
//
// MAOverlayPathRenderer.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import "MAOverlayRenderer.h"
#import "MAPathShowRange.h"
///该类设置overlay绘制的属性可以使用该类的子类MACircleRenderer, MAPolylineRenderer, MAPolygonRenderer或者继承该类
///This class sets the properties for overlay drawing, and you can use its subclasses MACircleRenderer, MAPolylineRenderer, MAPolygonRenderer or inherit from this class
@interface MAOverlayPathRenderer : MAOverlayRenderer
///填充颜色,默认是kMAOverlayRendererDefaultFillColor
///Fill color, default is kMAOverlayRendererDefaultFillColor
@property (nonatomic, retain) UIColor *fillColor;
///笔触颜色,默认是kMAOverlayRendererDefaultStrokeColor
///stroke color, default is kMAOverlayRendererDefaultStrokeColor
@property (nonatomic, retain) UIColor *strokeColor;
///笔触宽度, 单位屏幕点坐标默认是0
///stroke width, in screen points, default is 0
@property (nonatomic, assign) CGFloat lineWidth;
///LineJoin,默认是kMALineJoinBevel
///LineJoin, default is kMALineJoinBevel
@property (nonatomic, assign) MALineJoinType lineJoinType;
///LineCap,默认是kMALineCapButt
///LineCap, default is kMALineCapButt
@property (nonatomic, assign) MALineCapType lineCapType;
///MiterLimit,默认是2.f
///MiterLimit, default is 2.f
@property (nonatomic, assign) CGFloat miterLimit;
///虚线类型, since 5.5.0
///line dash pattern, since 5.5.0
@property (nonatomic, assign) MALineDashType lineDashType;
///是否抽稀默认为YESsince 10.0.8000
///Whether to thin, default is YES, since 10.0.8000
@property (nonatomic, assign) BOOL reducePoint;
@end

View File

@ -0,0 +1,165 @@
//
// MAOverlayRenderer.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import "MAOverlay.h"
#import "MALineDrawType.h"
#define kMAOverlayRendererDefaultStrokeColor [UIColor colorWithRed:0.3 green:0.63 blue:0.89 alpha:0.8]
#define kMAOverlayRendererDefaultFillColor [UIColor colorWithRed:0.77 green:0.88 blue:0.94 alpha:0.8]
@protocol MAOverlayRenderDelegate,MTLRenderCommandEncoder;
///该类是地图覆盖物Renderer的基类, 提供绘制overlay的接口但并无实际的实现render相关方法只能在重写后的glRender方法中使用
///This class is the base class of the map overlay Renderer, providing an interface for drawing overlays but without actual implementation (render-related methods can only be used in the overridden glRender method)
@interface MAOverlayRenderer : NSObject {
@protected
GLuint _strokeTextureID;
CGSize _strokeTextureSize;
BOOL _needsUpdate;
BOOL _needsLoadStrokeTexture;
}
///由地图添加时不要手动设置。如果不是使用mapview进行添加则需要手动设置。since 5.1.0
///When added by the map, do not set manually. If not added using mapview, manual setting is required.since 5.1.0
@property (nonatomic, weak) id<MAOverlayRenderDelegate> rendererDelegate;
///关联的overlay对象
///Associated overlay object
@property (nonatomic, readonly, retain) id <MAOverlay> overlay;
///用于生成笔触纹理id的图片支持非PowerOfTwo图片; 如果您需要减轻绘制产生的锯齿,您可以参考AMap.bundle中的traffic_texture_blue.png的方式,在image两边增加部分透明像素.)。since 5.3.0
///Images used to generate brush stroke texture IDs (supports non-PowerOfTwo images; if you need to reduce aliasing caused by drawing, you can refer to the method in AMap.bundle's traffic_texture_blue.png, adding partially transparent pixels on both sides of the image.). since 5.3.0
@property (nonatomic, strong) UIImage *strokeImage;
///笔触纹理id, 修改纹理id参考, 如果strokeImage未指定、尚未加载或加载失败返回0. 注意仅使用gles环境
///Stroke texture ID, modify texture ID reference, returns 0 if strokeImage is not specified, not yet loaded, or fails to load. Note: Only use gles environment.
@property (nonatomic, readonly) GLuint strokeTextureID __attribute((deprecated("Deprecated, since 7.9.0")));
///透明度[01]默认为1. 使用MAOverlayRenderer类提供的渲染接口会自动应用此属性。since 5.1.0
///Opacity [0, 1], default is 1. This property will be automatically applied when using the rendering interface provided by the MAOverlayRenderer class. (since 5.1.0)
@property (nonatomic, assign) CGFloat alpha;
///overlay渲染的scale。since 5.1.0
///Scale of overlay rendering.since 5.1.0
@property (nonatomic, readonly) CGFloat contentScale;
/**
* @brief 初始化并返回一个Overlay Renderer
* initialize and return an Overlay Renderer
* @param overlay 关联的overlay对象
* associated overlay object
* @return 初始化成功则返回overlay view,否则返回nil
* return the overlay view if initialization is successful, otherwise return nil
*/
- (instancetype)initWithOverlay:(id<MAOverlay>)overlay;
/**
* @brief 获取当前地图view矩阵数组长度为16无需外界释放. 需要添加至地图后才能获取有效矩阵数据否则返回NULL
* Get the current map view matrix with an array length of 16, no external release required. Valid matrix data can only be obtained after adding to the map, otherwise returns NULL.
* @return 矩阵数组
* matrix array
*/
- (float *)getViewMatrix;
/**
* @brief 获取当前地图projection矩阵数组长度为16无需外界释放. 需要添加至地图后才能获取有效矩阵数据否则返回NULL
* Get the current map projection matrix with an array length of 16, no need for external release. Valid matrix data can only be obtained after adding it to the map, otherwise returns NULL.
* @return 矩阵数组
* matrix array
*/
- (float *)getProjectionMatrix;
/**
* @brief 获取当前地图中心点偏移用以把地图坐标转换为gl坐标。需要添加到地图获取才有效。since 5.1.0
* Get the current map center offset to convert map coordinates to gl coordinates. It only takes effect when added to map acquisition since 5.1.0
* @return 偏移
* offset
*/
- (MAMapPoint)getOffsetPoint;
/**
* @brief 获取Metal渲染MTLRenderCommandEncoder对象。注意打开地图MetalEnable时有效否则为nilsince 7.9.0
* Obtain the Metal rendering MTLRenderCommandEncoder object. Note: It is valid when MetalEnable is turned on for the map, otherwise it is nil.since 7.9.0
* @return 偏移
* offset
*/
- (id<MTLRenderCommandEncoder>)getCommandEncoder;
/**
* @brief 获取当前地图缩放级别需要添加到地图获取才有效。since 5.1.0
* Get the current map zoom level, which is only valid when added to the mapsince 5.1.0
* @return 缩放级别
* Zoom level
*/
- (CGFloat)getMapZoomLevel;
/**
* @brief 将MAMapPoint转换为opengles可以直接使用的坐标
* Convert MAMapPoint to coordinates that can be directly used by OpenGLES
* @param mapPoint MAMapPoint坐标
* MAMapPoint coordinates
* @return 直接支持的坐标
* Directly supported coordinates
*/
- (CGPoint)glPointForMapPoint:(MAMapPoint)mapPoint;
/**
* @brief 批量将MAMapPoint转换为opengles可以直接使用的坐标
* Batch convert MAMapPoint to coordinates that can be directly used by opengles
* @param mapPoints MAMapPoint坐标数据指针
* MAMapPoint coordinate data pointer
* @param count 个数
* count
* @return 直接支持的坐标数据指针(需要调用者手动释放)
* Directly supported coordinate data pointer (requires manual release by the caller)
*/
- (CGPoint *)glPointsForMapPoints:(MAMapPoint *)mapPoints count:(NSUInteger)count;
/**
* @brief 将屏幕尺寸转换为OpenGLES尺寸
* Convert screen size to OpenGLES size
* @param windowWidth 屏幕尺寸
* Screen size
* @return OpenGLES尺寸
* OpenGLES size
*/
- (CGFloat)glWidthForWindowWidth:(CGFloat)windowWidth;
/**
* @brief 绘制函数(子类需要重载来实现)
* Drawing function (subclasses need to override to implement)
*/
- (void)glRender;
/**
* @brief 加载纹理图片. 注意仅使用gles环境since 5.1.0
* Load texture image. Note: Only use gles environment since 5.1.0
* @param textureImage 纹理图片需满足长宽相等且宽度值为2的次幂)
* Texture image (must meet: width and height are equal, and width value is a power of 2)
* @return openGL纹理ID, 若纹理加载失败返回0
* openGL texture ID, if texture loading fails, return 0
*/
- (GLuint)loadTexture:(UIImage *)textureImage __attribute((deprecated("Deprecated, since 7.9.0")));
/**
* @brief 删除纹理. 注意仅使用gles环境since 5.1.0
* Delete texture. Note: Only use in GLES environmentsince 5.1.0
* @param textureId 纹理ID
* Texture ID
*/
- (void)deleteTexture:(GLuint)textureId __attribute((deprecated("Deprecated, since 7.9.0")));
/**
* @brief 当关联overlay对象有更新时调用此接口刷新. since 5.0.0
* Call this interface to refresh when the associated overlay object is updated. since 5.0.0
*/
- (void)setNeedsUpdate;
@end

View File

@ -0,0 +1,46 @@
//
// MAParticleOverlay.h
// MAMapKit
//
// Created by liubo on 2018/9/19.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_ParticleSystem
#import "MAShape.h"
#import "MAOverlay.h"
#import "MAParticleOverlayOptions.h"
#pragma mark - MAParticleOverlay
///该类用于定义一个粒子MAParticleOverlay, 通常MAParticleOverlay是MAParticleOverlayRenderer的model. since 6.5.0
///This class is used to define a particle MAParticleOverlay, usually MAParticleOverlay is the model of MAParticleOverlayRenderer. since 6.5.0
@interface MAParticleOverlay : MAShape <MAOverlay>
/**
* @brief 根据粒子覆盖物选项option生成MAParticleOverlay
* Generate MAParticleOverlay based on the particle overlay option
* @param option 粒子覆盖物选项option
* Particle overlay option
* @return 新生成的粒子覆盖物MAParticleOverlay
* Newly generated MAParticleOverlay
*/
+ (instancetype)particleOverlayWithOption:(MAParticleOverlayOptions *)option;
///当前粒子覆盖物的option如果需要修改option的配置需要修改后重新调用setOverlayOption:方法。
///The option of the current particle overlay, if you need to modify the configuration of the option, you need to call the setOverlayOption: method again after modification
@property (nonatomic, strong, readonly) MAParticleOverlayOptions *overlayOption;
/**
* @brief 更新粒子覆盖物选项option
* Update the particle overlay option
* @param overlayOption 要更新的粒子覆盖物选项
* The particle overlay option to be updated
*/
- (void)updateOverlayOption:(MAParticleOverlayOptions *)overlayOption;
@end
#endif

View File

@ -0,0 +1,389 @@
//
// MAParticleOverlayOptions.h
// MAMapKit
//
// Created by liubo on 2018/9/18.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_ParticleSystem
#import "MAShape.h"
#import "MAOverlay.h"
#pragma mark - MAParticleOverlayType
///天气类型
///Weather types
typedef NS_ENUM(NSInteger, MAParticleOverlayType)
{
MAParticleOverlayTypeSunny = 1, ///<晴天 Sunny
MAParticleOverlayTypeRain, ///<雨天 Rainy
MAParticleOverlayTypeSnowy, ///<雪天 Snowy
MAParticleOverlayTypeHaze, ///<雾霾 Haze
};
#pragma mark - MAParticleVelocityGenerate
///粒子的速度生成类. since 6.5.0
///Particle velocity generation class. since 6.5.0
@protocol MAParticleVelocityGenerate <NSObject>
@required
///X轴方向上的速度变化率
///Velocity variation rate in X-axis direction
- (CGFloat)getX;
///Y轴方向上的速度变化率
///Velocity variation rate in Y-axis direction
- (CGFloat)getY;
///Z轴方向上的速度变化率
///Velocity variation rate in Z-axis direction
- (CGFloat)getZ;
@end
#pragma mark - MAParticleRandomVelocityGenerate
///粒子的随机速度生成类. since 6.5.0
///Random speed generation class for particles since 6.5.0
@interface MAParticleRandomVelocityGenerate : NSObject <MAParticleVelocityGenerate>
/**
* @brief 根据速度范围值生成粒子的速度变化类
* Speed variation class for particles based on speed range values
* @param x1 起始的速度x值
* Initial speed x value
* @param y1 起始的速度y值
* Initial speed y value
* @param z1 起始的速度z值
* Initial speed z value
* @param x2 结束的速度x值
* Final speed x value
* @param y2 结束的速度y值
* Final speed y value
* @param z2 结束的速度z值
* Final speed z value
* @return 生成粒子的颜色变化类
* Color variation class for particle generation
*/
- (instancetype)initWithBoundaryValueX1:(float)x1 Y1:(float)y1 Z1:(float)z1 X2:(float)x2 Y2:(float)y2 Z2:(float)z2;
@end
#pragma mark - MAParticleColorGenerate
///粒子的颜色生成类. since 6.5.0
///Particle color generation class. since 6.5.0
@protocol MAParticleColorGenerate <NSObject>
@required
///生成的颜色值需为包含四个float值的数组。
///The generated color value should be an array containing four float values.
- (float *)getColor;
@end
#pragma mark - MAParticleRandomColorGenerate
///粒子的随机颜色生成类. since 6.5.0
///Random color generation class for particles. since 6.5.0
@interface MAParticleRandomColorGenerate : NSObject <MAParticleColorGenerate>
/**
* @brief 根据颜色范围值生成粒子的颜色变化类
* Particle color variation class based on color range values
* @param r1 起始的颜色r值
* Starting color r value
* @param g1 起始的颜色g值
* Starting color g value
* @param b1 起始的颜色b值
* Starting color b value
* @param a1 起始的颜色a值
* Starting color a value
* @param r2 结束的颜色r值
* Ending color r value
* @param g2 结束的颜色g值
* Ending color g value
* @param b2 结束的颜色b值
* Ending color b value
* @param a2 结束的颜色a值
* Ending color a value
* @return 生成粒子的颜色变化类
* Particle color variation class
*/
- (instancetype)initWithBoundaryColorR1:(float)r1 G1:(float)g1 B1:(float)b1 A1:(float)a1 R2:(float)r2 G2:(float)g2 B2:(float)b2 A2:(float)a2;
@end
#pragma mark - MAParticleRotationGenerate
///粒子的角度生成类. since 6.5.0
///Particle angle generation class. since 6.5.0
@protocol MAParticleRotationGenerate <NSObject>
@required
///生成的角度值
///Generated angle value
- (float)getRotate;
@end
#pragma mark - MAParticleConstantRotationGenerate
///粒子的固定角度生成类. since 6.5.0
///Particle fixed angle generation class. since 6.5.0
@interface MAParticleConstantRotationGenerate : NSObject <MAParticleRotationGenerate>
/**
* @brief 根据角度生成粒子的角度变化类
* Angle variation class for generating particles based on angle
* @param rotate 固定的角度
* Fixed angle
* @return 生成粒子的角度变化类
* Angle variation class for generating particles
*/
- (instancetype)initWithRotate:(float)rotate;
@end
#pragma mark - MAParticleSizeGenerate
///粒子的大小生成类. since 6.5.0
///Particle size generation class. since 6.5.0
@protocol MAParticleSizeGenerate <NSObject>
@required
///X轴上变化比例
///Variation ratio on the X-axis
- (float)getSizeX:(float)timeFrame;
///Y轴上变化比例
///Variation ratio on the Y-axis
- (float)getSizeY:(float)timeFrame;
///Z轴上变化比例
///Variation ratio on the Z-axis
- (float)getSizeZ:(float)timeFrame;
@end
#pragma mark - MAParticleCurveSizeGenerate
///粒子的大小变化类. since 6.5.0
///Particle size variation class. since 6.5.0
@interface MAParticleCurveSizeGenerate : NSObject <MAParticleSizeGenerate>
/**
* @brief 根据三个轴上的变化比例生成粒子的大小变化类
* Generate particle size variation class based on the scaling ratio on three axes
* @param x X轴上变化比例
* Variation ratio on the X-axis
* @param y Y轴上变化比例
* Variation ratio on the Y-axis
* @param z Z轴上变化比例
* Variation ratio on the Z-axis
* @return 生成粒子的大小变化类
* Generate particle size variation class
*/
- (instancetype)initWithCurveX:(float)x Y:(float)y Z:(float)z;
@end
#pragma mark - MAParticleEmissionModuleOC
///粒子的发射率类,每隔多少时间发射粒子数量,越多会越密集. since 6.5.0
///Particle emission rate class, the number of particles emitted per unit time, the more the denser. since 6.5.0
@interface MAParticleEmissionModuleOC : NSObject
/**
* @brief 根据发射数量和发射间隔生成粒子的发射率类。关系为:"发射数量为rate粒子->等待rateTime间隔->发射数量为rate粒子->等待rateTime间隔"循环
* Generate the emission rate class of particles based on the number of emissions and the emission interval. The relationship is: "emit rate particles -> wait rateTime interval -> emit rate particles -> wait rateTime interval
* @param rate 发射数量(不能为0)
* Emission count (cannot be 0)
* @param rateTime 发射间隔
* Emission interval
* @return 生成粒子的发射率类
* Emission rate class of generated particles
*/
- (instancetype)initWithEmissionRate:(int)rate rateTime:(int)rateTime;
@end
#pragma mark - MAParticleShapeModule
///粒子的发射区域模型协议. since 6.5.0
///Emission area model protocol for particles. since 6.5.0
@protocol MAParticleShapeModule <NSObject>
@required
///新生成的发射点坐标需为包含三个float值的数组。
///Newly generated emission point coordinates, must be an array containing three float values
- (float *)getPoint;
///坐标是否按比例生成
///Are coordinates generated proportionally
- (BOOL)isRatioEnable;
@end
#pragma mark - MAParticleSinglePointShapeModule
///粒子的发射单个点区域模型. since 6.5.0
///The emission single-point area model of particles. since 6.5.0
@interface MAParticleSinglePointShapeModule : NSObject <MAParticleShapeModule>
/**
* @brief 生成粒子的发射矩形区域模型,以比例的形式设置发射区域
* The emission rectangular area model of particles, setting the emission area in proportion
* @param x x坐标比例
* X-coordinate proportion
* @param y y坐标比例
* Y-coordinate proportion
* @param z z坐标比例
* Z-coordinate proportion
* @param isUseRatio 是否按比例
* Is it proportional
* @return 新生成的粒子发射单个点区域模型
* Newly generated particle emission single-point area model
*/
- (instancetype)initWithShapeX:(float)x Y:(float)y Z:(float)z useRatio:(BOOL)isUseRatio;
@end
#pragma mark - MAParticleRectShapeModule
///粒子的发射矩形区域模型. since 6.5.0
///Particle emission rectangular area model. since 6.5.0
@interface MAParticleRectShapeModule : NSObject <MAParticleShapeModule>
/**
* @brief 生成粒子的发射矩形区域模型,以比例的形式设置发射区域。
* Particle emission rectangular area model, setting the emission area in the form of proportions
* @param left 左边距比例
* Left margin ratio
* @param top 上边距比例
* Top margin ratio
* @param right 右边距比例
* Right margin ratio
* @param bottom 下边距比例
* Bottom margin ratio
* @param isUseRatio 是否按比例
* Is it proportional
* @return 新生成的粒子发射矩形区域模型
* Newly generated particle emission rectangular area model
*/
- (instancetype)initWithLeft:(float)left top:(float)top right:(float)right bottom:(float)bottom useRatio:(BOOL)isUseRatio;
@end
#pragma mark - MAParticleOverLifeModuleOC
///粒子生命周期过程中状态变化,包含速度、旋转和颜色的变化. since 6.5.0
///State changes during the particle life cycle, including changes in velocity, rotation, and color. since 6.5.0
@interface MAParticleOverLifeModuleOC : NSObject
/**
* @brief 设置粒子生命周期过程中速度的变化
* Set the change in speed during the particle's life cycle
* @param velocity 遵循MAParticleVelocityGenerate协议的速度生成类
* Speed generation class that follows the MAParticleVelocityGenerate protocol
*/
- (void)setVelocityOverLife:(id<MAParticleVelocityGenerate>)velocity;
/**
* @brief 设置粒子生命周期过程中角度的变化
* Set the change in angle during the particle's life cycle
* @param rotation 遵循MAParticleRotationGenerate协议的角度生成类
* Angle generation class conforming to the MAParticleRotationGenerate protocol
*/
- (void)setRotationOverLife:(id<MAParticleRotationGenerate>)rotation;
/**
* @brief 设置粒子生命周期过程中大小的变化
* Set the size variation during the particle's lifecycle
* @param size 遵循MAParticleSizeGenerate协议的大小生成类
* Size generation class conforming to the MAParticleSizeGenerate protocol
*/
- (void)setSizeOverLife:(id<MAParticleSizeGenerate>)size;
/**
* @brief 设置粒子生命周期过程中颜色的变化
* Set color changes during the particle lifecycle
* @param color 遵循MAParticleColorGenerate协议的颜色生成类
* A color generation class conforming to the MAParticleColorGenerate protocol
*/
- (void)setColorOverLife:(id<MAParticleColorGenerate>)color;
@end
#pragma mark - MAParticleOverlayOptions
///该类用于定义一个粒子覆盖物显示选项. since 6.5.0
///This class is used to define display options for particle overlays. since 6.5.0
@interface MAParticleOverlayOptions : NSObject
///option选项是否可见. (默认YES)
///Whether the option is visible. (Default YES)
@property (nonatomic, assign) BOOL visibile;
///粒子系统存活时间. (默认5000,单位毫秒))
///Particle system lifetime. (Default 5000, unit milliseconds)
@property (nonatomic, assign) NSTimeInterval duration;
///粒子系统是否循环. (默认YES)
///Whether the particle system loops. (Default YES)
@property (nonatomic, assign) BOOL loop;
///粒子系统的粒子最大数量. (默认100)
///Maximum number of particles in the particle system. (Default 100)
@property (nonatomic, assign) NSInteger maxParticles;
///粒子系统的粒子图标. (默认nil)
///Particle icon of the particle system. (Default nil)
@property (nonatomic, strong) UIImage *icon;
///每个粒子的初始大小. (默认(32.f*[[UIScreen mainScreen] nativeScale], 32.f*[[UIScreen mainScreen] nativeScale]),单位:OpenGLESPixels数量计算方式为: OpenGLESPixels = ScreenPoint数量 * [[UIScreen mainScreen] nativeScale])
///Initial size of each particle.(Default(32.f*[[UIScreen mainScreen] nativeScale], 32.f*[[UIScreen mainScreen] nativeScale]),Unit: OpenGLESPixels quantity, calculated as: OpenGLESPixels = ScreenPoint quantity * [[UIScreen mainScreen] nativeScale])
@property (nonatomic, assign) CGSize startParticleSize;
///每个粒子的存活时间. (默认5000,单位毫秒)
///Lifetime of each particle. (Default 5000, unit: milliseconds)
@property (nonatomic, assign) NSTimeInterval particleLifeTime;
///每个粒子的初始颜色. (默认nil)
///Initial color of each particle. (Default nil)
@property (nonatomic, strong) id<MAParticleColorGenerate> particleStartColor;
///每个粒子的初始速度. (默认nil)
///Initial velocity of each particle. (Default nil)
@property (nonatomic, strong) id<MAParticleVelocityGenerate> particleStartSpeed;
///粒子的发射率,参考 MAParticleEmissionModuleOC 类. (默认nil)
///The emission rate of particles, refer to the MAParticleEmissionModuleOC class. (default nil)
@property (nonatomic, strong) MAParticleEmissionModuleOC *particleEmissionModule;
///粒子的发射区域模型. (默认nil)
///The emission area model of particles. (default nil)
@property (nonatomic, strong) id<MAParticleShapeModule> particleShapeModule;
///粒子生命周期过程,参考 MAParticleOverLifeModuleOC 类. (默认nil)
///The life cycle process of particles, refer to the MAParticleOverLifeModuleOC class. (default nil)
@property (nonatomic, strong) MAParticleOverLifeModuleOC *particleOverLifeModule;
@end
#pragma mark - MAParticleOverlayOptionsFactory
///该类用于根据指定的天气类型生成SDK内置的天气粒子覆盖物显示选项option. since 6.5.0
///This class is used to generate the built-in weather particle overlay display option based on the specified weather type. since 6.5.0
@interface MAParticleOverlayOptionsFactory : NSObject
/**
* @brief 根据指定的天气类型生成粒子覆盖物显示选项option
* Generate particle overlay display options based on specified weather types
* @param particleType 天气类型
* weather type
* @return 新生成的粒子覆盖物显示选项option
* newly generated particle overlay display options
*/
+ (NSArray<MAParticleOverlayOptions *> *)particleOverlayOptionsWithType:(MAParticleOverlayType)particleType;
@end
#endif

View File

@ -0,0 +1,36 @@
//
// MAParticleOverlayRenderer.h
// MAMapKit
//
// Created by liubo on 2018/9/19.
// Copyright © 2018年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_ParticleSystem
#import "MAOverlayRenderer.h"
#import "MAParticleOverlayOptions.h"
#import "MAParticleOverlay.h"
///该类是MAParticleOverlay的显示Renderer. since 6.5.0
///This class is the display Renderer of MAParticleOverlay. since 6.5.0
@interface MAParticleOverlayRenderer : MAOverlayRenderer
///关联的MAParticleOverlay model
///Associated MAParticleOverlay model
@property (nonatomic, readonly) MAParticleOverlay *particleOverlay;
/**
* @brief 根据指定MAParticleOverlay生成对应的Renderer
* Generate the corresponding Renderer based on the specified MAParticleOverlay
* @param particleOverlay 指定的MAParticleOverlay model
* the specified MAParticleOverlay model
* @return 生成的Renderer
* the generated Renderer
*/
- (instancetype)initWithParticleOverlay:(MAParticleOverlay *)particleOverlay;
@end
#endif

View File

@ -0,0 +1,24 @@
//
// MAPathShowRange.h
// MAMapKit
//
// Created by shaobin on 2019/12/31.
// Copyright © 2019 Amap. All rights reserved.
//
#ifndef MAPathShowRange_h
#define MAPathShowRange_h
struct MAPathShowRange {
float begin; ///<起点位置,整数部分表示起点索引,小数部分表示在线段上的位置 Start position, the integer part represents the start index, the decimal part represents the position on the segment
float end; ///<终点位置,整数部分表示起点索引,小数部分表示在线段上的位置 End position, the integer part represents the start index, the decimal part represents the position on the segment
};
typedef struct MAPathShowRange MAPathShowRange;
static inline MAPathShowRange MAPathShowRangeMake(float begin, float end) {
return (MAPathShowRange){begin, end};
}
#endif /* MAPathShowRange_h */

View File

@ -0,0 +1,32 @@
//
// MAPinAnnotationView.h
// MAMapKitDemo
//
// Created by songjian on 13-1-7.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MAMapView.h"
#import "MAAnnotationView.h"
///MAPinAnnotationColor
typedef NS_ENUM(NSInteger, MAPinAnnotationColor){
MAPinAnnotationColorRed = 0, ///< 红色大头针 Red pin
MAPinAnnotationColorGreen, ///< 绿色大头针 Green pin
MAPinAnnotationColorPurple ///< 紫色大头针 Purple pin
};
///提供类似大头针效果的annotation view
///Annotation view providing a pin-like effect
@interface MAPinAnnotationView : MAAnnotationView
///大头针的颜色
///The color of the pin
@property (nonatomic) MAPinAnnotationColor pinColor;
///添加到地图时是否使用下落动画效果
///Whether to use a drop animation effect when adding to the map
@property (nonatomic) BOOL animatesDrop;
@end

View File

@ -0,0 +1,30 @@
//
// MAPoiFilter.h
// MAMapKit
//
// Created by linshiqing on 2024/6/18.
// Copyright © 2024 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MAMapView;
NS_ASSUME_NONNULL_BEGIN
typedef NS_OPTIONS(NSUInteger, MAPoiFilterType) {
MAPoiFilterTypePoi = 0x00000001, //!< 避让POI Avoid POI
MAPoiFilterTypeRoadName = 0x00000002, //!< 避让底图路名 Avoid basemap road names
MAPoiFilterTypeRoadShield = 0x00000004, //!< 避让路牌 Avoid road signs
MAPoiFilterTypeLabel3rd = 0x00000008, //!< 避让第三方label Avoid third-party labels
MAPoiFilterTypeAll = 0xFFFFFFFF //!< 避让所有 Avoid all
};
@interface MAPoiFilter : NSObject
@property (nonatomic, assign) MAPoiFilterType filterType; //!< 避让类型 Avoid type
// 请将CLLocationCoordinate2D类型使用[NSValue valueWithMACoordinate:]包装下
//Please wrap the CLLocationCoordinate2D type with [NSValue valueWithMACoordinate:]
@property (nonatomic, copy) NSArray<NSValue *> *position; //!< 四边形避让框坐标 Quadrilateral avoidance box coordinates
@property (nonatomic, copy) NSString *keyName; //!< 避让框名称 Avoidance box name
+ (instancetype)poiFilter:(MAMapView *)mapView filterType:(MAPoiFilterType)filterType keyName:(NSString *)keyName center:(CLLocationCoordinate2D)center width:(CGFloat)width height:(CGFloat)height;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,29 @@
//
// MAPointAnnotation.h
// MAMapKitDemo
//
// Created by songjian on 13-1-7.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MAShape.h"
#import <CoreLocation/CLLocation.h>
///点标注数据
///Point annotation data
@interface MAPointAnnotation : MAShape
///经纬度
///Latitude and longitude
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///是否固定在屏幕一点, 注意,拖动或者手动改变经纬度,都会导致设置失效
///Whether it is fixed at a point on the screen, note that dragging or manually changing the latitude and longitude will cause the setting to become invalid
@property (nonatomic, assign, getter = isLockedToScreen) BOOL lockedToScreen;
///固定屏幕点的坐标
///Fixed screen point coordinates
@property (nonatomic, assign) CGPoint lockedScreenPoint;
@end

View File

@ -0,0 +1,69 @@
//
// MAPolygon.h
// MAMapKit
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import "MAMultiPoint.h"
#import "MAOverlay.h"
///此类用于定义一个由多个点组成的闭合多边形, 点与点之间按顺序尾部相连, 第一个点与最后一个点相连, 通常MAPolygon是MAPolygonView的model
///This class is used to define a closed polygon composed of multiple points, where the points are connected sequentially from tail to head, and the first point is connected to the last point. Typically, MAPolygon is the model of MAPolygonView.
@interface MAPolygon : MAMultiPoint <MAOverlay>
///设置中空区域用来创建中间带空洞的复杂图形。注意传入的overlay只支持MAPolgon类型和MACircle类型,不支持与polygon边相交或在polygon外部,不支持hollowShapes彼此间相交,和空洞顺序有关,不支持嵌套. since 5.5.0
///Set the hollow area to create complex shapes with holes in the middle. Note: The incoming overlay only supports MAPolgon type and MACircle type. Intersection with polygon edges or being outside the polygon is not supported, intersection between hollowShapes is not supported, it is related to the order of holes, nesting is not supported. since 5.5.0
@property (nonatomic, strong) NSArray<id<MAOverlay>> *hollowShapes;
/**
* @brief 根据经纬度坐标数据生成闭合多边形
* Generate a closed polygon based on latitude and longitude coordinate data
* @param coords 经纬度坐标点数据,coords对应的内存会拷贝,调用者负责该内存的释放
* The memory corresponding to the latitude and longitude coordinate points, coords, will be copied, and the caller is responsible for releasing this memory
* @param count 经纬度坐标点数组个数
* The number of latitude and longitude coordinate point arrays
* @return 新生成的多边形
* Newly generated polygon
*/
+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
* @brief 根据map point数据生成多边形
* Generate polygon based on map point data
* @param points map point数据,points对应的内存会拷贝,调用者负责该内存的释放
* map point data, the memory corresponding to points will be copied, the caller is responsible for releasing this memory
* @param count 点的个数
* number of points
* @return 新生成的多边形
* Newly generated polygon
*/
+ (instancetype)polygonWithPoints:(MAMapPoint *)points count:(NSUInteger)count;
/**
* @brief 重新设置多边形顶点. since 5.0.0
* Reset polygon vertices. since 5.0.0
* @param points 指定的直角坐标点数组, C数组内部会做copy调用者负责内存管理
* specified rectangular coordinate point array, C array, internal copy will be made, caller is responsible for memory management
* @param count 坐标点的个数
* number of coordinate points
* @return 是否设置成功
* whether the setup was successful
*/
- (BOOL)setPolygonWithPoints:(MAMapPoint *)points count:(NSInteger)count;
/**
* @brief 重新设置多边形顶点. since 5.0.0
* Reset polygon vertices. since 5.0.0
* @param coords 指定的经纬度坐标点数组, C数组内部会做copy调用者负责内存管理
* specified latitude and longitude coordinate point array, C array, internal copy will be made, caller is responsible for memory management
* @param count 坐标点的个数
* number of coordinate points
* @return 是否设置成功
* whether the setup was successful
*/
- (BOOL)setPolygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger)count;
@end

View File

@ -0,0 +1,32 @@
//
// MAPolygonRenderer.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import "MAPolygon.h"
#import "MAOverlayPathRenderer.h"
///此类用于绘制MAPolygon,可以通过MAOverlayPathRenderer修改其fill和stroke attributes
///This class is used to draw MAPolygon, and its fill and stroke attributes can be modified through MAOverlayPathRenderer
@interface MAPolygonRenderer : MAOverlayPathRenderer
///关联的MAPolygon model
///associated MAPolygon model
@property (nonatomic, readonly) MAPolygon *polygon;
/**
* @brief 根据指定的多边形生成一个多边形Renderer
* Generate a polygon Renderer based on the specified polygon
* @param polygon polygon 指定的多边形数据对象
* polygon specifies the polygon data object
* @return 新生成的多边形Renderer
* newly generated polygon Renderer
*/
- (instancetype)initWithPolygon:(MAPolygon *)polygon;
@end

View File

@ -0,0 +1,65 @@
//
// MAPolyline.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import "MAMultiPoint.h"
#import "MAOverlay.h"
///此类用于定义一个由多个点相连的多段线,点与点之间尾部相连但第一点与最后一个点不相连, 通常MAPolyline是MAPolylineView的model
///This class is used to define a polyline connected by multiple points, where the points are connected end-to-end but the first point is not connected to the last point. Typically, MAPolyline is the model of MAPolylineView.
@interface MAPolyline : MAMultiPoint <MAOverlay>
/**
* @brief 根据map point数据生成多段线
* Generate polylines based on map point data
* @param points map point数据,points对应的内存会拷贝,调用者负责该内存的释放
* map point data, the memory corresponding to points will be copied, the caller is responsible for releasing this memory
* @param count map point个数
* number of map points
* @return 生成的多段线
* generated polylines
*/
+ (instancetype)polylineWithPoints:(MAMapPoint *)points count:(NSUInteger)count;
/**
* @brief 根据经纬度坐标数据生成多段线
* Generate a polyline based on latitude and longitude coordinate data
* @param coords 经纬度坐标数据,coords对应的内存会拷贝,调用者负责该内存的释放
* Latitude and longitude coordinate data, the memory corresponding to coords will be copied, the caller is responsible for releasing this memory
* @param count 经纬度坐标个数
* Number of latitude and longitude coordinates
* @return 生成的多段线
* generated polylines
*/
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
* @brief 重新设置折线坐标点. since 5.0.0
* Reset polyline coordinate points. since 5.0.0
* @param points 指定的直角坐标点数组, C数组内部会做copy调用者负责内存管理
* Specified rectangular coordinate point array, C array, internal copy will be made, caller is responsible for memory management.
* @param count 坐标点的个数
* Number of coordinate points
* @return 是否设置成功
* Whether the setting is successful
*/
- (BOOL)setPolylineWithPoints:(MAMapPoint *)points count:(NSInteger)count;
/**
* @brief 重新设置折线坐标点. since 5.0.0
* Reset polyline coordinate points. since 5.0.0
* @param coords 指定的经纬度坐标点数组, C数组内部会做copy调用者负责内存管理
* Specified latitude-longitude coordinate point array, C array, internal copy will be made, caller is responsible for memory management.
* @param count 坐标点的个数
* Number of coordinate points
* @return 是否设置成功
* Whether the setting is successful
*/
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger)count;
@end

View File

@ -0,0 +1,57 @@
//
// MAPolylineRenderer.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <UIKit/UIKit.h>
#import "MAPolyline.h"
#import "MAOverlayPathRenderer.h"
#import "MAPathShowRange.h"
///此类用于绘制MAPolyline,可以通过MAOverlayPathRenderer修改其fill和stroke attributes
///This class is used to draw MAPolyline, and its fill and stroke attributes can be modified through MAOverlayPathRenderer.
@interface MAPolylineRenderer : MAOverlayPathRenderer
///关联的MAPolyline model
///associated MAPolyline model
@property (nonatomic, readonly) MAPolyline *polyline;
///设置是否显示3d箭头线, 默认为NO。如果设置为YES则为3d箭头线。since 6.7.0
///Set whether to display the 3D arrow line, default is NO. If set to YES, it will be a 3D arrow line. since 6.7.0
@property (nonatomic, assign) BOOL is3DArrowLine;
///设置为立体3d箭头的侧边颜色当is3DArrowLine为YES时有效)顶部颜色使用strokeColor。since 6.7.0
///Set the side color of the 3D arrow (effective when is3DArrowLine is YES) The top color uses strokeColor. since 6.7.0
@property (nonatomic, strong) UIColor *sideColor;
///是否开启点击选中功能默认NO. since 7.1.0
///Whether to enable the click selection function, default is NO. since 7.1.0
@property (nonatomic, assign) BOOL userInteractionEnabled;
///用于调整点击选中热区大小默认为0. 负值增大热区,正值减小热区. since 7.1.0
///Used to adjust the size of the click selection hotspot, default is 0. Negative values increase the hotspot, positive values decrease the hotspot. since 7.1.0
@property (nonatomic, assign) CGFloat hitTestInset;
///是否启用显示范围YES启用不启用时展示全路径 since 7.5.0
///Whether to enable the display range, YES to enable, when not enabled, the full path is displayed. since 7.5.0
@property (nonatomic, assign) BOOL showRangeEnabled;
///显示范围 since 7.5.0
///Display range since 7.5.0
@property (nonatomic, assign) MAPathShowRange showRange;
/**
* @brief 根据指定的MAPolyline生成一个多段线Renderer
* Generate a polyline Renderer based on the specified MAPolyline
* @param polyline 指定MAPolyline
* Specify MAPolyline
* @return 新生成的多段线Renderer
* Newly generated polyline Renderer
*/
- (instancetype)initWithPolyline:(MAPolyline *)polyline;
@end

View File

@ -0,0 +1,54 @@
//
// MARouteOverlay.h
// MAMapKit
//
// Created by linshiqing on 2024/1/18.
// Copyright © 2024 Amap. All rights reserved.
//
#import "MAConfig.h"
#if FEATURE_ROUTE_OVERLAY
#import "MABaseEngineOverlay.h"
#import "MARouteOverlayModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface MARouteOverlay : MABaseEngineOverlay
@property (nonatomic, assign, readonly) NSUInteger mapScene;
@property (nonatomic, copy, readonly) NSArray<MARouteOverlayParam *> *params;
@property (nonatomic, assign, readonly) BOOL select;
@property (nonatomic, strong, readonly) MAMapRouteOverlayData *data;
@property (nonatomic, copy, readonly) NSArray<NSNumber *> *passedColors;
- (instancetype)initWithMapSecne:(NSUInteger)mapScene params:(NSArray<MARouteOverlayParam *> *)params select:(BOOL)select data:(MAMapRouteOverlayData *)data passedColors:(NSArray<NSNumber *> *)passedColors;
- (void)setCar2DWithIndex:(uint32_t)index position:(float)postion;
- (void)setCar3DWithIndex:(uint32_t)index position:(float)postion;
- (void)addRouteName;
- (void)removeRouteName;
- (void)setLineWidthScale:(float)scale;
- (void)setLine2DWithLineWidth:(int32_t)lineWidth borderWidth:(int32_t)borderWidth;
- (void)setShowArrow:(BOOL)bShow;
- (void)setArrow3DTexture:(UIImage *)image;
- (void)setRouteItemParam:(MARouteOverlayParam *)routeParam;
- (void)setHighlightType:(MAMapRouteHighLightType)type;
- (void)setHighlightParam:(MARouteOverlayHighLightParam *)highlightParam;
- (void)setSelectStatus:(BOOL)status;
- (void)setShowNaviRouteNameCountMap:(NSDictionary<NSNumber *, NSNumber *>*)countMap;
- (void)setArrowFlow:(BOOL)bFlow;
@end
NS_ASSUME_NONNULL_END
#endif

View File

@ -0,0 +1,161 @@
//
// MARouteOverlayModel.h
// MAMapKit
//
// Created by linshiqing on 2024/1/18.
// Copyright © 2024 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#if FEATURE_ROUTE_OVERLAY
NS_ASSUME_NONNULL_BEGIN
/**
* @brief 路线纹理枚举 Route texture enumeration
*/
typedef NS_ENUM(NSInteger, MAMapRouteTexture) {
MAMapRouteTextureNonavi = 0, //!< 非导航道路,步行代表不绘制路段 non-navigation roads, walking represents not drawing the road section
MAMapRouteTextureNavi = 1, //!< 导航道路,骑步行代表高亮路段 navigation roads, walking and cycling represent highlighted road sections
MAMapRouteTextureDefault = 2, //!< 实时交通默认状态,步行代表置灰路段 real-time traffic default state, walking represents grayed-out road sections
MAMapRouteTextureOpen = 3, //!< 实时交通畅通状态 real-time traffic smooth state
MAMapRouteTextureAmble = 4, //!< 实时交通缓行状态 Real-time traffic slow status
MAMapRouteTextureJam = 5, //!< 实时交通拥堵状态 Real-time traffic congestion status
MAMapRouteTextureCongested = 6, //!< 实时交通极其拥堵状态 Real-time traffic extremely congested status
MAMapRouteTextureArrow = 7, //!< 路线上鱼骨箭头 Fishbone arrows on the route
MAMapRouteTextureCustom1 = 8, //!< 自定义路线纹理1, 与status值对应 Custom route texture 1, corresponding to status value
MAMapRouteTextureCustom2 = 9, //!< 自定义路线纹理2, 与status值对应 Custom route texture 2, corresponding to status value
MAMapRouteTextureCustom3 = 10, //!< 自定义路线纹理3, 与status值对应 Custom route texture 3, corresponding to status value
MAMapRouteTextureCustom4 = 11, //!< 自定义路线纹理4, 与status值对应 Custom route texture 4, corresponding to status value
MAMapRouteTextureCustom5 = 12, //!< 自定义路线纹理5, 与status值对应 Custom route texture 5, corresponding to status value
MAMapRouteTextureCustom6 = 13, //!< 自定义路线纹理6, 与status值对应 Custom route texture 6, corresponding to status value
MAMapRouteTextureRapider = 16, //!< 自定义路线纹理16,极其畅通 Custom route texture 16, extremely smooth
MAMapRouteTextureRestrain = 30, //!< 自定义路线纹理30, 导航抑制状态 Custom route texture 30, navigation suppression status
MAMapRouteTextureCustomMax = 31, //!< 自定义路线纹理最大值, 与status值对应 Maximum custom route texture value, corresponding to the status value
MAMapRouteTextureCharge = 32, //!< 收费道路 Toll road
MAMapRouteTextureFree = 33, //!< 免费道路 Free road
MAMapRouteTextureLimit = 34, //!< 限行道路 Restricted road
MAMapRouteTextureSlower = 35, //!< 通勤场景下更拥堵道路 More congested road in commuting scenarios
MAMapRouteTextureFaster = 36, //!< 通勤场景下更畅通道路 Smoother roads in commuting scenarios
MAMapRouteTextureWrong = 37, //!< 报错道路 Error roads
MAMapRouteTextureFerry = 38, //!< 轮渡线 Ferry lines
MAMapRouteTextureNumber, //!< 纹理个数 Number of textures
};
@interface MAPolylineCapTextureInfo : NSObject
@property (nonatomic, assign) float x1; //!< 纹理左上角X Top-left X of texture
@property (nonatomic, assign) float y1; //!< 纹理左上角Y Top-left Y of texture
@property (nonatomic, assign) float x2; //!< 纹理右下角X Bottom-right X of texture
@property (nonatomic, assign) float y2; //!< 纹理右上角Y Top-right Y of texture
@end
@interface MAPolylineTextureInfo : MAPolylineCapTextureInfo
@property (nonatomic, assign) float textureLen; //!< 纹理长度,仅在绘制虚线线型时设置 Texture length, only set when drawing dashed line types
@end
typedef NS_ENUM(NSInteger, MAMapRouteLineWidthType) {
MAMapRouteLineWidthTypePixel = 0,
MAMapRouteLineWidthTypeMeter = 1,
};
@interface MARouteOverlayParam : NSObject
@property (nonatomic, assign) BOOL lineExtract; //!< 是否抽稀 Whether to thin out
@property (nonatomic, assign) BOOL useColor; //!< 是否使用颜色 Whether to use color
@property (nonatomic, assign) BOOL usePoint; //!< 是否使用Point点 Whether to use Point
@property (nonatomic, assign) BOOL useCap; //!< 是否使用线帽 Whether to use line caps
@property (nonatomic, assign) BOOL canBeCovered; //!< 能否被覆盖 Whether it can be covered
@property (nonatomic, assign) BOOL showArrow; //!< 是否显示箭头 上层控制箭头是否显示 Whether to display arrows Upper layer controls whether arrows are displayed
@property (nonatomic, assign) BOOL needColorGradient; //!< 是否需要渐变 Whether gradient is needed
@property (nonatomic, assign) BOOL clickable; //!< 是否可点击 Is it clickable
@property (nonatomic, assign) int32_t lineWidth; //!< 线宽 Line width
@property (nonatomic, assign) int32_t borderLineWidth; //!< 边线宽 Border width
@property (nonatomic, strong) UIImage *fillMarkerImage; //!< 里线纹理id Inner line texture ID
@property (nonatomic, strong) UIImage *simple3DFillMarkerImage; //!< 简易三维下里线纹理 Inner line texture in simple 3D
@property (nonatomic, strong) UIImage *borderMarkerImage; //!< 边线纹理id Border texture ID
@property (nonatomic, assign) uint32_t fillColor; //!< 填充颜色 Fill color
@property (nonatomic, assign) uint32_t borderColor; //!< 边颜色 Border color
@property (nonatomic, assign) uint32_t selectFillColor; //!< 选中的填充颜色 Selected fill color
@property (nonatomic, assign) uint32_t unSelectFillColor; //!< 未选中的填充颜色 Unselected fill color
@property (nonatomic, assign) uint32_t selectBorderColor; //!< 选中的边线颜色 Selected border color
@property (nonatomic, assign) uint32_t unSelectBorderColor;//!< 未选中的边线颜色 Unselected border color
@property (nonatomic, assign) uint32_t pointDistance; //!< 两点间距离 Distance between two points
@property (nonatomic, assign) uint32_t priority; //!< 设置item的优先级(只有usePoint为true有效) Set the priority of the item (only valid when usePoint is true)
@property (nonatomic, assign) MAMapRouteTexture routeTexture; //!< 路线纹理枚举 具体参考MapRouteTexture Route texture enumeration, refer to MapRouteTexture for details
@property (nonatomic, strong) MAPolylineTextureInfo *lineTextureInfo; //!< 纹理坐标参数 Texture coordinate parameters
@property (nonatomic, strong) MAPolylineTextureInfo *lineSimple3DTextureInfo;//!< 简易三维下纹理坐标参数 Simplified 3D texture coordinate parameters
@property (nonatomic, strong) MAPolylineCapTextureInfo *lineCapTextureInfo; //!< 线帽纹理参数 Line cap texture parameters
@property (nonatomic, assign) NSString *lineBorderQuery; //!< 边线纹理资源URL地址 Edge texture resource URL
@property (nonatomic, assign) NSString *lineFillQuery; //!< 中心线纹理资源URL地址 Centerline texture resource URL
@property (nonatomic, assign) MAMapRouteLineWidthType lineWidthType; //!< 线宽类型 Line width type
@end
typedef NS_ENUM(NSInteger, MAMapRouteHighLightType) {
MAMapRouteHighLightTypeNone = 0, //!< 无高亮效果 No highlight effect
MAMapRouteHighLightTypeSegment //!< 有一段路高亮,其他路段非高亮显示 One section of the road is highlighted, while other sections are not highlighted
};
@interface MARouteOverlayHighLightParam : NSObject
@property (nonatomic, assign) uint32_t fillColorHightLight; //!< 高亮路段的填充颜色 The fill color of the highlighted section
@property (nonatomic, assign) uint32_t borderColorHightLight; //!< 高亮路段的边缘颜色 The edge color of the highlighted section
@property (nonatomic, assign) uint32_t fillColorNormal; //!< 非高亮路段的填充颜色 The fill color of the non-highlighted section
@property (nonatomic, assign) uint32_t borderColorNormal; //!< 非高亮路段的边缘颜色 The edge color of the non-highlighted section
@property (nonatomic, assign) uint32_t arrowColorNormal; //!< 非高亮路段的鱼骨线颜色,高亮路段使用纹理原来的颜色 The color of the fishbone line in the non-highlighted section, the highlighted section uses the original color of the texture
@end
/**
* @brief 路线交通状态 route traffic status
*/
@interface MAMapRouteOverlayTrafficState : NSObject
@property (nonatomic, assign) uint32_t state; //!< 路线状态 4B route status 4B
@property (nonatomic, assign) uint32_t point2DIndex; //!< 二维起始坐标点索引 4B 2D starting coordinate point index 4B
@property (nonatomic, assign) uint32_t point3DIndex; //!< 三维起始坐标点索引 4B 3D starting coordinate point index 4B
@property (nonatomic, assign) uint32_t point3DCount; //!< 三维坐标点个数 4B number of 3D coordinate points 4B
@end
/**
* @brief 路线颜色 Route color
*/
@interface MAMapRouteOverlayColorIndex : NSObject
@property (nonatomic, assign) uint32_t nColor; //!< 路线颜色(ARGB) Route color(ARGB)
@property (nonatomic, assign) uint32_t point2DIndex; //!< 二维起始坐标点索引 (如无二维坐标) 2D starting coordinate point index (if no 2D coordinates)
@property (nonatomic, assign) uint32_t point3DIndex; //!< 三维起始坐标点索引 4B 3D starting coordinate point index 4B
@property (nonatomic, assign) uint32_t point3DCount; //!< 三维坐标点个数 4B number of 3D coordinate points 4B
@end
/**
* @brief 路线道路名称 Route road name
*/
@interface MAMapRouteOverlayRoadName : NSObject
@property (nonatomic, copy) NSString *name; //!< 道路名称字符串, UTF8编码 Road name string, UTF8 encoding
@property (nonatomic, assign) uint32_t point2DIndex; //!< 道路对应的二维形点起始索引 4B Starting index of 2D shape points for road (4B)
@property (nonatomic, assign) uint32_t point2DSize; //!< 道路对应的二维形点个数 4B Number of 2D shape points for road (4B)
@property (nonatomic, assign) uint32_t point3DIndex; //!< 道路对应的三维形点起始索引 4B Starting index of 3D shape points for the road 4B
@property (nonatomic, assign) uint32_t point3DSize; //!< 道路对应的三维形点个数 4B Number of 3D shape points for the road 4B
@property (nonatomic, assign) uint32_t roadLength; //!< 道路长度 4B Road length 4B
@property (nonatomic, assign) uint32_t roadClass; //!< 道路等级 4B Road level 4B
@end
@interface MAMapPoint2F : NSObject
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@end
@interface MAMapPoint3F : MAMapPoint2F
@property (nonatomic, assign) CGFloat z;
@end
@interface MAMapRouteOverlayData : NSObject
@property (nonatomic, assign) uint32_t checkFlag;
@property (nonatomic, assign) uint32_t routeType;
@property (nonatomic, copy) NSArray<MAMapPoint2F *> *point2DArray;
@property (nonatomic, copy) NSArray<MAMapRouteOverlayTrafficState *> *trafficStateArray;
@property (nonatomic, copy) NSArray<MAMapRouteOverlayRoadName *> *roadNameArray;
@property (nonatomic, copy) NSArray<NSNumber *> *point2DFlagArray;
@property (nonatomic, copy) NSArray<MAMapPoint3F *> *point3DArray;
@property (nonatomic, copy) NSArray<NSNumber *> *point3DFlagArray;
@property (nonatomic, copy) NSArray<MAMapRouteOverlayColorIndex *> *colorIndexArray;
@end
NS_ASSUME_NONNULL_END
#endif

View File

@ -0,0 +1,28 @@
//
// MAShape.h
// MAMapKit
//
//
// Copyright (c) 2011年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import "MAAnnotation.h"
#import "MABaseOverlay.h"
///该类为一个抽象类定义了基于MAAnnotation的MAShape类的基本属性和行为不能直接使用必须子类化之后才能使用
///This is an abstract class that defines the basic properties and behaviors of the MAShape class based on MAAnnotation. It cannot be used directly and must be subclassed before use.
@interface MAShape : MABaseOverlay <MAAnnotation> {
NSString *_title; ///<标题 Title
NSString *_subtitle; ///<副标题 Subtitle
}
///标题 Title
@property (nonatomic, copy) NSString *title;
///副标题 Subtitle
@property (nonatomic, copy) NSString *subtitle;
@end

View File

@ -0,0 +1,33 @@
//
// MATopographyOverlay.h
// MAMapKit
//
// Created by JZ on 2021/3/17.
// Copyright © 2021 Amap. All rights reserved.
//
#import "MAMapKit.h"
NS_ASSUME_NONNULL_BEGIN
@interface MATerrainOverlay : MATileOverlay
///terrainURLTemplate获取地形数据默认使用高德地形数据
///terrainURLTemplate obtains terrain data, defaulting to AutoNavi terrain data
@property (readonly) NSString *terrainURLTemplate;
///terrainTextureURLTemplate获取地形纹理数据默认使用高德卫星数据
///terrainTextureURLTemplate obtains terrain texture data, defaulting to AutoNavi satellite imagery
@property (readonly) NSString *terrainTextureURLTemplate;
@property (strong, nonatomic) UIImage *terrainDefalutImage;
/**
* @brief 初始化地形overlay
* initialize terrain overlay
*/
- (instancetype)initDefaultTerrainOverlay;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,18 @@
//
// MATopographyOverlayRenderer.h
// MAMapKit
//
// Created by JZ on 2021/3/17.
// Copyright © 2021 Amap. All rights reserved.
//
#import "MAMapKit.h"
#import "MATileOverlayRenderer.h"
NS_ASSUME_NONNULL_BEGIN
@interface MATerrainOverlayRenderer : MATileOverlayRenderer
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,97 @@
//
// MATileOverlay.h
// MapKit_static
//
// Created by Li Fei on 11/22/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_TILE
#import "MAOverlay.h"
#import "MABaseOverlay.h"
///该类是覆盖在球面墨卡托投影上的图片tiles的数据源
///This class is the data source for image tiles covering the spherical Mercator projection
@interface MATileOverlay : MABaseOverlay
///瓦片大小默认是256x256, 最小支持64*64
///Tile size, default is 256x256, minimum support is 64*64
@property (nonatomic, assign) CGSize tileSize;
///tileOverlay的可见最小Zoom值
///The minimum visible Zoom value for tileOverlay
@property NSInteger minimumZ __attribute((deprecated("Deprecated, calling has no effect. since 9.6.0")));
///tileOverlay的可见最大Zoom值
///The maximum visible Zoom value of tileOverlay
@property NSInteger maximumZ __attribute((deprecated("Deprecated, calling has no effect. since 9.6.0")));
///同initWithURLTemplate:中的URLTemplate
///Same as the URLTemplate in initWithURLTemplate:
@property (readonly) NSString *URLTemplate;
///暂未开放
///not yet open
@property (nonatomic) BOOL canReplaceMapContent;
///是否停止不在显示区域内的瓦片下载默认NO. since 5.3.0
///whether to stop downloading tiles outside the display area, default is NO. since 5.3.0
@property (nonatomic, assign) BOOL disableOffScreenTileLoading;
/**
* @brief 根据指定的URLTemplate生成tileOverlay
* Generate tileOverlay based on the specified URLTemplate
* @param URLTemplate URLTemplate是一个包含"{x}","{y}","{z}","{scale}"的字符串,"{x}","{y}","{z}","{scale}"会被tile path的值所替换并生成用来加载tile图片数据的URL 。例如 http://server/path?x={x}&y={y}&z={z}&scale={scale}
* URLTemplate is a string containing "{x}","{y}","{z}","{scale}", where "{x}","{y}","{z}","{scale}" will be replaced by the tile path value to generate the URL for loading tile image data. For example, http://server/path?x={x}&y={y}&z={z}&scale={scale}
* @return 以指定的URLTemplate字符串生成tileOverlay
* Generate tileOverlay using the specified URLTemplate string
*/
- (id)initWithURLTemplate:(NSString *)URLTemplate;
@end
///MATileOverlayPath
struct MATileOverlayPath{
NSInteger x; ///< x坐标 x-coordinate
NSInteger y; ///< y坐标 y-coordinate
NSInteger z; ///< 缩放级别 zoom level
CGFloat contentScaleFactor; ///< 屏幕的scale factor screen's scale factor
NSInteger index; ///< 对应的下载url corresponding download URL
NSInteger requestId; ///<资源下载唯一标识,用于记录 Unique identifier for resource download, used for recording
};
typedef struct MATileOverlayPath MATileOverlayPath;
///子类可覆盖CustomLoading中的方法来自定义加载MATileOverlay的行为。
///Subclasses can override methods in CustomLoading to customize the behavior of loading MATileOverlay
@interface MATileOverlay (CustomLoading)
/**
* @brief 以tile path生成URL。用于加载tile,此方法默认填充URLTemplate
* Generate URL from tile path. Used to load tiles, this method defaults to filling URLTemplate
* @param path tile path
* @return 以tile path生成tileOverlay
* Generate tileOverlay from tile path
*/
- (NSURL *)URLForTilePath:(MATileOverlayPath)path;
/**
* @brief 加载被请求的tile,并以tile数据或加载tile失败error访问回调block;默认实现为首先用URLForTilePath去获取URL,然后用异步NSURLConnection加载tile
* Load the requested tile and access the callback block with tile data or a tile loading failure error; the default implementation first uses URLForTilePath to obtain the URL, then loads the tile asynchronously with NSURLConnection.
* @param path tile path
* @param result 用来传入tile数据或加载tile失败的error访问的回调block
* A callback block used to pass in tile data or access errors when tile loading fails
*/
- (void)loadTileAtPath:(MATileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result;
/**
* @brief 取消请求瓦片,当地图显示区域发生变化时,会取消显示区域外的瓦片的下载, 当disableOffScreenTileLoading=YES时会被调用。since 5.3.0
* Cancel tile requests, when the map display area changes, it will cancel the download of tiles outside the display area, and it will be called when disableOffScreenTileLoading=YES. since 5.3.0
* @param path tile path
*/
- (void)cancelLoadOfTileAtPath:(MATileOverlayPath)path;
@end
#endif

View File

@ -0,0 +1,41 @@
//
// MATileOverlayRenderer.h
// MapKit_static
//
// Created by Li Fei on 11/25/13.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_OVERLAY_TILE
#import "MAOverlayRenderer.h"
#import "MATileOverlay.h"
///此类是将MAOverlayRenderer中的覆盖tiles显示在地图上的Renderer
///This type of Renderer displays overlay tiles from MAOverlayRenderer on the map
@interface MATileOverlayRenderer : MAOverlayRenderer
///覆盖在球面墨卡托投影上的图片tiles的数据源
///Data source for image tiles covering the spherical Mercator projection
@property (nonatomic ,readonly) MATileOverlay *tileOverlay;
/**
* @brief 根据指定的tileOverlay生成将tiles显示在地图上的Renderer
* Generates a Renderer to display tiles on the map based on the specified tileOverlay
* @param tileOverlay 制定了覆盖图片
* Established overlay images
* @return 以tileOverlay新生成Renderer
* Newly generated Renderer with tileOverlay
*/
- (instancetype)initWithTileOverlay:(MATileOverlay *)tileOverlay;
/**
* @brief 清除所有tile的缓存并刷新overlay
* Clear the cache of all tiles and refresh the overlay
*/
- (void)reloadData;
@end
#endif

View File

@ -0,0 +1,29 @@
//
// MATouchPoi.h
// MapKit_static
//
// Created by songjian on 13-7-17.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
///MATouchPoi 定义
///MATouchPoi definition
@interface MATouchPoi : NSObject
///名称
///name
@property (nonatomic, copy, readonly) NSString *name;
///经纬度坐标
///latitude and longitude coordinates
@property (nonatomic, assign, readonly) CLLocationCoordinate2D coordinate;
///poi的ID
///POI ID
@property (nonatomic, copy, readonly) NSString *uid;
@end

View File

@ -0,0 +1,50 @@
//
// MATraceLocation.h
// MAMapKit
//
// Created by shaobin on 16/9/1.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_TRACE_CORRECT
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
///返回轨迹点定义
///Return track point definition
@interface MATracePoint : NSObject<NSCoding>
///纬度坐标
///Latitude coordinate
@property (nonatomic, assign) CLLocationDegrees latitude;
///经度坐标
///Longitude coordinate
@property (nonatomic, assign) CLLocationDegrees longitude;
@end
///传入轨迹点定义
///Incoming track point definition
@interface MATraceLocation : NSObject
///经纬度坐标
///Latitude and longitude coordinates
@property (nonatomic, assign) CLLocationCoordinate2D loc;
///角度, 标识移动方向,单位度
///Angle, indicating the direction of movement, unit degree
@property (nonatomic, assign) double angle;
///速度单位km/h
///Speed, unit km/h
@property (nonatomic, assign) double speed;
///时间,单位毫秒
///Time, unit millisecond
@property (nonatomic, assign) double time;
@end
#endif

View File

@ -0,0 +1,129 @@
//
// MATraceManager.h
// MAMapKit
//
// Created by shaobin on 16/9/1.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "MAConfig.h"
#if MA_INCLUDE_TRACE_CORRECT
#import <Foundation/Foundation.h>
#import <AMapFoundationKit/AMapFoundationKit.h>
#import "MATraceLocation.h"
@class MATraceManager;
///处理中回调, index: 批次编号0 based
///Processing callback, index: batch number, 0 based
typedef void(^MAProcessingCallback)(int index, NSArray<MATracePoint *> *points);
///成功回调distance距离单位米
///Success callback, distance: distance, unit meters
typedef void(^MAFinishCallback)(NSArray<MATracePoint *> *points, double distance);
///失败回调
///Failure callback
typedef void(^MAFailedCallback)(int errorCode, NSString *errorDesc);
///定位回调, locations: 原始定位点; tracePoints: 纠偏后的点如果纠偏失败返回nil; distance:距离; error: 纠偏失败时的错误信息
///Location callback, locations: raw location points; tracePoints: corrected points, returns nil if correction fails; distance: distance; error: error message when correction fails
typedef void(^MATraceLocationCallback)(NSArray<CLLocation *> *locations, NSArray<MATracePoint *> *tracePoints, double distance, NSError *error);
/**
* @brief 轨迹定位的代理协议since v6.2.0
* Proxy protocol for trajectory positioning since v6.2.0
*/
@protocol MATraceDelegate <NSObject>
@required
/**
* @brief 轨迹定位纠偏的回调方法since v6.2.0
* Callback method for trajectory positioning correction v6.2.0
* @param manager 轨迹定位管理对象
* Trajectory positioning management object
* @param locations 已经完成纠偏的原始定位数据
* Original positioning data that has been corrected
* @param tracePoints 已经完成纠偏处理后的轨迹点
* Trajectory points after correction processing
* @param distance 距离,单位米
* Distance, in meters
* @param error 如果成功的话为nil否则为失败原因
* If successful, it is nil, otherwise it is the reason for failure
*/
- (void)traceManager:(MATraceManager *)manager
didTrace:(NSArray<CLLocation *> *)locations
correct:(NSArray<MATracePoint *> *)tracePoints
distance:(double)distance
withError:(NSError *)error;
@optional
/**
* @brief 当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined会调用代理的此方法。
此方法实现调用后台权限API即可 该回调必须实现 [locationManager requestAlwaysAuthorization] ; since 6.8.1
* When the plist configures NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription, and [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined, this method of the delegate will be called. This method can be implemented by calling the background permission API (this callback must implement [locationManager requestAlwaysAuthorization]); since 6.8.1
* @param locationManager 地图的CLLocationManager。
* Map's CLLocationManager
*/
- (void)mapViewRequireLocationAuth:(CLLocationManager *)locationManager;
@end
///轨迹纠偏管理类
///Trajectory correction management class
@interface MATraceManager : NSObject
/**
* @brief 单例方法
* Singleton method
*/
+ (instancetype)sharedInstance;
/**
* @brief 获取纠偏后的经纬度点集
* Obtain the corrected latitude and longitude point set
* @param locations 待纠偏处理的点集, 顺序即为传入的顺序
* Point set to be corrected, the order is the input order
* @param type loctions经纬度坐标的类型, 如果已经是高德坐标系,传 -1
* The type of loctions latitude and longitude coordinates. If it is already in the AutoNavi coordinate system, pass -1
* @param processingCallback 如果一次传入点过多,内部会分批处理。每处理完一批就调用此回调
* If too many points are passed in at once, they will be processed in batches internally. This callback is called after each batch is processed
* @param finishCallback 全部处理完毕调用此回调
* This callback is called when all processing is complete
* @param failedCallback 失败调用此回调
* This callback is called on failure
* @return 返回一个NSOperation对象可调用cancel取消
* Returns an NSOperation object, which can be canceled by calling cancel
*/
- (NSOperation *)queryProcessedTraceWith:(NSArray<MATraceLocation *>*)locations
type:(AMapCoordinateType)type
processingCallback:(MAProcessingCallback)processingCallback
finishCallback:(MAFinishCallback)finishCallback
failedCallback:(MAFailedCallback)failedCallback;
/**
* @brief 轨迹定位的代理回调对象配合start和stop方法使用since v6.2.0
* The delegate callback object for trajectory positioning, used in conjunction with the start and stop methods. since v6.2.0
*/
@property (nonatomic, weak) id<MATraceDelegate> delegate;
/**
* @brief 开始轨迹定位, 内部使用系统CLLocationManagerdistanceFilterdesiredAccuracy均为系统默认值since v6.2.0
* Start trajectory tracking, internally using the system CLLocationManager, distanceFilter, and desiredAccuracy are set to system default values. since v6.2.0
*/
- (void)start;
/**
* @brief 停止轨迹定位since v6.2.0
* Stop trajectory tracking. since v6.2.0
*/
- (void)stop;
@end
#endif

View File

@ -0,0 +1,32 @@
//
// MAUserLocation.h
// MAMapKit
//
// Created by yin cai on 12-1-4.
// Copyright © 2016 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import "MAAnimatedAnnotation.h"
@class CLLocation;
@class CLHeading;
///定位信息类
///Location Information Category
@interface MAUserLocation : MAAnimatedAnnotation
///位置更新状态如果正在更新位置信息则该值为YES
///Location update status, if the location information is being updated, the value is YES
@property (readonly, nonatomic, getter = isUpdating) BOOL updating;
///位置信息如果MAMapView的showsUserLocation为NO或者尚未定位成功则该值为nil
///Location information, if the showsUserLocation of MAMapView is NO, or the location has not been successfully determined, the value is nil
@property (readonly, nonatomic, strong) CLLocation *location;
///heading信息
///Heading information
@property (readonly, nonatomic, strong) CLHeading *heading;
@end

View File

@ -0,0 +1,48 @@
//
// MAUserLocationRepresentation.h
// MAMapKit
//
// Created by shaobin on 16/12/27.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "MAConfig.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define kAccuracyCircleDefaultColor [UIColor colorWithRed:136/255.0 green:166/255.0 blue:227/255.0 alpha:.3]
///用户位置显示样式控制
///User location display style control
@interface MAUserLocationRepresentation : NSObject
///精度圈是否显示默认YES
///Whether to show the accuracy circle, default is YES
@property (nonatomic, assign) BOOL showsAccuracyRing;
///是否显示方向指示(MAUserTrackingModeFollowWithHeading模式开启)。默认为YES
///Whether to show the direction indicator (MAUserTrackingModeFollowWithHeading mode enabled). Default is YES
@property (nonatomic, assign) BOOL showsHeadingIndicator;
///精度圈 填充颜色, 默认 kAccuracyCircleDefaultColor
///Accuracy circle fill color, default is kAccuracyCircleDefaultColor
@property (nonatomic, strong) UIColor *fillColor;
///精度圈 边线颜色, 默认 kAccuracyCircleDefaultColor
///Accuracy circle border color; default is kAccuracyCircleDefaultColor
@property (nonatomic, strong) UIColor *strokeColor;
///精度圈 边线宽度默认0
///Accuracy circle border width, default is 0
@property (nonatomic, assign) CGFloat lineWidth;
///定位点背景色,不设置默认白色
///Positioning point background color, default white if not set
@property (nonatomic, strong) UIColor *locationDotBgColor;
///定位点蓝色圆点颜色,不设置默认蓝色
///Positioning point blue dot color, default blue if not set
@property (nonatomic, strong) UIColor *locationDotFillColor;
///内部蓝色圆点是否使用律动效果, 默认YES
///Whether to use pulsating effect for inner blue dot, default YES
@property (nonatomic, assign) BOOL enablePulseAnnimation;
///定位图标, 与蓝色原点互斥
///Location icon, mutually exclusive with the blue dot
@property (nonatomic, strong) UIImage* image;
@end