new TraditionalNavi()
导航类,导航类提供路径分析和引导功能。(该类对象只能通过mapControl类下方法获取)
- Source:
Methods
(static) addWayPoint(x, y) → {Promise.<Promise.boolean>}
添加途经点
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | 途经点x坐标 |
y |
number | 途经点y坐标 |
- Source:
Returns:
- Type
- Promise.<Promise.boolean>
(static) cleanPath() → {Promise.<void>}
清除路径分析的结果
- Source:
Returns:
- Type
- Promise.<void>
(static) connectNaviData(dataPath) → {Promise.<Promise.boolean>}
链接导航路网数据
Parameters:
| Name | Type | Description |
|---|---|---|
dataPath |
数据存储路径 |
- Source:
Returns:
- Type
- Promise.<Promise.boolean>
(static) enablePanOnGuide(bPan) → {Promise.<void>}
引导过程中是否允许平移地图。
Parameters:
| Name | Type | Description |
|---|---|---|
bPan |
一个布尔值,用来指示在导航过程中是否允许平移地图,true,表示允许,false,表示不允许。 |
- Source:
Returns:
- Type
- Promise.<void>
(static) getNaviPath() → {Promise.<Promise.array>}
获取导航路径的详情
- Source:
Returns:
- 返回一个导航路径上所有路径的NaviStep对象数组,每个pathInfo对象的结构为{point:{x:--,y:--},length:--,name:--,time:--,turnType:--}
- Type
- Promise.<Promise.array>
(static) getRoute() → {Promise.<object>}
获得路径分析线路。
- Source:
Returns:
- Type
- Promise.<object>
(static) getTimeToDestination(speed) → {Promise.<number>}
获取导航剩余时间
Parameters:
| Name | Type | Description |
|---|---|---|
speed |
当前行驶速度 |
- Source:
Returns:
- Type
- Promise.<number>
(static) isGuiding() → {Promise.<boolean>}
当前是否在引导过程中。
- Source:
Returns:
- Type
- Promise.<boolean>
(static) locateMap() → {Promise.<void>}
导航中,将小车位置作为地图中心。 当允许导航中平移地图时,移动地图后,可以通过该接口使小车一直在地图中心显示。
- Source:
Returns:
- Type
- Promise.<void>
(static) routeAnalyst(mode) → {Promise.<number>}
执行路径分析。
路径分析模式的值为[0,1,2,3],其分别表示推荐模式、时间最快模式、距离最短模式、和最少收费模式。
Parameters:
| Name | Type | Description |
|---|---|---|
mode |
路径分析模式。 |
- Source:
Returns:
路径分析成功返回1,路径分析失败返回0,起点周围无道路返回-1,终点周围无道路返回-2。
- Type
- Promise.<number>
(static) setDestinationPoint(x, y, map) → {Promise.<void>}
设置路径规划的终点。
Parameters:
| Name | Type | Description |
|---|---|---|
x |
终点经度坐标(度)。 | |
y |
终点纬度坐标(度)。 | |
map |
导航所属地图对象 |
- Source:
Returns:
- Type
- Promise.<void>
(static) setGPSData(gpsData) → {Promise.<void>}
设置GPS数据
Parameters:
| Name | Type | Description |
|---|---|---|
gpsData |
object | gps数据 |
- Source:
Returns:
- Type
- Promise.<void>
(static) setSpeechParam(speech) → {Promise.<Promise.speak>}
设置导航指引信息控制,用于控制导航中是否播报引导信息
Parameters:
| Name | Type | Description |
|---|---|---|
speech |
boolean |
- Source:
Returns:
- Type
- Promise.<Promise.speak>
(static) setStartPoint(x, y, map) → {Promise.<void>}
设置路径规划的起点。
Parameters:
| Name | Type | Description |
|---|---|---|
x |
起点经度坐标(度)。 | |
y |
起点纬度坐标(度)。 | |
map |
导航所属地图对象 |
- Source:
Returns:
- Type
- Promise.<void>
(static) startGuide(status) → {Promise.<void>}
开始导航。
引导状态的值为[0,1,2],其分别表示执行真实导航、执行模拟导航、执行定位点巡航。
Parameters:
| Name | Type | Description |
|---|---|---|
status |
引导状态。 |
- Source:
Returns:
- Type
- Promise.<void>
(static) stopGuide() → {Promise.<Promise.boolean>}
停止引导。
- Source:
Returns:
- Type
- Promise.<Promise.boolean>