11#import "QAnnotation.h"
12#import "QAnnotationView.h"
13#import "QOverlayView.h"
14#import "QBasicMapViewLayer.h"
16#import "QUserLocationPresentation.h"
17#import "QTileOverlay.h"
18#import "QCustomLayer.h"
22#import "QMarkerViewDefines.h"
23#import "QMaskingLayer.h"
25typedef NS_ENUM(NSInteger, QUserTrackingMode)
27 QUserTrackingModeNone = 0,
28 QUserTrackingModeFollow = 1,
29 QUserTrackingModeFollowWithHeading = 2
32typedef NS_ENUM(NSUInteger, QMapLogoAnchor)
34 QMapLogoAnchorRightBottom = 0,
35 QMapLogoAnchorLeftBottom,
36 QMapLogoAnchorLeftTop,
37 QMapLogoAnchorRightTop,
43@protocol QMapViewDelegate;
46#pragma mark - QMapView
71#pragma mark - Resources
78+ (void)loadPrefferedResourceFilesFromDirectory:(NSString *)path;
85@property (nonatomic, weak) id<QMapViewDelegate>
delegate;
90@property (nonatomic, assign) QMapType mapType;
100- (void)setStyleType:(QMapStyleType)styleType DEPRECATED_ATTRIBUTE;
107- (void)setMapStyle:(
int)styleType;
154- (void)setCompassOffset:(CGPoint)offset;
164- (void)setForeignLanguage:(QMapLanguage)language;
169- (void)setWorldMapEnable:(BOOL)enable;
174- (void)setMapViewRenderWhenDetachedFromWindowEnabled:(BOOL)enabled;
179- (void)setMapViewRenderWhenAppInactiveEnabled:(BOOL)enabled;
184- (void)setCenterOffsetY:(
float)offset __attribute__ ((deprecated("use - (
void)setCenterOffsetV2:(CGPoint)offset animated:(BOOL)animated instead")));
189- (void)setCenterOffset:(CGPoint)offset __attribute__ ((deprecated("use - (
void)setCenterOffsetV2:(CGPoint)offset animated:(BOOL)animated instead")));
197- (void)setCenterOffset:(CGPoint)offset animated:(BOOL)animated __attribute__ ((deprecated("use - (
void)setCenterOffsetV2:(CGPoint)offset animated:(BOOL)animated instead")));
210- (void)setCenterOffsetV2:(CGPoint)offset animated:(BOOL)animated;
217- (void)setLogoOffset:(CGPoint)offset DEPRECATED_ATTRIBUTE;
225- (void)setLogoMargin:(CGPoint)margin anchor:(QMapLogoAnchor)anchor;
232- (void)setLogoScale:(CGFloat)scale;
250- (void)setScaleViewOffset:(CGPoint)offset;
266- (void) setScaleViewFadeEnable:(BOOL)enable;
273- (void)setRoadEventVisible:(BOOL)visible DEPRECATED_ATTRIBUTE;
280- (void)setBuildingBlackList:(
QMapRect*)noBuildingList count:(
int)count;
293- (void)setGLMapDefaultGroundColor:(UIColor *)defaultColor;
295#pragma mark - MapStatus
308- (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated;
331- (void)setMinZoomLevel:(CGFloat)minZoomLevel maxZoomLevel:(CGFloat)maxZoomLevel;
338- (void)setZoomLevelMultiplierForZoomIn:(CGFloat)zoomInMultiplier zoomOut:(CGFloat)zoomOutMultiplier;
346- (void)setZoomLevel:(CGFloat)zoomLevel animated:(BOOL)animated;
359- (void)setRotation:(CGFloat)rotation animated:(BOOL)animated;
370- (void)enableAutoMaxOverlooking:(BOOL)enable;
378- (void)setOverlooking:(CGFloat)overlooking animated:(BOOL)animated;
392- (void)setVisibleMapRect:(
QMapRect)mapRect animated:(BOOL)animated;
402- (void)setVisibleMapRect:(
QMapRect)mapRect edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
426- (void)setRegion:(
QCoordinateRegion)region edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
446 containsCalloutView:(BOOL)bContainsCalloutView
447 annotations:(NSArray<
id<QAnnotation> >*)annotations
448 edgePadding:(UIEdgeInsets)insets;
457- (CGFloat)zoomLevelThatFits:(
QMapRect)mapRect edgePadding:(UIEdgeInsets)insets outCenterCoordinate:(CLLocationCoordinate2D *)outCoordinate;
465-(void)setLimitMapRect:(
QMapRect)mapRect mode:(QMapLimitRectFitMode)mode;
484- (CGPoint)glVertexForCoordinate:(CLLocationCoordinate2D)coordinate;
503- (double)metersPerPointAtLatitude:(CLLocationDegrees)latitude zoomLevel:(CGFloat)zoomLevel;
505#pragma mark - Gesture Control
515@property (nonatomic, assign, getter = isKeepCenterDuringZoom) BOOL keepCenterDuringZoom;
542#pragma mark - Coordinate Convert
551- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view;
560- (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view;
585@interface QMapView (UserLocation)
650@property(nonatomic, readonly) CLAccuracyAuthorization accuracyAuthorization
API_AVAILABLE(ios(14));
655@property(nonatomic, readonly) CLAuthorizationStatus authorizationStatus
API_AVAILABLE(ios(14));
668- (void)setUserTrackingMode:(QUserTrackingMode)mode animated:(BOOL)animated;
678- (void)setUserLocationHidden:(BOOL)hidden;
683- (void)setUserLocationCompassHidden:(BOOL)hidden;
688- (void)setUserLocationNavigationGravitylineHidden:(BOOL)hidden;
694- (void)requestTempPrecisedLocation:(
QMapView *)mapView purposeKey:(NSString *)key completion:(
void(^)(NSError * error))completion API_AVAILABLE(ios(14));
701@interface QMapView (Annotation)
720- (NSSet<
id <QAnnotation>> *)annotationsInMapRect:(
QMapRect)mapRect;
727- (void)addAnnotation:(
id <QAnnotation>)annotation;
733- (void)addAnnotations:(NSArray *)annotations;
739- (void)removeAnnotation:(
id <QAnnotation>)annotation;
745- (void)removeAnnotations:(NSArray *)annotations;
759- (
QAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:(NSString *)identifier;
767- (void)bringAnnotationToFront:(
id <QAnnotation>)annotation DEPRECATED_ATTRIBUTE;
774- (void)selectAnnotation:(
id <QAnnotation>)annotation animated:(BOOL)animated;
781- (void)deselectAnnotation:(
id <QAnnotation>)annotation animated:(BOOL)animated;
789- (void)showAnnotations:(NSArray<
id<QAnnotation>> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
794#pragma mark - Overlay
799@interface QMapView (Overlay)
810- (void)addOverlay:(
id <QOverlay>)overlay;
816- (void)addOverlays:(NSArray<
id <QOverlay>> *)overlays;
823- (void)addMultiPolygons:(NSArray <
QPolygon *> *)polygons;
829- (void)removeOverlay:(
id <QOverlay>)overlay;
835- (void)removeOverlays:(NSArray<
id <QOverlay>> *)overlays;
850- (void)showOverlays:(NSArray<
id<QOverlay>> *)overlays edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
858- (void)showQMarkers:(NSArray<
QMarker *> *)markers edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
863#pragma mark - CustomLayer
868@interface QMapView (CustomLayer)
884#pragma mark - POILayer
886@interface QMapView (AOILayer)
894- (void)addAOILayer:(
QAOILayer *)layer callback:(
void(^)(BOOL success))callback;
904#pragma mark - QMaskingLayer
906@interface QMapView (QMaskingLayer)
923#pragma mark - Snapshot
927@interface QMapView (Snapshot)
934- (UIImage *)takeSnapshot
__attribute__ ((deprecated("use - (void)takeSnapshotInRect:(CGRect)rect completion:(
void (^)(UIImage *resultImage))completion instead")));
942- (void)takeSnapshotInRect:(CGRect)rect completion:(
void (^)(UIImage *resultImage))completion;
951- (void)takeSnapshotInRect:(CGRect)rect timeout:(CFTimeInterval)timeout completion:(
void (^)(UIImage *resultImage))completion;
961- (void)takeSnapshotInRect:(CGRect)rect timeout:(CFTimeInterval)timeout afterScreenUpdates:(BOOL)afterUpdates completion:(
void (^)(UIImage *resultImage))completion;
965#pragma mark - QPoiInfo
975@property (nonatomic, copy) NSString *
uid;
980@property (nonatomic, copy) NSString *
name;
985@property (nonatomic, assign) CLLocationCoordinate2D
coordinate;
1030@property (nonatomic, copy) NSString *
road;
1045@property (nonatomic, assign) NSTimeInterval
endTime;
1071@interface QMapView (Debug)
1080@interface QMapView (Cache)
1089#pragma mark - QMapViewDelegate
1094@protocol QMapViewDelegate <NSObject>
1103- (void)mapViewAuthenticationDidComplete:(
QMapView *)mapView;
1113- (void)mapViewAuthentication:(
QMapView *)mapView didFailWithError:(NSError *)error;
1127- (void)mapViewFirstRenderDidComplete:(
QMapView *)mapView;
1133- (void)mapViewStatusChangesCompleted:(
QMapView *)mapView;
1139- (void)mapViewDidMoveToCameraRestricted:(
QMapView *)mapView;
1147- (void)mapViewDidFailLoadingMap:(
QMapView *)mapView withError:(NSError *)error;
1155- (void)mapView:(
QMapView *)mapView regionWillChangeAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1169- (void)mapView:(
QMapView *)mapView regionDidChangeAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1177- (void)mapView:(
QMapView *)mapView willMoveAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1185- (void)mapView:(
QMapView *)mapView didMoveAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1193- (void)mapView:(
QMapView *)mapView willZoomAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1201- (void)mapView:(
QMapView *)mapView didZoomAnimated:(BOOL)animated gesture:(BOOL)bGesture;
1209- (void)mapView:(
QMapView *)mapView scaleViewChanged:(CGFloat)unitLength;
1216- (void)mapView:(
QMapView *)mapView gestureDidTrigger:(QGestureType)gestureType;
1225- (void)mapView:(
QMapView *)mapView gestureDidEnd:(QGestureType)gestureType;
1244- (void)mapView:(
QMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
1258- (void)mapView:(
QMapView *)mapView didTapOverlay:(
id<QOverlay>)overlay __attribute__ ((deprecated("use - (
void)mapView:(
QMapView *)mapView didTapOverlay:(
id<QOverlay>)overlay coordinate:(CLLocationCoordinate2D)coordinate instead")));
1268- (void)mapView:(
QMapView *)mapView didTapOverlay:(
id<QOverlay>)overlay coordinate:(CLLocationCoordinate2D)coordinate;
1285- (void)mapView:(
QMapView *)mapView markerOverlay:(
QMarker *)markerOverlay didChangeDragState:(QMarkerViewDragState)newState
1286 fromOldState:(QMarkerViewDragState)oldState;
1293- (void)mapView:(
QMapView *)mapView didTapMyLocation:(CLLocationCoordinate2D)location;
1364 fromOldState:(QAnnotationViewDragState)oldState;
1395- (void)mapView:(
QMapView *)mapView didAddOverlayViews:(NSArray *)overlayViews;
1401- (void)mapViewWillStartLocatingUser:(
QMapView *)mapView;
1421- (void)mapView:(
QMapView *)mapView didFailToLocateUserWithError:(NSError *)error;
1429- (void)mapView:(
QMapView *)mapView didChangeUserTrackingMode:(QUserTrackingMode)mode animated:(BOOL)animated;
1435- (void)locationManagerDidChangeAuthorization:(
QMapView *)mapView;
1441- (void)mapViewLogger:(
QMapView *)mapView logMessage:(NSString *)text;
NSArray * annotations
当前地图View的已经添加的标注数组
定义 QMapView.h:706
NSArray< id< QAnnotation > > * selectedAnnotations
当前选中的annotations get: 处于选中的标注数组,其count == 0 或者 1 set: 数组中的第一个annotation会被选中 (index = 0),其他则忽略....
定义 QMapView.h:713
void clearMapCache()
清理地图缓存数据。注: 此接口必须在地图初始化前调用
NSString * getDebugError()
地图view的错误信息, 用于定位问题
NSArray * overlays
当前mapView中已经添加的Overlay数组
定义 QMapView.h:804
NSArray< QMaskingLayer * > * maskingLayers
已添加的蒙层
定义 QMapView.h:918
(deprecated("use - (void)takeSnapshotInRect:(CGRect)rect completion:(void (^)(UIImage *resultImage))completion instead")) __attribute__()
截图
定义 QMapView.h:934
CLAuthorizationStatus authorizationStatus API_AVAILABLE(ios(14))
定位权限状态
CLLocationAccuracy desiredAccuracy
设定定位精度。默认为kCLLocationAccuracyBest
定义 QMapView.h:624
BOOL userLocationVisible
当前位置在地图中是否可见
定义 QMapView.h:673
QUserLocationPresentation * userLocatorPresentation
地图view的定位标对象
定义 QMapView.h:590
CLLocationDistance distanceFilter
设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动
定义 QMapView.h:629
CLLocationDegrees headingFilter
设定最小更新角度。默认为2度,设定为kCLHeadingFilterNone会提示任何角度改变
定义 QMapView.h:635
BOOL pausesLocationUpdatesAutomatically
定义 QMapView.h:645
QUserTrackingMode userTrackingMode
定位用户位置的模式
定义 QMapView.h:660
QUserLocation * userLocation
当前位置信息
定义 QMapView.h:619
BOOL showsUserLocation
开启定位并展示位置图标.
定义 QMapView.h:602
QOverlayLevel locatorDisplayLevel
位置图标的展示层级. 默认 QOverlayLevelAboveLabels
定义 QMapView.h:607
BOOL allowsBackgroundLocationUpdates
以上是否允许后台定位。ios9以上可用. 请参考CLLocationManager.allowsBackgroundLocationUpdates
定义 QMapView.h:640
int locatorZIndex
位置图标的显示顺序,决定了它与其它QOverlayView的压盖关系. 默认为10000000.
定义 QMapView.h:614
CLAccuracyAuthorization accuracyAuthorization API_AVAILABLE(ios(14))
定位精度权限状态
AOILayer 类
定义 QAOILayer.h:19
annotation数据的内容展示View
定义 QAnnotationView.h:20
执行地图动画对应的layer.
定义 QBasicMapViewLayer.h:37
用于自定义图层的类
定义 QCustomLayer.h:17
点击室内图上文字图标的数据信息
定义 QMapView.h:993
NSString * buildingGUID
所在室内图唯一标识
定义 QMapView.h:1002
NSString * buildingName
所在室内图楼的名称
定义 QMapView.h:1007
NSString * levelName
所在室内图楼层
定义 QMapView.h:997
地图view的核心类
定义 QMapView.h:52
CGPoint scaleOrigin
比例尺原点位置
定义 QMapView.h:255
float * glProjectionMatrix()
获取当前地图projection矩阵
CGFloat glPointRatio()
返回每屏幕Point单位对应的OpenGL坐标系下的长度
BOOL overlookingEnabled
是否支持俯视. 默认为YES.
定义 QMapView.h:525
BOOL zoomEnabled
定义 QMapView.h:510
QMapRect visibleMapRect
当前地图可见范围的mapRect
定义 QMapView.h:383
BOOL scrollEnabled
定义 QMapView.h:520
BOOL showsBaseMap
是否显示底图,默认为YES
定义 QMapView.h:139
QBasicMapViewLayer * animationLayer
地图动画Layer. 使用该layer 可以更灵活的组合 {centerCoordinate, zoomLevel, rotation, overlooking} 动画, 并且可以自定义其duratio...
定义 QMapView.h:287
CGPoint logoCenter
logo位置,需设置在地图的bounds里
定义 QMapView.h:238
BOOL showsCompass
是否显示指南针,默认为NO
定义 QMapView.h:144
BOOL showsPoi
是否显示底图上的标注及名称,默认为YES
定义 QMapView.h:127
CGSize logoSize
logo的宽高
定义 QMapView.h:243
double metersPerPointAtCurrentZoomLevel
在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米)
定义 QMapView.h:495
QCoordinateRegion region
当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围
定义 QMapView.h:407
CGFloat maxZoomLevel
最大缩放级别, 默认 maxZoomLevel = 20
定义 QMapView.h:323
CGSize scaleSize
比例尺的尺寸
定义 QMapView.h:260
CGFloat rotation
旋转角度, 正角度向右转, 单位(角度)
定义 QMapView.h:351
BOOL shows3DBuildings
是否显示建筑物样式为3D效果,默认为YES
定义 QMapView.h:122
CGFloat overlooking
Overlooking, 范围 [0, 45], 单位(角度)
定义 QMapView.h:364
CGFloat minZoomLevel
最小缩放级别, 默认 minZoomLevel = 3
定义 QMapView.h:318
CGFloat zoomLevel
缩放级别, 范围 [minZoomLevel, maxZoomLevel]
定义 QMapView.h:313
QMapLabelSize labelSize
设置底图上的标注的字体大小
定义 QMapView.h:134
CLLocationCoordinate2D centerCoordinate
中心点经纬度
定义 QMapView.h:300
BOOL showsTraffic
是否开启路况图,默认为 NO
定义 QMapView.h:63
CGPoint centerOffsetV2
设置中心点偏移,向右向下为正,默认为(0.5, 0.5),范围是 [0.05, 0.95]。若超出范围,则被裁减到 [0.05, 0.95]。
定义 QMapView.h:202
BOOL showsBuildings
是否显示建筑物,默认为YES
定义 QMapView.h:117
NSInteger preferredFramesPerSecond
当前地图最大渲染帧数,默认为60
定义 QMapView.h:149
BOOL showsScale
是否显示比例尺,默认为YES
定义 QMapView.h:112
BOOL alwaysTriggerDidTapCoordinateEnabled
当地图被单击时,是否总是触发 "地图点击回调",默认为NO. 地图点击回调:
定义 QMapView.h:540
float * glViewMatrix()
获取当前地图view矩阵
BOOL rotateEnabled
是否支持旋转. 默认为YES.
定义 QMapView.h:530
id< QMapViewDelegate > delegate
地图回调
定义 QMapView.h:85
BOOL handDrawMapEnabled
是否开启手绘图,默认为 NO
定义 QMapView.h:58
地图蒙层覆盖物
定义 QMaskingLayer.h:16
该类是地图覆盖物View的基类, 提供了绘制overlay的接口, 但是没有实际实现。希望不要直接实例化
定义 QOverlayView.h:17
点击底图上文字图标的数据信息
定义 QMapView.h:971
CLLocationCoordinate2D coordinate
经纬坐标
定义 QMapView.h:985
NSString * uid
唯一标识(可能为空).
定义 QMapView.h:975
NSString * name
名字信息
定义 QMapView.h:980
点击点事件图标的数据信息 可通过 discription 获取快捷点事件简介
定义 QMapView.h:1016
NSString * source
事件来源
定义 QMapView.h:1020
NSString * detail
事件详情信息
定义 QMapView.h:1035
NSTimeInterval updateTime
事件更新时间
定义 QMapView.h:1050
NSTimeInterval startTime
事件开始时间
定义 QMapView.h:1040
NSString * eventName
事件类型
定义 QMapView.h:1025
NSTimeInterval endTime
事件结束时间
定义 QMapView.h:1045
NSString * road
事件发生道路
定义 QMapView.h:1030
点击AOI面子点图标的数据信息 uid 为子点的唯一标识
定义 QMapView.h:1060
NSString * parentID
子点的主点唯一标识
定义 QMapView.h:1064
自定义路况样式
定义 QMapView+Config.h:99
定位信息类
定义 QUserLocation.h:16
用户定位图标自定义样式类
定义 QUserLocationPresentation.h:74
定义了地图的某一部份的数据结构
定义 QGeometry.h:31
平面投影矩形结构定义
定义 QGeometry.h:92