本文整理匯總了Java中com.baidu.mapapi.search.route.TransitRoutePlanOption類的典型用法代碼示例。如果您正苦於以下問題:Java TransitRoutePlanOption類的具體用法?Java TransitRoutePlanOption怎麽用?Java TransitRoutePlanOption使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。
TransitRoutePlanOption類屬於com.baidu.mapapi.search.route包,在下文中一共展示了TransitRoutePlanOption類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: searchRoute0
點讚 4
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,
示例2: searchButtonProcess
點讚 2
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,
示例3: SearchButtonProcess
點讚 2
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,
示例4: SearchButtonProcess
點讚 2
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,
示例5: onOptionsItemSelected
點讚 2
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,
示例6: searchButtonProcess
點讚 2
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,
注:本文中的com.baidu.mapapi.search.route.TransitRoutePlanOption類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。