TencentNavKit
TNKBaseNavView.h
Go to the documentation of this file.
1//
2// TNKBaseNavView.h
3// TencentNavKit
4//
5// Created by mol on 2022/10/20.
6// Copyright © 2022 Tencent. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10#import <TencentNavKit/TNKNavViewCommonObj.h>
11#import <TencentNavKit/TNKRouteConfig.h>
12#import <TencentNavKit/TNKODMarkerPresentation.h>
13#import <TencentNavKit/TNKUserLocationPresentation.h>
14#import <TencentNavKit/TNKCommonObj.h>
15#import <QMapKit/QMapView.h>
16#import <QMapKit/QMapView+Config.h>
17#import <TencentNavKit/TNKRedLineConfig.h>
18#import <TencentNavKit/TNKTurnArrowConfig.h>
19
20
21NS_ASSUME_NONNULL_BEGIN
22
23
25@interface TNKBaseNavView : UIView
26
27- (instancetype)init UNAVAILABLE_ATTRIBUTE;
28
34- (instancetype)initWithFrame:(CGRect)frame config:(QMapConfig * _Nullable)config;
35
39@property (nonatomic, readonly) QMapView *mapView;
40
44@property (nonatomic, assign) TNKNavDayNightMode dayNightMode;
45
49@property (nonatomic, readonly) TNKNavDayNightStatus dayNightStatus;
50
56@property (nonatomic, assign) TNKNavUIMode navUIMode;
57
61@property (nonatomic, assign) BOOL followed;
62
66@property (nonatomic, assign) BOOL followEnabled;
67
71@property (nonatomic, assign) NSTimeInterval followDelay;
72
76@property (nonatomic, assign) BOOL exitOverviewEnabled;
77
81@property (nonatomic, assign) NSTimeInterval exitOverviewDelay;
82
86@property (nonatomic, assign) TNKNavUIMode nonOverviewNaviUIMode;
87
91@property (nonatomic, assign) TNKNavUIMode overviewNaviUIMode;
92
93
98@property (nonatomic, readonly) TNKRouteConfig *routeConfig;
99
100
106- (void)clearAllRouteUI;
107
113@property (nonatomic, assign) UIEdgeInsets externalEdgeInsets;
114
118@property (nonatomic, copy, nullable) NSArray<TNKCoordinatePoint *> *extraPointsForOverview;
119
126@property (nonatomic, assign) CGPoint fix3DProportion;
127
134@property (nonatomic, assign) CGPoint fix2DProportion;
135
140@property (nonatomic, assign) BOOL compassHidden;
141
142
146@property (nonatomic, assign) BOOL turnArrowEnabled;
147
151@property (nonatomic, strong) TNKTurnArrowConfig *turnArrowConfig;
152
157- (void)updateRouteConfig:(TNKRouteConfig *)routeConfig;
158
163- (void)updateOriginMarkerPresentation:(TNKODMarkerPresentation * _Nullable)originMarkerPresentation;
164
169- (void)updateDestinationMarkerPresentation:(TNKODMarkerPresentation * _Nullable)destinationMarkerPresentation;
170
175- (void)updateUserLocationPresentation:(TNKUserLocationPresentation * _Nullable)userLocationPresentation;
176
181- (void)updateRedLineConfig:(TNKRedLineConfig * _Nullable)redLineConfig;
182
183@end
184
186
187
191@property (nonatomic, assign) BOOL showsUserLocation;
192
198- (void)configureUserLocationPresentation:(QUserLocationPresentation *)presentation;
199
205- (void)setMapStyle:(int)styleType;
206
207@end
208
209NS_ASSUME_NONNULL_END
enum _TNKNavDayNightMode TNKNavDayNightMode
导航地图的日夜间模式
enum _TNKNavUIMode TNKNavUIMode
导航地图的导航模式
enum _TNKNavDayNightStatus TNKNavDayNightStatus
导航地图所处的日夜间状态
Definition: TNKBaseNavView.h:185
导航地图基础类
Definition: TNKBaseNavView.h:26
TNKNavUIMode overviewNaviUIMode
全览的导航视角模式. 全览和剩余全览.
Definition: TNKBaseNavView.h:91
void clearAllRouteUI()
清除路线相关UI.该方法用于非导航状态下清除路线相关UI。 包括导航路线、自车点图标、动态添加的限速/指示标识等.
TNKNavDayNightStatus dayNightStatus
获取地图当前日夜状态.
Definition: TNKBaseNavView.h:49
BOOL turnArrowEnabled
设置是否隐藏转弯箭头指引.该方法用于导航状态下控制显示/隐藏下一个转弯箭头指引.默认为YES
Definition: TNKBaseNavView.h:146
BOOL followed
当前是否是锁车标状态。当收到拖动地图时,地图视野一段时间内不会发生改变,follow为NO。
Definition: TNKBaseNavView.h:61
UIEdgeInsets externalEdgeInsets
设置全览和剩余全览模式下导航路线显示区域距离地图四周的边距. 当在CarNaviView上自定义显示元素时, 为避免与导航路线相互遮挡, 可调用该接口调整导航路线显示区域范围....
Definition: TNKBaseNavView.h:113
CGPoint fix3DProportion
3D导航时自车点位置在地图上位置的比例 默认值为(0.5,0.72). x取值范围为[0.25,0.75] 表示从屏幕左边起的宽度比例. y取值范围为[0.25,0....
Definition: TNKBaseNavView.h:126
CGPoint fix2DProportion
2D导航时自车点位置在地图上位置的比例 默认值为(0.5,0.6). x取值范围为[0.25,0.75] 表示从屏幕左边起的宽度比例. y取值范围为[0.25,0....
Definition: TNKBaseNavView.h:134
TNKRouteConfig * routeConfig
驾车导航路线样式配置
Definition: TNKBaseNavView.h:98
NSTimeInterval exitOverviewDelay
设置从全览到退出全览模式进入导航态的延迟时间,单位为秒,默认为10秒,区间(0,+∞).
Definition: TNKBaseNavView.h:81
BOOL compassHidden
设置是否隐藏自车点罗盘.该方法用于导航状态下控制显示/隐藏自车点罗盘. 自车点罗盘在3D车头朝上模式下会默认显示, 在2D地图朝北、全览模式和剩余全览模式下会默认隐藏.
Definition: TNKBaseNavView.h:140
NSArray< TNKCoordinatePoint * > * extraPointsForOverview
设置全览和剩余全览模式下,想要展示在可视区域内的额外的点数组。使用之后需重置为nil
Definition: TNKBaseNavView.h:118
TNKNavDayNightMode dayNightMode
地图日夜间模式切换策略. 包括自动切换、始终白天、始终黑夜3种模式. 默认为日夜状态自动切换.
Definition: TNKBaseNavView.h:44
QMapView * mapView
地图实例
Definition: TNKBaseNavView.h:39
BOOL followEnabled
是否会自动从非锁车标状态进入锁车标状态; 默认为YES
Definition: TNKBaseNavView.h:66
TNKTurnArrowConfig * turnArrowConfig
设置是转向箭头的样式,不可为nil
Definition: TNKBaseNavView.h:151
BOOL exitOverviewEnabled
是否会自动从全览状态进入导航态,默认为NO
Definition: TNKBaseNavView.h:76
TNKNavUIMode nonOverviewNaviUIMode
非全览的导航视角模式. 导航模式包括3D车头朝上、2D地图朝.
Definition: TNKBaseNavView.h:86
instancetype UNAVAILABLE_ATTRIBUTE()
NSTimeInterval followDelay
设置从非锁车标状态返回之前锁车标状态的延迟时间,单位为秒, 默认为5秒.
Definition: TNKBaseNavView.h:71
TNKNavUIMode navUIMode
导航视角模式. 导航模式包括3D车头朝上、2D地图朝北、全览和剩余全览4种模式. 默认为3D车头朝上模式. 导航状态下使用手势操作地图时触发非锁车模式,地图不跟随自车点移动 ;在手势操作结束后一段时间切...
Definition: TNKBaseNavView.h:56
起终点样式
Definition: TNKODMarkerPresentation.h:16
导航红线配置类
Definition: TNKRedLineConfig.h:16
导航路线样式配置类
Definition: TNKRouteConfig.h:18
转向箭头样式
Definition: TNKTurnArrowConfig.h:16
自车点配置类
Definition: TNKUserLocationPresentation.h:35