Android新能源导航
新能源导航需开启两个权限,新能源算路权限 与 新能源动态数据权限,若需要开启,请通过产品需求提交申请
新能源信息设置
// 新能源信息 // 设置新能源默认车牌 BaiduNaviManagerFactory.getCommonSettingManager().setEnergyDefaultPlate("粤B66666"); // 设置充电偏好 BaiduNaviManagerFactory.getCommonSettingManager().setChargingPreferInfo(new BNChargingPreferInfo());
新能源算路
Bundle bundle = new Bundle(); bundle.putInt(BNaviCommonParams.RoutePlanKey.SUB_VEHICLE , IBNRoutePlanManager.SubVehicle.NEW_ENERGY); routePlanToNavi(bundle); private void routePlanToNavi(final Bundle bundle) { List<BNRoutePlanNode> list = new ArrayList<>(); list.add(BNDemoFactory.getInstance().getStartNode(this)); list.add(BNDemoFactory.getInstance().getEndNode(this)); BaiduNaviManagerFactory.getRoutePlanManager().routePlanToNavi( list, IBNRoutePlanManager.RoutePlanPreference.ROUTE_PLAN_PREFERENCE_DEFAULT, bundle, handler); }
新能源页面
Bundle params = new Bundle(); // 创建新能源导航页面view,与普通导航相比需要新增该行,标识进入新能源页 params.putInt(BNaviCommonParams.RoutePlanKey.SUB_VEHICLE , IBNRoutePlanManager.SubVehicle.NEW_ENERGY); params.putBoolean(BNaviCommonParams.ProGuideKey.IS_SUPPORT_FULL_SCREEN, fullScreen); mRouteGuideManager = BaiduNaviManagerFactory.getRouteGuideManager(); BNGuideConfig config = new BNGuideConfig.Builder() .params(params) .build(); view = mRouteGuideManager.onCreate(this, config);