BaiduMap_IOSSDK_v7.2.0_Docs 7.2.0

BMKBackgroundNavigationView.h
浏览该文件的文档.
1 //
2 // BMKBackgroundNavigationCALayer.h
3 // MapComponent
4 //
5 // Created by zhaoxiangru on 2024/2/29.
6 // Copyright © 2024 Baidu. All rights reserved.
7 //
8
9 #import <QuartzCore/QuartzCore.h>
10 #import <CoreLocation/CLLocation.h>
11 #import "BMKMapStatus.h"
12
13 @class BMKMapView;
14
15 NS_ASSUME_NONNULL_BEGIN
16 //已走过路线展示方式
17 typedef NS_ENUM (NSInteger, BMKRoutePassedDisplayMode) {
18 BMKRoutePassedDisplayModeNone, // 无效果
19 BMKRoutePassedDisplayModeErased, //擦除
20 BMKRoutePassedDisplayModeGrayed //置灰
21 };
22
23 //已走过途径点展示方式
24 typedef NS_ENUM (NSInteger, BMKViaPointPassedDisplayMode) {
25 BMKViaPointPassedDisplayModeNone, // 无效果
26 BMKViaPointPassedDisplayModeErased, //擦除
27 BMKViaPointPassedDisplayModeGrayed //置灰
28 };
29
31 @interface BMKNaviLocationInfo : NSObject
33 @property (nonatomic, assign) CLLocationCoordinate2D location;
35 @property (nonatomic, assign) CLLocationCoordinate2D locationBindRoute;
37 @property (nonatomic, assign) CGFloat direction;
39 @property (nonatomic, assign) CGFloat directionRoute;
41 @property (nonatomic, assign) NSInteger shapeIndex;
43 @property (nonatomic, assign) BOOL isFaraway;
44 @end
45
47 @interface BMKNaviRouteInfo : NSObject
49 @property (nonatomic, strong, nullable) NSArray<NSValue *> *routeInfo;
51 @property (nonatomic, strong, nullable) NSArray<NSNumber *> *trafficInfo;
52 @end
53
55 @interface BMKNaviRouteSegmentInfo : NSObject
57 @property (nonatomic, copy) NSString *routeName;
59 @property (nonatomic, copy) NSArray<NSValue *> *coordinates;
60 @end
61
63 @interface BMKNaviViaPointInfo : NSObject
65 @property (nonatomic, assign) CLLocationCoordinate2D location;
67 @property (nonatomic, assign) BOOL isPassed;
68 @end
69
70 @protocol BMKBackgroundNavigationViewDataSource <NSObject>
71 // 用于获取导航中用户位置实时信息
72 - (BMKNaviLocationInfo *)realTimeInfo;
73
74 @end
75 @interface BMKBackgroundNavigationView : UIView
77 @property (nonatomic, weak) id<BMKBackgroundNavigationViewDataSource> dataSource;
79 @property (nonatomic, weak) BMKMapView *mapview;
80
82 @property (nonatomic, assign) BOOL needDrawGuideLine;
84 @property (nonatomic, strong) UIColor *guideLineColor;
86 @property (nonatomic, assign) CGFloat guideLineWidth;
87
89 @property (nonatomic, assign) BOOL needDrawRedLine;
91 @property (nonatomic, strong) UIColor *redLineColor;
93 @property (nonatomic, assign) CGFloat redLineWidth;
94
96 @property (nonatomic, assign) BOOL needDrawStartPoint;
98 @property (nonatomic, assign) CLLocationCoordinate2D startPoint;
100 @property (nonatomic, strong, nullable) UIImage *startPointIcon;
102 @property (nonatomic, assign) CGSize startPointIconSize;
104 @property (nonatomic, assign) CGPoint startPointIconOffset;
105
107 @property (nonatomic, assign) BOOL needDrawViaPoint;
109 @property (nonatomic, assign) BMKViaPointPassedDisplayMode viaPointPassedDisplayMode;
111 @property (nonatomic, copy, nullable) NSArray<BMKNaviViaPointInfo *> *viaPoints;
113 @property (nonatomic, strong, nullable) UIImage *viaPointIcon;
115 @property (nonatomic, strong, nullable) UIImage *viaPassedPointIcon;
117 @property (nonatomic, assign) CGSize viaPointIconSize;
119 @property (nonatomic, assign) CGPoint viaPointIconOffset;
120
122 @property (nonatomic, assign) BOOL needDrawEndPoint;
124 @property (nonatomic, assign) CLLocationCoordinate2D endPoint;
126 @property (nonatomic, strong, nullable) UIImage *endPointIcon;
128 @property (nonatomic, assign) CGSize endPointIconSize;
130 @property (nonatomic, assign) CGPoint endPointIconOffset;
131
133 @property (nonatomic, strong, nullable) UIImage *navigationIcon;
135 @property (nonatomic, assign) CGSize navigationIconSize;
137 @property (nonatomic, assign) BOOL needFllowPhoneHeading;
138
140 @property (nonatomic, assign) BOOL needDrawCompass;
142 @property (nonatomic, strong, nullable) UIImage *compassIcon;
144 @property (nonatomic, assign) CGSize compassIconSize;
145
147 @property (nonatomic, strong) UIColor *routeColor;
149 @property (nonatomic, assign) CGFloat lineWidth;
151 @property (nonatomic, assign) BMKRoutePassedDisplayMode routePassedDisplayMode;
153 @property (nonatomic, strong) UIColor *routePassedColor;
155 @property (nonatomic, strong) NSArray<UIColor *> *trafficColor;
156
158 @property (nonatomic, assign) BOOL needDrawRouteName;
160 @property (nonatomic, assign) CGFloat routeNameRepeatSpacing;
162 @property (nonatomic, strong) UIFont *routeNameFont;
164 @property (nonatomic, strong) UIColor *routeNameTextColor;
166 @property (nonatomic, strong) UIColor *routeNameStrokeColor;
168 @property (nonatomic, assign) CGFloat routeNameStrokeWidth;
169
171 - (void)updateRouteInfo:(BMKNaviRouteInfo *)routeInfo;
173 - (void)updateRouteSegmentsInfo:(NSArray<BMKNaviRouteSegmentInfo *> *)routeSegmentsInfo;
175 - (void)updateNaviLocationInfo:(BMKNaviLocationInfo *)locationInfo;
176
178 - (void)renderWithMapStatus:(BMKMapStatus *)mapstatus enable3D:(BOOL)enable3D fitScale:(CGFloat)fitScale mapScreenExtOffset:(CGPoint)mapScreenExtOffset;
179 @end
180
181 NS_ASSUME_NONNULL_END
BMKNaviLocationInfo::directionRoute
CGFloat directionRoute
当前位置路线方向
Definition: BMKBackgroundNavigationView.h:39
BMKMapStatus
此类表示地图状态信息
Definition: BMKMapStatus.h:16
BMKMapView
地图View类，使用此View可以显示地图窗口，并且对地图进行相关的操作
Definition: BMKMapView.h:132
BMKMapStatus.h
BMKNaviRouteInfo
路线信息
Definition: BMKBackgroundNavigationView.h:48
BMKNaviLocationInfo::location
CLLocationCoordinate2D location
当前位置经纬度
Definition: BMKBackgroundNavigationView.h:33
BMKNaviLocationInfo
导航（小车）当前位置信息
Definition: BMKBackgroundNavigationView.h:32
BMKNaviLocationInfo::shapeIndex
NSInteger shapeIndex
当前位置的路线形状点索引，对应BMKNaviRouteInfo的routeInfo数组
Definition: BMKBackgroundNavigationView.h:41
BMKNaviLocationInfo::direction
CGFloat direction
当前位置方向
Definition: BMKBackgroundNavigationView.h:37
BMKNaviLocationInfo::isFaraway
BOOL isFaraway
当前是否偏航（远离路线）
Definition: BMKBackgroundNavigationView.h:43
BMKNaviViaPointInfo
途径点信息
Definition: BMKBackgroundNavigationView.h:64
BMKNaviRouteSegmentInfo
路线分段信息
Definition: BMKBackgroundNavigationView.h:56
BMKNaviLocationInfo::locationBindRoute
CLLocationCoordinate2D locationBindRoute
当前绑路后位置经纬度
Definition: BMKBackgroundNavigationView.h:35