本文整理汇总了Java中com.baidu.mapapi.search.route.WalkingRoutePlanOption类的典型用法代码示例。如果您正苦于以下问题:Java WalkingRoutePlanOption类的具体用法?Java WalkingRoutePlanOption怎么用?Java WalkingRoutePlanOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WalkingRoutePlanOption类属于com.baidu.mapapi.search.route包,在下文中一共展示了WalkingRoutePlanOption类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: searchRoute0
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的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: drawPlanRoute
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的package包/类
private void drawPlanRoute(PlanNode endNodeStr) {
if (routeOverlay != null)
routeOverlay.removeFromMap();
if (endNodeStr != null) {
Log.d("gaolei", "changeLatitude-----startNode--------" + startNodeStr.getLocation().latitude);
Log.d("gaolei", "changeLongitude-----startNode--------" + startNodeStr.getLocation().longitude);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(startNodeStr).to(endNodeStr));
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:MainActivity.java
示例3: drawPlanRoute
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的package包/类
private void drawPlanRoute(PlanNode endNodeStr) {
if (routeOverlay != null)
routeOverlay.removeFromMap();
if (endNodeStr != null) {
Log.d(TAG, "changeLatitude-----startNode--------" + startNodeStr.getLocation().latitude);
Log.d(TAG, "changeLongitude-----startNode--------" + startNodeStr.getLocation().longitude);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(startNodeStr).to(endNodeStr));
}
}
开发者ID:yiwent,项目名称:Mobike,代码行数:11,代码来源:MainActivity.java
示例4: searchButtonProcess
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的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
示例5: SearchButtonProcess
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的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
示例6: run
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的package包/类
@Override
public void run() {
DialogUtil.dissMissLoading();
//设定中心点坐标
double lat0 = 0;
double lng0 = 0;
if (isFrom) {
//自定义出发地坐标
lat0 = Double.valueOf(map.get("lat0"));
lng0 = Double.valueOf(map.get("lng0"));
}
//目的地坐标
double lat = Double.valueOf(map.get("lat"));
double lng = Double.valueOf(map.get("lng"));
myLatLng = new LatLng(lat, lng);
MarkerOptions markerOptions = new MarkerOptions().position(myLatLng).icon(bd);
mBaiduMap.addOverlay(markerOptions);
mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
//改变地图状态
mBaiduMap.setMapStatus(mMapStatusUpdate);
LatLng stlatLng;
if (isFrom) {
stlatLng = new LatLng(lat0, lng0);
} else {
stlatLng = new LatLng(Const.LATITUDE_OF_MY_LOCATION, Const.LONGITUDE_OF_MY_LOCATION);
}
LatLng enlatLng = new LatLng(lat, lng);
PlanNode stNode = PlanNode.withLocation(stlatLng);
PlanNode enNode = PlanNode.withLocation(enlatLng);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
开发者ID:CrazyRunning,项目名称:MyStudyHelper,代码行数:35,代码来源:MapActivity.java
示例7: SearchButtonProcess
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的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
示例8: onOptionsItemSelected
import com.baidu.mapapi.search.route.WalkingRoutePlanOption; //导入依赖的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
注:本文中的com.baidu.mapapi.search.route.WalkingRoutePlanOption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论