本文整理汇总了Java中com.baidu.mapapi.search.route.TransitRoutePlanOption类的典型用法代码示例。如果您正苦于以下问题:Java TransitRoutePlanOption类的具体用法?Java TransitRoutePlanOption怎么用?Java TransitRoutePlanOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransitRoutePlanOption类属于com.baidu.mapapi.search.route包,在下文中一共展示了TransitRoutePlanOption类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: searchRoute0
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的package包/类
/**
* 搜索
*/
private void searchRoute0(PlanNode stNode, PlanNode enNode) throws Exception{
mBaiduMap.clear();
mRoutePlans.clear();
if (currentVehicle == R.id.routePlan_radioGroup_car) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
} else if (currentVehicle == R.id.routePlan_radioGroup_bus) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(OneBusApplication.CURRENT_CITY)
.to(enNode));
} else if (currentVehicle == R.id.routePlan_radioGroup_foot) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
}
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:23,代码来源:RoutePlanActivity.java
示例2: searchButtonProcess
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的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));
}
}
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:34,代码来源:RoutePlanDemo.java
示例3: SearchButtonProcess
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的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));
}
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:35,代码来源:RoutePlanActivity.java
示例4: SearchButtonProcess
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的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();
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:29,代码来源:RoutePlan.java
示例5: onOptionsItemSelected
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: //点击actionbar中的应用图标返回mainactivity
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);//跳转后为栈顶且清除原该activity栈之上的activity
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);//栈里有则不创建新的
startActivity(intent);
return true;
}
if (item.getItemId() == R.id.action_car) {
route = null;
mBaidumap.clear();
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
} else if (item.getItemId() == R.id.action_bus) {
route = null;
mBaidumap.clear();
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(startCity)
.to(enNode));
} else if (item.getItemId() == R.id.action_walk) {
route = null;
mBaidumap.clear();
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
return super.onOptionsItemSelected(item);
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:33,代码来源:RoutePlan.java
示例6: searchButtonProcess
import com.baidu.mapapi.search.route.TransitRoutePlanOption; //导入依赖的package包/类
/**
* ���˷�����ťѡ��
*
* @param v
*/
public void searchButtonProcess(View v) {
// ��������ڵ��·������
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// �������յ���Ϣ,���ó�����û�ã�Ĭ�ϱ���
// PlanNode stNode = PlanNode.withCityNameAndPlaceName("����", etStart
// .getText().toString());
// PlanNode enNode = PlanNode.withCityNameAndPlaceName("����", etEnd
// .getText().toString());
PlanNode stNode = PlanNode.withCityCodeAndPlaceName(233, etStart
.getText().toString().trim());
PlanNode enNode = PlanNode.withCityCodeAndPlaceName(233, etEnd
.getText().toString().trim());
// ͨ�������������յ���Ϣ
// PlanNode stNode = PlanNode.withLocation(stLatLng);
// PlanNode enNode = PlanNode.withLocation(enLatLng);
if (v.getId() == R.id.btn_search_timefirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_TIME_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_transferfirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_TRANSFER_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_walkfirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_WALK_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_nosubway) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_NO_SUBWAY)
.from(stNode).city("����").to(enNode));
}
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:46,代码来源:TransferOnlineActivity.java
注:本文中的com.baidu.mapapi.search.route.TransitRoutePlanOption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论