• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RoutePlanSearch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.baidu.mapapi.search.route.RoutePlanSearch的典型用法代码示例。如果您正苦于以下问题:Java RoutePlanSearch类的具体用法?Java RoutePlanSearch怎么用?Java RoutePlanSearch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RoutePlanSearch类属于com.baidu.mapapi.search.route包,在下文中一共展示了RoutePlanSearch类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routeplan);
    CharSequence titleLable = "路线规划功能";
    setTitle(titleLable);
    // 初始化地图
    mMapView = (MapView) findViewById(R.id.map);
    mBaidumap = mMapView.getMap();
    mBtnPre = (Button) findViewById(R.id.pre);
    mBtnNext = (Button) findViewById(R.id.next);
    mBtnPre.setVisibility(View.INVISIBLE);
    mBtnNext.setVisibility(View.INVISIBLE);
    // 地图点击事件处理
    mBaidumap.setOnMapClickListener(this);
    // 初始化搜索模块,注册事件监听
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:19,代码来源:RoutePlanDemo.java


示例2: initView

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
private void initView() {
	iv_back = (ImageView) findViewById(R.id.iv_back);
	iv_back.setVisibility(View.VISIBLE);
	iv_back.setOnClickListener(new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			finish();
		}
	});
	mMapView = (MapView) findViewById(R.id.bmapView);
	mMapView.showScaleControl(false);
	mMapView.showZoomControls(false);
	mBaiduMap = mMapView.getMap();

	mSearch = RoutePlanSearch.newInstance();
	mSearch.setOnGetRoutePlanResultListener(this);
	Intent intent = getIntent();
	LatLng locLatLng = new LatLng(intent.getDoubleExtra("locLat", 0), intent.getDoubleExtra("locLon", 0));
	LatLng desLatLng = new LatLng(intent.getDoubleExtra("lat", 0), intent.getDoubleExtra("lon", 0));
	PlanNode st = PlanNode.withLocation(locLatLng);
	PlanNode en = PlanNode.withLocation(desLatLng);
	mSearch.drivingSearch(new DrivingRoutePlanOption().from(st).to(en));
}
 
开发者ID:CodeDogandCat,项目名称:CarApp,代码行数:26,代码来源:RouteActivity.java


示例3: initMap

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
private void initMap() {
    // 地图初始化
    mMapView = (MapView) findViewById(R.id.id_bmapView);
    mBaiduMap = mMapView.getMap();
    // 开启定位图层
    mBaiduMap.setMyLocationEnabled(true);
    // 定位初始化
    mlocationClient = new LocationClient(this);
    mlocationClient.registerLocationListener(myListener);
    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(5000);//设置onReceiveLocation()获取位置的频率
    option.setIsNeedAddress(true);//如想获得具体位置就需要设置为true
    mlocationClient.setLocOption(option);
    mlocationClient.start();
    mCurrentMode = MyLocationConfiguration.LocationMode.FOLLOWING;
    mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
            mCurrentMode, true, null));
    myOrientationListener = new MyOrientationListener(this);
    //通过接口回调来实现实时方向的改变
    myOrientationListener.setOnOrientationListener(new MyOrientationListener.OnOrientationListener() {
        @Override
        public void onOrientationChanged(float x) {
            mCurrentX = x;
        }
    });
    myOrientationListener.start();
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
    initMarkerClickEvent();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:33,代码来源:MainActivity.java


示例4: initMap

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
private void initMap() {
    baiduMap = mBaiduMap.getMap();

    baiduMap.setMyLocationEnabled(true);

    mlocationClient = new LocationClient(getApplicationContext());
    mlocationClient.registerLocationListener(new MylocationListener());
    //  mBaiduMap.showScaleControl(false);// 隐藏比例尺控件
    mBaiduMap.showZoomControls(false);//隐藏缩放按钮

    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(5000);//设置onReceiveLocation()获取位置的频率
    option.setIsNeedAddress(true);//如想获得具体位置就需要设置为true
    mlocationClient.setLocOption(option);
    mlocationClient.start();
    mCurrentMode = MyLocationConfiguration.LocationMode.FOLLOWING;
    baiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
            mCurrentMode, true, null));
    myOrientationListener = new MyOrientationListener(this);
    //通过接口回调来实现实时方向的改变
    myOrientationListener.setOnOrientationListener(new MyOrientationListener.OnOrientationListener() {
        @Override
        public void onOrientationChanged(float x) {
            mCurrentX = x;
        }
    });
    myOrientationListener.start();
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
    initMarkerClickEvent();
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:34,代码来源:MainActivity.java


示例5: initRoutePlan

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
private void initRoutePlan() {
    flag = 1;
    CharSequence title = "推荐路线";
    setTitle(title);
    mBaiduMap = mMapView.getMap();
    mBaiduMap.setOnMapClickListener(this);
    mRouteSearch = RoutePlanSearch.newInstance();
    mRouteSearch.setOnGetRoutePlanResultListener(this);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:10,代码来源:GeoCodeActivity.java


示例6: initViews

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
private void initViews() {
	mBtnPre = (Button) findViewById(R.id.pre);
	mBtnNext = (Button) findViewById(R.id.next);
	mBtnPre.setVisibility(View.INVISIBLE);
	mBtnNext.setVisibility(View.INVISIBLE);
	etStart = (EditText) findViewById(R.id.et_online_transstart);
	etEnd = (EditText) findViewById(R.id.et_online_transend);

	// ��ʼ����ͼ
	mMapView = (MapView) findViewById(R.id.map);

	mBaidumap = mMapView.getMap();

	// �趨��ͼ��ʼ���ĵ����꣨�����ʵ��ѧ����У����
	LatLng xayd = new LatLng(34.162719, 108.907775);
	// �趨��ͼ״̬���趨��ʼ���ĵ�����ż�����
	MapStatus mMapStatus = new MapStatus.Builder().target(xayd).zoom(12)
			.build();
	// ����MapStatusUpdate�����Ա�������ͼ״̬��Ҫ�����ı仯
	MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory
			.newMapStatus(mMapStatus);

	// ���õ�ͼ״̬
	mBaidumap.setMapStatus(mMapStatusUpdate);

	// ��ʼ������ģ�飬ע���¼�����
	mSearch = RoutePlanSearch.newInstance();

}
 
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:30,代码来源:TransferOnlineActivity.java


示例7: onCreate

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routeplan);
    CharSequence titleLable = "路线规划功能";
    setTitle(titleLable);
    intent=getIntent();
    city=intent.getStringExtra("city");
    //初始化地图
    mMapView = (MapView) findViewById(R.id.map);
    mBaidumap = mMapView.getMap();
    mBtnPre = (Button) findViewById(R.id.pre);
    mBtnNext = (Button) findViewById(R.id.next);
    mBtnPre.setVisibility(View.INVISIBLE);
    mBtnNext.setVisibility(View.INVISIBLE);
    //地图点击事件处理
    mBaidumap.setOnMapClickListener(this);
    // 初始化搜索模块,注册事件监听
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
    back= (ImageView) findViewById(R.id.iv_back);
    back.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
}
 
开发者ID:BeckNiu,项目名称:MyCar,代码行数:28,代码来源:RoutePlanActivity.java


示例8: onCreate

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routeplan);
    initMapView();
    initLocation();
    setOnClickListener();
    // 初始化搜索模块,注册事件监听
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
    showDialog(mMapView);
}
 
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:12,代码来源:RoutePlan.java


示例9: onCreate

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routeplan);
    Log.e("sid",netWork.session_id);
    //netWork.fun(7.0,1.3);
    CharSequence titleLable = "FindYou";
    setTitle(titleLable);
    mWalk=(Button)findViewById(R.id.walk);
    // 初始化地图
    mMapView = (MapView) findViewById(R.id.map);
    mBaidumap = mMapView.getMap();
    editSt = (EditText) findViewById(R.id.start);
    editEn = (EditText) findViewById(R.id.end);
    editSt.setFocusable(false);
    editEn.setFocusable(false);
    mBtnPre = (Button) findViewById(R.id.pre);
    mBtnNext = (Button) findViewById(R.id.next);
    mBtnPre.setVisibility(View.INVISIBLE);
    mBtnNext.setVisibility(View.INVISIBLE);
    //mBtnPre.setVisibility(View.INVISIBLE);
    //mBtnNext.setVisibility(View.INVISIBLE);
    // 地图点击事件处理
    mBaidumap.setOnMapClickListener(this);
    // 初始化搜索模块,注册事件监听
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
    mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL;
    mCurrentMarker = BitmapDescriptorFactory
            .fromResource(R.drawable.icon_geo);
    mBaidumap
            .setMyLocationConfigeration(new MyLocationConfiguration(
                    mCurrentMode, true, null));

    mLocClient = new LocationClient(this);
    mLocClient.registerLocationListener(myListener);
    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(3000);
    mLocClient.setLocOption(option);
    mLocClient.start();


}
 
开发者ID:modricwang,项目名称:FindYou,代码行数:45,代码来源:RoutePlan.java


示例10: initMapView

import com.baidu.mapapi.search.route.RoutePlanSearch; //导入依赖的package包/类
/**
 * 初始化地图控件
 */
public void initMapView() {
	mMapLayout = (RelativeLayout)findViewById(R.id.routePlan_mapLayout);
	mMapLayout.setVisibility(View.GONE);

	mMapFragment = ((MapFragment) (getSupportFragmentManager()
			.findFragmentById(R.id.routePlan_mapview)));
	mMapView = mMapFragment.getMapView();
	mBaiduMap = mMapFragment.getBaiduMap();
	
	//DeoSearch
	mGeoSearch = GeoCoder.newInstance();
	mGeoSearch.setOnGetGeoCodeResultListener(this);
	
	//Map click handler
	mBaiduMap.setOnMapClickListener(this);
	
	//RoutePlanSearch
       mSearch = RoutePlanSearch.newInstance();
       mSearch.setOnGetRoutePlanResultListener(this);
       
       //location
		mBaiduMap.setMyLocationEnabled(true);
		mLocClient = new LocationClient(this);
		mLocClient.registerLocationListener(myListener);
		LocationClientOption option = new LocationClientOption();
		option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
		option.setIsNeedAddress(true);
		option.setOpenGps(true);
		option.setCoorType("bd09ll"); 
		option.setScanSpan(1000);
		option.setAddrType("all"); 
		mLocClient.setLocOption(option);
		mLocClient.start();
		
		//SuggestSearch
		mSuggestionSearch = SuggestionSearch.newInstance();
	OnGetSuggestionResultListener listener = new OnGetSuggestionResultListener() {  
	    public void onGetSuggestionResult(SuggestionResult res) {  
	        if (res == null || res.getAllSuggestions() == null) {  
	            return;  
	        }
	        suggestPosAdapter.clear();
			for (SuggestionResult.SuggestionInfo info : res.getAllSuggestions()) {
				if (info.key != null)
					suggestPosAdapter.add(info.district+info.key);
			}
			suggestPosAdapter.notifyDataSetChanged();
		
	    }  
	};
	mSuggestionSearch.setOnGetSuggestionResultListener(listener);

}
 
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:57,代码来源:RoutePlanActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CipherKeyGenerator类代码示例发布时间:2022-05-22
下一篇:
Java X509SKIResolver类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap