本文整理汇总了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);
}
示例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;
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例10: RouteTask
import com.amap.api.services.route.RouteSearch; //导入依赖的package包/类
private RouteTask(Context context) {
mRouteSearch = new RouteSearch(context);
mRouteSearch.setRouteSearchListener(this);
}