当前位置: 首页>>代码示例>>Java>>正文


Java PlanNode.withCityNameAndPlaceName方法代码示例

本文整理汇总了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();
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:18,代码来源:GeoCodeActivity.java

示例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));
    }
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:34,代码来源:RoutePlanDemo.java

示例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));
    }
}
 
开发者ID:BeckNiu,项目名称:MyCar,代码行数:35,代码来源:RoutePlanActivity.java

示例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();
}
 
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:29,代码来源:RoutePlan.java

示例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);
}
 
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:13,代码来源:RoutePlanActivity.java


注:本文中的com.baidu.mapapi.search.route.PlanNode.withCityNameAndPlaceName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。