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


Java RouteSearch类代码示例

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


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

示例1: init

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
/**
 * 初始化AMap对象
 */
private void init() {
	if (aMap == null) {
		aMap = mapView.getMap();
		registerListener();
	}
	routeSearch = new RouteSearch(this);
	routeSearch.setRouteSearchListener(this);
	startTextView = (EditText) findViewById(R.id.autotextview_roadsearch_start);
	endTextView = (EditText) findViewById(R.id.autotextview_roadsearch_goals);
	busButton = (Button) findViewById(R.id.imagebtn_roadsearch_tab_transit);
	busButton.setOnClickListener(this);
	drivingButton = (Button) findViewById(R.id.imagebtn_roadsearch_tab_driving);
	drivingButton.setOnClickListener(this);
	walkButton = (Button) findViewById(R.id.imagebtn_roadsearch_tab_walk);
	walkButton.setOnClickListener(this);


	routeSearchImagebtn = (ImageButton) findViewById(R.id.imagebtn_roadsearch_search);
	routeSearchImagebtn.setOnClickListener(this);
}
 
开发者ID:Tsroad,项目名称:Road,代码行数:24,代码来源:RouteActivity.java

示例2: onClick

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.btn_bus:
		setBusMode();
		break;
	case R.id.btn_car:
		setCarMode();
		break;
	case R.id.btn_walk:
		setWalkMode();
		break;
	// 返回操作
	case R.id.btn_back_route:
		finish();
		break;
	case R.id.btn_clear_all:
		RemoveAllPreferences();
		break;
	case R.id.btn_route_search:
		RouteSearch();
		break;
	}

}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:26,代码来源:NavigationAty.java

示例3: RouteSearch

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
private void RouteSearch() {
	startstr = start_text.getText().toString().trim();
	endstr = end_text.getText().toString().trim();

	if (startPoint == null) {
		if (startstr == null || startstr.length() == 0) {
			ToastShow("未获取当前坐标,请手动输入起点");
			return;
		}
	}

	if (endstr == null || endstr.length() == 0) {
		ToastShow("请输入终点");
		return;
	}
	if (startstr.equals(endstr)) {
		ToastShow("起点与终点距离很近,您可以步行前往");
		return;
	}

	startSearchResult();
}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:23,代码来源:NavigationAty.java

示例4: getRoute

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
public void getRoute(LatLonPoint startPoint,LatLonPoint endPoint) {
    mapActivity = (MapActivity) MapActivity.getCurrentActivity();
    this.startPoint=startPoint;
    this.endPoint=endPoint;
    RouteSearch routeSearch = new RouteSearch(mapActivity.mContext);
    RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint,endPoint);
    routeSearch.setRouteSearchListener(this);
    RouteSearch.BusRouteQuery query = new RouteSearch.BusRouteQuery(fromAndTo,RouteSearch.BUS_LEASE_WALK,"0756",1);
    routeSearch.calculateBusRouteAsyn(query);

}
 
开发者ID:yimiaoxiehou,项目名称:ZhuHaiBusApplication,代码行数:12,代码来源:Route.java

示例5: initID

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
private void initID() {
    btn_walk = (Button) this.findViewById(R.id.btn_walk);
    btn_back = (Button) this.findViewById(R.id.btn_back);
    btn_usecar = (Button) this.findViewById(R.id.btn_usecar);
    mRouteSearch = new RouteSearch(ShopMapActivity.this);//初始化routeSearch 对象
    mRouteSearch.setRouteSearchListener(ShopMapActivity.this);//设置数据回调监听器
    btn_walk.setOnClickListener(this);
    btn_back.setOnClickListener(this);
    btn_usecar.setOnClickListener(this);
}
 
开发者ID:CKTim,项目名称:MyApplication,代码行数:11,代码来源:ShopMapActivity.java

示例6: busRoute

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
/**
 * 选择公交模式
 */
private void busRoute() {
	routeType = 1;// 标识为公交模式
	busMode = RouteSearch.BusDefault;
	drivingButton.setBackgroundResource(R.drawable.mode_driving_off);
	busButton.setBackgroundResource(R.drawable.mode_transit_on);
	walkButton.setBackgroundResource(R.drawable.mode_walk_off);

}
 
开发者ID:Tsroad,项目名称:Road,代码行数:12,代码来源:RouteActivity.java

示例7: walkRoute

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
/**
 * 选择步行模式
 */
private void walkRoute() {
	routeType = 3;// 标识为步行模式
	walkMode = RouteSearch.WalkMultipath;
	drivingButton.setBackgroundResource(R.drawable.mode_driving_off);
	busButton.setBackgroundResource(R.drawable.mode_transit_off);
	walkButton.setBackgroundResource(R.drawable.mode_walk_on);
}
 
开发者ID:Tsroad,项目名称:Road,代码行数:11,代码来源:RouteActivity.java

示例8: init

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
private void init() {
	mprogress = (LinearLayout) findViewById(R.id.myprogress);
	mprogress.setVisibility(View.GONE);

	btn_back = (ImageButton) findViewById(R.id.btn_back_route);
	btn_back.setOnClickListener(this);

	btn_bus = (ImageButton) findViewById(R.id.btn_bus);
	btn_bus.setOnClickListener(this);

	btn_car = (ImageButton) findViewById(R.id.btn_car);
	btn_car.setOnClickListener(this);

	btn_walk = (ImageButton) findViewById(R.id.btn_walk);
	btn_walk.setOnClickListener(this);

	start_text = (AutoCompleteTextView) findViewById(R.id.Edit_start_text);
	end_text = (AutoCompleteTextView) findViewById(R.id.Edit_end_text);

	btn_clear_all = (Button) findViewById(R.id.btn_clear_all);
	btn_clear_all.setOnClickListener(this);

	btn_route_search = (Button) findViewById(R.id.btn_route_search);
	btn_route_search.setOnClickListener(this);

	routeSearch = new RouteSearch(this);
	routeSearch.setRouteSearchListener(this);

	history = (ListView) findViewById(R.id.history_list);
	adapter = new HistroyAdapter(this);
	initListView();

	getStartPoint();
}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:35,代码来源:NavigationAty.java

示例9: search

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
public void search() {
	if (mFromPoint == null || mToPoint == null) {
		return;
	}

	FromAndTo fromAndTo = new FromAndTo(new LatLonPoint(mFromPoint.latitue,
			mFromPoint.longitude), new LatLonPoint(mToPoint.latitue,
			mToPoint.longitude));
	DriveRouteQuery driveRouteQuery = new DriveRouteQuery(fromAndTo,
			RouteSearch.DrivingDefault, null, null, "");

	mRouteSearch.calculateDriveRouteAsyn(driveRouteQuery);
}
 
开发者ID:amapapi,项目名称:Android_UsingCar_Example,代码行数:14,代码来源:RouteTask.java

示例10: RouteTask

import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
private RouteTask(Context context) {
	mRouteSearch = new RouteSearch(context);
	mRouteSearch.setRouteSearchListener(this);
}
 
开发者ID:amapapi,项目名称:Android_UsingCar_Example,代码行数:5,代码来源:RouteTask.java


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