在检测到offroutelistener时重新路由标题指令

时间:2019-02-06 07:35:28

标签: android navigation mapbox

我正在从routelistener覆盖allowreroutefrom()函数,以在检测到offroutelistener时提取我的自定义路由。我返回false,并使用自定义计算路线开始新的导航。但我想在发生重新路由时显示“重新路由”标题指令。如何在标语中给出自己的指示?

1 个答案:

答案 0 :(得分:0)

InstructionView具有showRerouteState()hideRerouteState()方法,您可以使用:

@Override
public boolean allowRerouteFrom(Point offRoutePoint) {

  // Fetch new route 

  InstructionView instructionView = findViewById(R.id.instructionView);
  instructionView.showRerouteState();

  return false;
}