• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BNRoutePlanNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.baidu.navisdk.adapter.BNRoutePlanNode的典型用法代码示例。如果您正苦于以下问题:Java BNRoutePlanNode类的具体用法?Java BNRoutePlanNode怎么用?Java BNRoutePlanNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BNRoutePlanNode类属于com.baidu.navisdk.adapter包,在下文中一共展示了BNRoutePlanNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: routePlan

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 根据导航节点和偏好计算路线
 **/
public void routePlan(ArrayList<BNRoutePlanNode> nodes, int preference) {
    switchLineCaculate = 0;
    for (int calculateMode : BASE_CALCULATE_MODES) {
        if (preference != calculateMode) {
            /* 将算路偏好放入队列中 */
            routeModes.offer(calculateMode);
        }
    }
    /* 最后放入选中算路偏好 */
    routeModes.offer(preference);
    this.nodes = nodes;
    this.preference = routeModes.poll();
    RouteModel.clearCache();
    RouteGuider.get().routePlan(nodes, this.preference, routePlanObserver);
    zoomToRouteBound(nodes.get(0), nodes.get(nodes.size() - 1));
    selectLineState = true;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:21,代码来源:BaiduNaviSuperManager.java


示例2: calculate

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
private void calculate() {
    lock.lock();
    try {
        BNRoutePlanNode sn = new BNRoutePlanNode(gcAddress.getLongitude(), gcAddress.getLatitude(), gcAddress.getAddressDetail(), "");
        BNRoutePlanNode tn = new BNRoutePlanNode(target.getLongitude(), target.getLatitude(), target.getName(), target.getAddress());

        routeInputs.clear();
        routeInputs.add(sn);
        routeInputs.add(tn);
        BNRoutePlanerProxy.getInstance().setObserver(this);
        int prefrence = BaiduNaviManager.RoutePlanPreference.ROUTE_PLAN_MOD_RECOMMEND;
        BNRoutePlanerProxy.getInstance().setCalcPrference(prefrence);
        RouteGuider.get().routePlan(routeInputs, prefrence, this);
        condition.await();
    } catch (InterruptedException e) {
        e.printStackTrace();
    } finally {
        Log.i(TAG, "end..............................");
        lock.unlock();
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:22,代码来源:NavigatorService.java


示例3: updateCompany

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 更新去公司视图
 */
@Override
public void updateCompany() {
    companyAddress = mNaviDao.getHomeOrCompanyAddress(mAppConfig.getResources().getString(R.string.company));
    goCompanyNodes.clear();
    if (companyAddress != null) {
        // 计算两点之间的距离
       /* boolean countable = DistanceUtil.getDistance(new LatLng(address.getLatitude(), address.getLongitude()),
                new LatLng(companyAddress.getLatitude(), companyAddress.getLongitude())) > 1000;*/
        BNRoutePlanNode start = new BNRoutePlanNode(address.getLongitude(), address.getLatitude(), address.getAddressDetail(), "");
        BNRoutePlanNode end = new BNRoutePlanNode(companyAddress.getLongitude(), companyAddress.getLatitude(), companyAddress.getName(), "");
        goCompanyNodes.add(start);
        goCompanyNodes.add(end);
    }

}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:19,代码来源:NaviSetPointPresenter.java


示例4: createHandler

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
private void createHandler() {
    if (hd == null) {
        hd = new Handler(getMainLooper()) {
            public void handleMessage(android.os.Message msg) {
                if (msg.what == MSG_SHOW) {
                    addCustomizedLayerItems();
                } else if (msg.what == MSG_HIDE) {
                    BNRouteGuideManager.getInstance().showCustomizedLayer(false);
                } else if (msg.what == MSG_RESET_NODE) {
                    BNRouteGuideManager.getInstance().resetEndNodeInNavi(
                            new BNRoutePlanNode(116.21142, 40.85087, "百度大厦11", null, CoordinateType.GCJ02));
                }
            };
        };
    }
}
 
开发者ID:BeckNiu,项目名称:MyCar,代码行数:17,代码来源:BNDemoGuideActivity.java


示例5: onJumpToNavigator

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
@Override
public void onJumpToNavigator() {
	/*
	 * 设置途径点以及resetEndNode会回调该接口
	 */
 
	for (Activity ac : activityList) {
	   
		if (ac.getClass().getName().endsWith("BNDemoGuideActivity")) {
		 
			return;
		}
	}
	Intent intent = new Intent(RoadNAVActivity.this, BNDemoGuideActivity.class);
	Bundle bundle = new Bundle();
	bundle.putSerializable(ROUTE_PLAN_NODE, (BNRoutePlanNode) mBNRoutePlanNode);
	intent.putExtras(bundle);
	startActivity(intent);
	
}
 
开发者ID:BeckNiu,项目名称:MyCar,代码行数:21,代码来源:RoadNAVActivity.java


示例6: createHandler

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
private void createHandler() {
    if (hd == null) {
        hd = new Handler(getMainLooper()) {
            public void handleMessage(android.os.Message msg) {
                if (msg.what == MSG_SHOW) {
                    addCustomizedLayerItems();
                } else if (msg.what == MSG_HIDE) {
                    BNRouteGuideManager.getInstance().showCustomizedLayer(false);
                } else if (msg.what == MSG_RESET_NODE) {
                    BNRouteGuideManager.getInstance().resetEndNodeInNavi(
                            new BNRoutePlanNode(116.21142, 40.85087, "百度大厦11", null, BNRoutePlanNode.CoordinateType.GCJ02));
                }
            }
        };
    }
}
 
开发者ID:CrazyRunning,项目名称:MyStudyHelper,代码行数:17,代码来源:BNGuideActivity.java


示例7: initSearch

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 初始化搜索
 */
private void initSearch() {
    fromAddress = etFrom.getText().toString().trim();
    endAddress = etEnd.getText().toString().trim();
    if (!TextUtils.isEmpty(fromAddress) && !TextUtils.isEmpty(endAddress)) {
        DialogUtil.showLoading(MapActivity.this);
        if (fromAddress.equals("我的位置")) {
            isFrom = false;
            sNode = new BNRoutePlanNode(Const.LONGITUDE_OF_MY_LOCATION, Const.LATITUDE_OF_MY_LOCATION, "我的位置", null, BNRoutePlanNode.CoordinateType.BD09LL);
            new Thread(getEndLatitude).start();
        } else {
            isFrom = true;
            new Thread(getFromLatitude).start();
        }
    } else {
        DialogUtil.showToast(MapActivity.this, "请输入出发地和目的地", Toast.LENGTH_SHORT);
    }
}
 
开发者ID:CrazyRunning,项目名称:MyStudyHelper,代码行数:21,代码来源:MapActivity.java


示例8: launchNavigatorViaPoints

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
private static void launchNavigatorViaPoints(final Activity activity, LatLng startLL, LatLng endLL) {
    //这里给出一个起终点示例,实际应用中可以通过POI检索、外部POI来源等方式获取起终点坐标

    final BNRoutePlanNode sNode = new BNRoutePlanNode(startLL.longitude, startLL.latitude, null, "从这里开始", BNRoutePlanNode.CoordinateType.BD09LL);
    final BNRoutePlanNode eNode = new BNRoutePlanNode(endLL.longitude, endLL.latitude, null, "到这里结束", BNRoutePlanNode.CoordinateType.BD09LL);
    if (sNode != null && eNode != null) {
        List<BNRoutePlanNode> points = new ArrayList<BNRoutePlanNode>();
        points.add(sNode);
        points.add(eNode);
        //距离太近toast提示(100米内)
        double dis = DistanceUtil.getDistance(new LatLng(sNode.getLatitude(), sNode.getLongitude()), new LatLng(eNode.getLatitude(), eNode.getLongitude()));
        if (dis <= 100) {
            Toast.makeText(activity, "起点、途经点、终点距离太近", Toast.LENGTH_SHORT).show();
            return;
        }
        BaiduNaviManager.getInstance().launchNavigator(activity, points, 1, true, new BaiduNaviManager.RoutePlanListener() {
            public void onJumpToNavigator() {
        /*
         * 设置途径点以及resetEndNode会回调该接口
*/
                for (Activity ac : activityList) {
                    if (ac.getClass().getName().endsWith("BNDemoGuideActivity")) {
                        return;
                    }
                }
                Intent intent = new Intent(activity, BDInnerNaviActivity.class);
                Bundle bundle = new Bundle();
                bundle.putSerializable(ROUTE_PLAN_NODE, (BNRoutePlanNode) sNode);
                intent.putExtras(bundle);
                activity.startActivity(intent);
            }

            public void onRoutePlanFailed() {
                // TODO Auto-generated method stub
                Toast.makeText(activity, "算路失败", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:NavUtil.java


示例9: routePlanSingle

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public void routePlanSingle(ArrayList<BNRoutePlanNode> nodes, int preference) {
    switchLineCaculate = BNavigatorProxy.getInstance().isNaviBegin() ? 2 : 1;
    routeModes.clear();
    this.nodes = nodes;
    this.preference = preference;
    RouteModel.clearCache();
    RouteGuider.get().routePlan(nodes, this.preference, routePlanObserver);
    //zoomToRouteBound(nodes.get(0), nodes.get(nodes.size()-1));
    selectLineState = true;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:11,代码来源:BaiduNaviSuperManager.java


示例10: zoomToRouteBound

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public void zoomToRouteBound(BNRoutePlanNode start, BNRoutePlanNode end) {
    LatLng ws = new LatLng(start.getLatitude(), start.getLongitude());
    LatLng we = new LatLng(start.getLatitude(), end.getLongitude());
    int hd = (int) DistanceUtil.getDistance(ws, we);

    LatLng hs = new LatLng(start.getLatitude(), start.getLongitude());
    LatLng he = new LatLng(end.getLatitude(), start.getLongitude());
    int vd = (int) DistanceUtil.getDistance(hs, he);
    //Log.e(TAG,"hd="+hd+",vd="+vd);
    int level = getScales(hd, vd, Math.min(start.getLatitude(), end.getLatitude()));
    MapStatusProxy ms = BNMapControllerProxy.getInstance().getMapStatus();
    //Log.e(TAG,"level="+level);
    ms._Level = level;
    double cLatitude = Math.min(start.getLatitude(), end.getLatitude()) + Math.abs((start.getLatitude() - end.getLatitude()) / 2);
    double cLogitude = Math.min(start.getLongitude(), end.getLongitude()) + Math.abs((start.getLongitude() - end.getLongitude()) / 2);
    //Log.e(TAG,"lat="+cLatitude+",lng="+cLogitude);
    Bundle b1 = ZeroZeroProxy.bala2((int) (cLogitude * 1e5), (int) (cLatitude * 1e5));
    if (b1 != null) {
        ms._CenterPtX = b1.getInt("MCx");
        ms._CenterPtY = b1.getInt("MCy");
    }
    /*if (!BNavigatorProxy.getInstance().isNaviBegin()) {
        _Yoffest = 205;
        _Xoffest = 45;
    } else {
        _Yoffest = 60;
        _Xoffest = 30;
    }
    ms._Yoffset = ScreenUtil.getInstance().dip2px(_Yoffest);
    ms._Xoffset = 0 - ScreenUtil.getInstance().dip2px(_Xoffest);*/
    if (!BNavigatorProxy.getInstance().isNaviBegin())
        ms._Yoffset = ScreenUtil.getInstance().dip2px(100);

    BNMapControllerProxy.getInstance().setMapStatus(ms, BNMapControllerProxy.AnimationType.eAnimationLevel);
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:36,代码来源:BaiduNaviSuperManager.java


示例11: addPassPoint

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public void addPassPoint(BNRoutePlanNode node) {
    if (routeInputs.size() > 1) {
        for (int i = 0; i < routeInputs.size(); i++) {
            if (routeInputs.get(i).getName().indexOf(node.getName()) != -1) {
                return;
            }
        }
        routeInputs.add(routeInputs.size() - 1, node);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:11,代码来源:NavigatorService.java


示例12: getPassPointsHasCoordinate

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public List<BNRoutePlanNode> getPassPointsHasCoordinate() {
    if (routeInputs.size() > 2) {
        List<BNRoutePlanNode> list = new ArrayList<BNRoutePlanNode>();
        for (int i = 1; i < routeInputs.size() - 1; ++i) {
            if (routeInputs.get(i).getLatitude() > 0) {
                list.add(routeInputs.get(i));
            }
        }
        return list;
    }
    return null;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:13,代码来源:NavigatorService.java


示例13: getRouteInputsHasCoordinate

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public List<BNRoutePlanNode> getRouteInputsHasCoordinate() {
    if (routeInputs.size() > 2) {
        List<BNRoutePlanNode> list = new ArrayList<BNRoutePlanNode>();
        for (int i = 0; i < routeInputs.size(); ++i) {
            if (routeInputs.get(i).getLatitude() > 0) {
                list.add(routeInputs.get(i));
            }
        }
        return list;
    }
    return null;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:13,代码来源:NavigatorService.java


示例14: routeInputsContains

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
public boolean routeInputsContains(String passPoint) {
    for (BNRoutePlanNode n : routeInputs) {
        if (n.getName().indexOf(passPoint) != -1) {
            return true;
        }
    }
    return false;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:9,代码来源:NavigatorService.java


示例15: getAddress

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 填充地址对象
 **/
private com.lingju.context.entity.Address getAddress(BNRoutePlanNode routePlanNode) {
    com.lingju.context.entity.Address address = new com.lingju.context.entity.Address();
    address.setName(routePlanNode.getName());
    address.setDetailedaddress(routePlanNode.getDescription());
    address.setLongitude(routePlanNode.getLongitude());
    address.setLatitude(routePlanNode.getLatitude());
    return address;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:12,代码来源:NaviSetLinePresenter.java


示例16: showNaviGuide

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
@Override
public void showNaviGuide() {
    BaiduNaviSuperManager.setSelectLineState(true);
    mixCalculateType = calculateType = 0;
    calculateRoad = NaviSetLineActivity.CALCULATED_SHOW;
    calculatePreference = BNRoutePlanerProxy.getInstance().getCalcPreference();
    calculateScheme = RouteModel.getCalculateScheme();
    if (NavigatorService.get().getRouteInputs().size() > 1) {
        routeInputs = (ArrayList<BNRoutePlanNode>) NavigatorService.get().getRouteInputs();
        naviManager.zoomToRouteBound(routeInputs.get(0), routeInputs.get(routeInputs.size() - 1));
    }
    setRouteMode();
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:NaviSetLinePresenter.java


示例17: resetRouteInputForRecalculateInNavigate

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
private boolean resetRouteInputForRecalculateInNavigate() {
    LocData locData = BNSysLocationManagerProxy.getInstance().getCurLocation();
    if (locData != null) {
        RouteModel routeModel = RouteModel.getCurrent();
        int curDistance = (int) (RGAssistGuideModelProxy.getInstance().getCarProgress() * routeModel.getDistance() + 50);
        BNRoutePlanNode target = routeInputs.get(routeInputs.size() - 1);
        routeInputs.remove(0);
        RouteModel.RouteNode n;
        String curName = RGHighwayModelProxy.getInstance().getCurRoadName();
        if (routeInputs.size() > 1) {
            String temp = passPoint;
            for (int i = 0; i < routeModel.getNodes().size(); i++) {
                if (TextUtils.isEmpty(temp))
                    temp = routeInputs.get(0).getName();
                if ((n = routeModel.getNodes().get(i)).getDistanceFromStart() >= curDistance) {
                    break;
                } else {
                    if ((n.getTurnString().indexOf("途经点") != -1 || n.getTurnString().indexOf(temp) != -1) && routeInputs.size() > 0) {
                        routeInputs.remove(0);
                        if (routeInputs.size() == 1)
                            break;
                        else
                            temp = routeInputs.get(0).getName();
                    }
                }
            }
        }
        if (routeInputs.size() == 0) {//为防止意外把所有得点都remove
            routeInputs.add(target);
        }
        BNRoutePlanNode start = new BNRoutePlanNode(locData.longitude, locData.latitude, curName, null);
        routeInputs.add(0, start);
        return true;
    }
    return false;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:37,代码来源:NaviSetLinePresenter.java


示例18: initMapView

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 初始化导航路线图
 **/
@Override
public void initMapView() {
    if (mMapView == null)
        mMapView = naviManager.createNMapView();
    /* BNMapController 地图管理控制类,控制地图的缩放、移动、旋转等操作。初始化导航地图状态 */
    BNMapControllerProxy mapController = BNMapControllerProxy.getInstance();
    /* 注意是经度在前,纬度在后 */
    mapController.initMapStatus(new GeoPointProxy((int) (address.getLongitude() * 1e5), (int) (address.getLatitude() * 1e5)));
    /* 将地图控件添加到布局中 */
    mSetLineView.setMapView(mMapView, true);
    /* 设置展示图层模式(cruise:巡航) */
    mapController.setLayerMode(MapParams.LayerMode.MAP_LAYER_MODE_CRUISE);
    mapController.setMapStatus(mapController.getMapStatus(), BNMapControllerProxy.AnimationType.eAnimationLevel);

    if (calculateRoad == NaviSetLineActivity.UN_CALCULATE) {
        startCalculateRoad();
    } else if (calculateType == 0 && calculateRoad >= NaviSetLineActivity.CALCULATED) {
        if (calculateRoad == NaviSetLineActivity.CALCULATED_SHOW) {
            BaiduNaviSuperManager.setSelectLineState(true);
            calculatePreference = BNRoutePlanerProxy.getInstance().getCalcPreference();
            calculateScheme = BNRoutePlanerProxy.getInstance().getCalculateScheme();
            if (routeInputs == null && NavigatorService.get().getRouteInputs().size() > 1) {
                routeInputs = (ArrayList<BNRoutePlanNode>) NavigatorService.get().getRouteInputs();
            }
            setRouteMode();
        } else
            startNavi(mContext, true);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:33,代码来源:NaviSetLinePresenter.java


示例19: updateHome

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
/**
 * 更新回家视图
 */
@Override
public void updateHome() {
    homeAddress = mNaviDao.getHomeOrCompanyAddress(mAppConfig.getResources().getString(R.string.home));
    goHomeNodes.clear();
    if (homeAddress != null) {
        BNRoutePlanNode start = new BNRoutePlanNode(address.getLongitude(), address.getLatitude(), address.getAddressDetail(), "");
        BNRoutePlanNode end = new BNRoutePlanNode(homeAddress.getLongitude(), homeAddress.getLatitude(), homeAddress.getName(), "");
        goHomeNodes.add(start);
        goHomeNodes.add(end);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:15,代码来源:NaviSetPointPresenter.java


示例20: onCreate

import com.baidu.navisdk.adapter.BNRoutePlanNode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	createHandler();
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
	}
	View view = null;
	if (useCommonInterface) {
		//使用通用接口
		mBaiduNaviCommonModule = NaviModuleFactory.getNaviModuleManager().getNaviCommonModule(
				NaviModuleImpl.BNaviCommonModuleConstants.ROUTE_GUIDE_MODULE, this,
				BNaviBaseCallbackModel.BNaviBaseCallbackConstants.CALLBACK_ROUTEGUIDE_TYPE, mOnNavigationListener);
		if(mBaiduNaviCommonModule != null) {
			mBaiduNaviCommonModule.onCreate();
			view = mBaiduNaviCommonModule.getView();
		}

	} else {
		//使用传统接口
		view = BNRouteGuideManager.getInstance().onCreate(this,mOnNavigationListener);
	}


	if (view != null) {
		setContentView(view);
	}

	Intent intent = getIntent();
	if (intent != null) {
		Bundle bundle = intent.getExtras();
		if (bundle != null) {
			mBNRoutePlanNode = (BNRoutePlanNode) bundle.getSerializable(NavUtil.ROUTE_PLAN_NODE);
		}
	}
	//显示自定义图标
	if (hd != null) {
		hd.sendEmptyMessageAtTime(MSG_SHOW, 5000);
	}
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:41,代码来源:BDInnerNaviActivity.java



注:本文中的com.baidu.navisdk.adapter.BNRoutePlanNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConfigReader类代码示例发布时间:2022-05-22
下一篇:
Java DataTable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap