百度地图 根据经纬度去规划路线

更改百度地图规划路线中的同样方法就可以了,替换代码为:
PlanNode stNode = PlanNode.withCityNameAndPlaceName("北京", editSt.getText().toString());
PlanNode enNode = PlanNode.withCityNameAndPlaceName("北京", editEn.getText().toString());  
mSearch.drivingSearch((new DrivingRoutePlanOption())
                    .from(stNode)
                    .to(enNode)); 
替换成:
 
PlanNode stNode = PlanNode.withLocation(phoneLocation);
                  PlanNode enNode = PlanNode.withLocation(curLatLng);
                  mDrivingSearch.drivingSearch((new DrivingRoutePlanOption())
                          .from(stNode)
                          .to(enNode));

你可能感兴趣的:(百度地图 根据经纬度去规划路线)