Map Doc
1.0
iOS-引擎SDK-开放平台
|
#import <MBRoutePlan.h>
构造函数 | |
(void) | - setOrigionOrientation: |
(short) | - getOrigionOrientation |
(void *) | - getRoutePlan |
(void) | - setRule: |
(MBRouteRule) | - getRule |
(void) | - setAvoidRoadType: |
(MBAvoidRoadType) | - getAvoidRoadType |
(NSInteger) | - getPointCount |
(MBPoiFavorite *) | - getDestination: |
(void) | - setDestination:favorite: |
(void) | - insertDestination:favorite: |
(void) | - addDestination: |
(void) | - removeDestination: |
(void) | - clearDestinations |
(void) | - swapDestinations:index2: |
(MBRoutePlanErrorCode) | - verify: |
(NSString *) | - errCodeToString: |
(void) | - updateStartPointByGps |
(BOOL) | - save: |
(void) | - load: |
(void) | - setStartPoint: |
(BOOL) | - setEndPoint: |
(BOOL) | - addWayPoint: |
(BOOL) | - setWayPoint:favorite: |
(NSInteger) | - getWayPointNumber |
(BOOL) | - removeWayPoint: |
(void) | - removeAllWayPoint |
![]() | |
(instancetype) | - initWithHandle: |
(void *) | - getHandle |
类方法 | |
(void) | + routePlanCopyTo:from: |
属性 | |
MBPoiFavorite * | startFav |
MBPoiFavorite * | endFav |
NSArray * | destinationPoiObjects |
BOOL | useTmc |
路线的查询方案
- (void) addDestination: | (MBPoiFavorite *) | fav |
在指定索引的位置插入POI点,插入之后,此索引位置以后的点都向后移动
fav | poi点 |
- (BOOL) addWayPoint: | (MBPoiFavorite *) | fav |
添加途经点,顺序添加,途经点最多只能有三个,失败的原因一般是没有设置起点终点,或者途经点个数超过了3个
fav | 途经点Poi对象 |
- (void) clearDestinations |
清楚所有目标点
- (NSString *) errCodeToString: | (MBRoutePlanErrorCode) | err |
将错误枚举转换为字符串
err | 枚举代码 ErrorCode |
- (MBAvoidRoadType) getAvoidRoadType |
获取路线规划避让
- (MBPoiFavorite *) getDestination: | (NSInteger) | index |
- (short) getOrigionOrientation |
返回路线规划起点方向角
- (NSInteger) getPointCount |
获取目的点数组中的点个数
- (void*) getRoutePlan |
获取路线方案
- (MBRouteRule) getRule |
获取当前路线规划规则
- (NSInteger) getWayPointNumber |
获取途经点数量
- (void) insertDestination: | (NSInteger) | index | |
favorite: | (MBPoiFavorite *) | fav | |
在指定索引的位置插入POI点,插入之后,此索引位置以后的点都向后移动
index | 索引值 |
fav | 需要指定的POI信息 |
- (void) load: | (NSString *) | fileName |
载入上次保存的路径
fileName | 文件路径 |
- (void) removeAllWayPoint |
移除所有途经点
- (void) removeDestination: | (NSInteger) | index |
删除指定索引值的目标POI点
index | 索引值 |
- (BOOL) removeWayPoint: | (NSInteger) | index |
移除指定索引的途经点对象
index | 途经点索引 |
+ (void) routePlanCopyTo: | (MBRoutePlan *) | newPlan | |
from: | (MBRoutePlan *) | oldPlan | |
路线拷贝
newPlan | 新路线 |
oldPlan | 老路线 |
- (BOOL) save: | (NSString *) | fileName |
保存路线规划文件
fileName | 文件路径 |
- (void) setAvoidRoadType: | (MBAvoidRoadType) | avoidRoadType |
设置路线规划避让,可以同时多个
avoidRoadType | 具体的路线规划避让 |
- (void) setDestination: | (NSInteger) | index | |
favorite: | (MBPoiFavorite *) | fav | |
设置 MBRoutePlan 中的点(起点、途经点或终点)信息.
index | 索引值 |
fav | 需要指定的POI信息 使用此方法将覆盖原本索引值所在的POI点信息 |
- (BOOL) setEndPoint: | (MBPoiFavorite *) | fav |
设置终点
fav | 终点Poi对象 |
- (void) setOrigionOrientation: | (short) | ori |
设置路线规划起点方向角
ori | 起点方向角 |
- (void) setRule: | (MBRouteRule) | rule |
设置算路规则,每次设置一个
rule | 具体的路线规划规则 |
- (void) setStartPoint: | (MBPoiFavorite *) | fav |
设置起点
fav | 起点的Poi对象 |
- (BOOL) setWayPoint: | (NSInteger) | index | |
favorite: | (MBPoiFavorite *) | fav | |
设置途经点,使用此方法将替换原本设置过的途经点,途经点最多只能有三个。 一般失败的原因是没有设置终点或起点,或者设置的索引超过了2
index | 途经点所在下标,取值范围:[0, 2] |
fav | 途经点Poi对象 |
- (void) swapDestinations: | (NSInteger) | index1 | |
index2: | (NSInteger) | index2 | |
交换指定位置的两个点
index1 | 第一个点所对应索引 |
index2 | 第二个点所对应索引 |
- (void) updateStartPointByGps |
通过GPS更新起点坐标
- (MBRoutePlanErrorCode) verify: | (NSInteger) | index |
验证当前坐标点是否有效
index | 点的下标 |
|
readnonatomiccopy |
目的点集合
|
readnonatomicstrong |
|
readnonatomicstrong |
|
readwritenonatomicassign |
是否使用tmc