本文整理汇总了Java中com.baidu.mapapi.search.route.PlanNode.withCityNameAndPlaceName方法的典型用法代码示例。如果您正苦于以下问题:Java PlanNode.withCityNameAndPlaceName方法的具体用法?Java PlanNode.withCityNameAndPlaceName怎么用?Java PlanNode.withCityNameAndPlaceName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.search.route.PlanNode
的用法示例。
在下文中一共展示了PlanNode.withCityNameAndPlaceName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.baidu.mapapi.search.route.PlanNode; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_geocode);
ButterKnife.bind(this);
Intent intent = getIntent();
mEndCity = intent.getStringExtra("mEndCity");
mEndAddr = intent.getStringExtra("mEndAddr");
loca = intent.getStringExtra("myLocation");
System.out.println(loca);
stNode = PlanNode.withCityNameAndPlaceName(mStartCity, loca);
enNode = PlanNode.withCityNameAndPlaceName(mEndCity, mEndAddr);
initModeView();
initMap();
}
示例2: searchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入方法依赖的package包/类
/**
* 发起路线规划搜索示例
*
* @param v
*/
public void searchButtonProcess(View v) {
// 重置浏览节点的路线数据
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// 处理搜索按钮响应
EditText editSt = (EditText) findViewById(R.id.start);
EditText editEn = (EditText) findViewById(R.id.end);
// 设置起终点信息,对于tranist search 来说,城市名无意义
PlanNode stNode = PlanNode.withCityNameAndPlaceName("北京", editSt.getText().toString());
PlanNode enNode = PlanNode.withCityNameAndPlaceName("北京", editEn.getText().toString());
// 实际使用中请对起点终点城市进行正确的设定
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode).to(enNode));
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode).city("北京").to(enNode));
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode).to(enNode));
} else if (v.getId() == R.id.bike) {
mSearch.bikingSearch((new BikingRoutePlanOption())
.from(stNode).to(enNode));
}
}
示例3: SearchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入方法依赖的package包/类
/**
* 发起路线规划搜索示例
*
* @param v
*/
public void SearchButtonProcess(View v) {
//重置浏览节点的路线数据
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// 处理搜索按钮响应
EditText editSt = (EditText) findViewById(R.id.start);
EditText editEn = (EditText) findViewById(R.id.end);
//设置起终点信息,对于tranist search 来说,城市名无意义
PlanNode stNode = PlanNode.withCityNameAndPlaceName(city, editSt.getText().toString());
PlanNode enNode = PlanNode.withCityNameAndPlaceName(city, editEn.getText().toString());
// 实际使用中请对起点终点城市进行正确的设定
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(city)
.to(enNode));
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
}
示例4: SearchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入方法依赖的package包/类
public void SearchButtonProcess(View v) {
startCity = startCityText.getText().toString();
endCity = endCityText.getText().toString();
startPlace = startPlaceText.getText().toString();
endPlace = endPlaceText.getText().toString();
//设置起终点信息
stNode = PlanNode.withCityNameAndPlaceName(startCity, startPlace);
enNode = PlanNode.withCityNameAndPlaceName(endCity, endPlace);
TextView tv_rightTitle = (TextView) findViewById(R.id.tv_title_text);
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
tv_rightTitle.setText("开车去");
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(startCity)
.to(enNode));
tv_rightTitle.setText("坐公交");
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
tv_rightTitle.setText("走路去");
}
dialogBuilder.cancel();
}
示例5: searchRoute
import com.baidu.mapapi.search.route.PlanNode; //导入方法依赖的package包/类
/**
* 定位起点,输入终点
* @param startLocation
* @param endPosition
* @throws Exception
*/
private void searchRoute(LatLng startLocation, String endPosition) throws Exception{
Log.i(TAG+" searchRoute", "(Location, Position)");
PlanNode stNode = PlanNode.withLocation(startLocation);
PlanNode enNode = PlanNode.withCityNameAndPlaceName(OneBusApplication.CURRENT_CITY, endPosition);
searchRoute0(stNode,enNode);
}