更改百度地图规划路线中的同样方法就可以了,替换代码为:
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));
网友评论