Map Doc  1.0
iOS-引擎SDK-开放平台
MBRoutePlan类 参考

#import <MBRoutePlan.h>

类 MBRoutePlan 继承关系图:
MBObject

构造函数

(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
 
- 构造函数 继承自 MBObject
(instancetype) - initWithHandle:
 
(void *) - getHandle
 

类方法

(void) + routePlanCopyTo:from:
 

属性

MBPoiFavoritestartFav
 
MBPoiFavoriteendFav
 
NSArray * destinationPoiObjects
 
BOOL useTmc
 

详细描述

路线的查询方案

函数文档

◆ addDestination:()

- (void) addDestination: (MBPoiFavorite *)  fav

在指定索引的位置插入POI点,插入之后,此索引位置以后的点都向后移动

参数
favpoi点

◆ addWayPoint:()

- (BOOL) addWayPoint: (MBPoiFavorite *)  fav

添加途经点,顺序添加,途经点最多只能有三个,失败的原因一般是没有设置起点终点,或者途经点个数超过了3个

参数
fav途经点Poi对象
返回
如果设置成功返回YES,否则返回NO

◆ clearDestinations()

- (void) clearDestinations

清楚所有目标点

◆ errCodeToString:()

- (NSString *) errCodeToString: (MBRoutePlanErrorCode err

将错误枚举转换为字符串

参数
err枚举代码 ErrorCode
返回
错误字符串

◆ getAvoidRoadType()

- (MBAvoidRoadType) getAvoidRoadType

获取路线规划避让

返回
当前的路线规划避让

◆ getDestination:()

- (MBPoiFavorite *) getDestination: (NSInteger)  index

获取 MBRoutePlan 中的点(起点、途经点或终点)信息.

参数
index索引值
返回
指定索引值的目POI点信息

◆ getOrigionOrientation()

- (short) getOrigionOrientation

返回路线规划起点方向角

返回
当前起点的方向角

◆ getPointCount()

- (NSInteger) getPointCount

获取目的点数组中的点个数

返回
当前路线规划方式中目的点个数

◆ getRoutePlan()

- (void*) getRoutePlan

获取路线方案

返回
plan 路线计划

◆ getRule()

- (MBRouteRule) getRule

获取当前路线规划规则

返回
当前的路线规划规则

◆ getWayPointNumber()

- (NSInteger) getWayPointNumber

获取途经点数量

返回
途经点数量

◆ insertDestination:favorite:()

- (void) insertDestination: (NSInteger)  index
favorite: (MBPoiFavorite *)  fav 

在指定索引的位置插入POI点,插入之后,此索引位置以后的点都向后移动

参数
index索引值
fav需要指定的POI信息

◆ load:()

- (void) load: (NSString *)  fileName

载入上次保存的路径

参数
fileName文件路径

◆ removeAllWayPoint()

- (void) removeAllWayPoint

移除所有途经点

◆ removeDestination:()

- (void) removeDestination: (NSInteger)  index

删除指定索引值的目标POI点

参数
index索引值

◆ removeWayPoint:()

- (BOOL) removeWayPoint: (NSInteger)  index

移除指定索引的途经点对象

参数
index途经点索引
返回
如果移除成功,返回true,否则返回false 一般来说,移除失败主要是索引值不对

◆ routePlanCopyTo:from:()

+ (void) routePlanCopyTo: (MBRoutePlan *)  newPlan
from: (MBRoutePlan *)  oldPlan 

路线拷贝

参数
newPlan新路线
oldPlan老路线

◆ save:()

- (BOOL) save: (NSString *)  fileName

保存路线规划文件

参数
fileName文件路径
返回
保存成功返回YES,否则返回NO

◆ setAvoidRoadType:()

- (void) setAvoidRoadType: (MBAvoidRoadType)  avoidRoadType

设置路线规划避让,可以同时多个

参数
avoidRoadType具体的路线规划避让

◆ setDestination:favorite:()

- (void) setDestination: (NSInteger)  index
favorite: (MBPoiFavorite *)  fav 

设置 MBRoutePlan 中的点(起点、途经点或终点)信息.

参数
index索引值
fav需要指定的POI信息
   使用此方法将覆盖原本索引值所在的POI点信息

◆ setEndPoint:()

- (BOOL) setEndPoint: (MBPoiFavorite *)  fav

设置终点

参数
fav终点Poi对象
返回
是否正确设置终点,YES为正确设置终点,可以导航,NO为设置错误,一般起点未设置的问题

◆ setOrigionOrientation:()

- (void) setOrigionOrientation: (short)  ori

设置路线规划起点方向角

参数
ori起点方向角

◆ setRule:()

- (void) setRule: (MBRouteRule)  rule

设置算路规则,每次设置一个

参数
rule具体的路线规划规则

◆ setStartPoint:()

- (void) setStartPoint: (MBPoiFavorite *)  fav

设置起点

参数
fav起点的Poi对象

◆ setWayPoint:favorite:()

- (BOOL) setWayPoint: (NSInteger)  index
favorite: (MBPoiFavorite *)  fav 

设置途经点,使用此方法将替换原本设置过的途经点,途经点最多只能有三个。 一般失败的原因是没有设置终点或起点,或者设置的索引超过了2

参数
index途经点所在下标,取值范围:[0, 2]
fav途经点Poi对象
返回
如果设置成功则返回YES,否则返回NO

◆ swapDestinations:index2:()

- (void) swapDestinations: (NSInteger)  index1
index2: (NSInteger)  index2 

交换指定位置的两个点

参数
index1第一个点所对应索引
index2第二个点所对应索引
自从
4.9.x

◆ updateStartPointByGps()

- (void) updateStartPointByGps

通过GPS更新起点坐标

◆ verify:()

- (MBRoutePlanErrorCode) verify: (NSInteger)  index

验证当前坐标点是否有效

参数
index点的下标
返回
错误枚举 MBRoutePlanErrorCode

属性说明

◆ destinationPoiObjects

- (NSArray*) destinationPoiObjects
readnonatomiccopy

目的点集合

◆ endFav

- (MBPoiFavorite*) endFav
readnonatomicstrong

◆ startFav

- (MBPoiFavorite*) startFav
readnonatomicstrong

◆ useTmc

- (BOOL) useTmc
readwritenonatomicassign

是否使用tmc


该类的文档由以下文件生成: