本文整理汇总了Java中com.baidu.mapapi.search.poi.PoiCitySearchOption类的典型用法代码示例。如果您正苦于以下问题:Java PoiCitySearchOption类的具体用法?Java PoiCitySearchOption怎么用?Java PoiCitySearchOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PoiCitySearchOption类属于com.baidu.mapapi.search.poi包,在下文中一共展示了PoiCitySearchOption类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: goSearch
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 城市内检索目标
**/
private void goSearch(BaiduAddress ba) {
if (mContext.getCurrentFocus() != null) {
((InputMethodManager) mContext.getSystemService(mContext.INPUT_METHOD_SERVICE))
.hideSoftInputFromWindow(mContext.getCurrentFocus()
.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
mContext.findViewById(R.id.ast_suggest_list_box).setVisibility(View.GONE);
/* 城市内检索 */
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).pageCapacity(10).pageNum(poiPageCode).keyword(ba == null ? keyword : ba.getName()));
if (ba == null) {
ba = new BaiduAddress();
ba.setName(keyword);
ba.setAddress("");
ba.setCity(address.getCity());
}
ba.setSearchKeyWord(keyword);
ba.setCreated(new Timestamp(System.currentTimeMillis()));
mNaviDao.insertAddress(ba);
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:25,代码来源:TrafficShowPresenter.java
示例2: goSearch
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 根据输入地址搜索
**/
private void goSearch(BaiduAddress bd) {
if (bd == null) {
bd = new BaiduAddress();
bd.setName(keyword);
bd.setAddress("");
bd.setCity(mAddress.getCity());
}
bd.setSearchKeyWord(keyword);
bd.setFavoritedTime(null);
/* 保存搜索记录 */
mNaviDao.insertAddress(bd);
updateHistory = true;
if (!TextUtils.isEmpty(bd.getCity())) {
mAppConfig.selectedCityInSearchPoi = bd.getCity();
}
if (getCurrentFocus() != null) {
//隐藏输入键盘
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
.hideSoftInputFromWindow(getCurrentFocus()
.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
//隐藏搜索建议列表
findViewById(R.id.amosf_suggest_list_box).setVisibility(View.GONE);
/* 城市内检索 */
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
mAddress.getCity() : mAppConfig.selectedCityInSearchPoi).pageCapacity(PER_PAGE).pageNum(poiPageCode).keyword(bd == null ? keyword : bd.getName()));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:33,代码来源:SetFavoriteMapActivity.java
示例3: onDownPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 下拉刷新
**/
@Override
public void onDownPullRefresh() {
if (poiPageCode == 0) {
mAmosfPoiListBox.setRefreshing(false);
// Toast.makeText(this, "当前已是第一页了", Toast.LENGTH_LONG).show();
Snackbar.make(mAmosfPoiList, "当前已是第一页了", Snackbar.LENGTH_SHORT).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
mAddress.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(--poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:SetFavoriteMapActivity.java
示例4: onUpPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 上拉刷新
**/
@Override
public void onUpPullRefresh() {
if (poiPageCode == (totalPageNum - 1)) {
mAmosfPoiListBox.setRefreshing(false);
//Toast.makeText(this, "没有符合要求的地点了", Toast.LENGTH_LONG).show();
Snackbar.make(mAmosfPoiList, "没有符合要求的地点了", Snackbar.LENGTH_SHORT).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
mAddress.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(++poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:15,代码来源:SetFavoriteMapActivity.java
示例5: onDownPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 下拉刷新
**/
@Override
public void onDownPullRefresh() {
if (poiPageCode == 0) {
mAncpPoiListBox.setRefreshing(false);
//Toast.makeText(this, "当前已是第一页了", Toast.LENGTH_LONG).show();
Snackbar.make(mAncpPoiDetailBox,"当前已是第一页了", Snackbar.LENGTH_SHORT).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(--poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:NaviConfirmPointActivity.java
示例6: onUpPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 上拉刷新
**/
@Override
public void onUpPullRefresh() {
if (poiPageCode == (totalPageNum - 1)) {
mAncpPoiListBox.setRefreshing(false);
//Toast.makeText(this, "没有符合要求的地点了", Toast.LENGTH_LONG).show();
Snackbar.make(mAncpPoiDetailBox,"没有符合要求的地点了", Snackbar.LENGTH_SHORT).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(++poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:15,代码来源:NaviConfirmPointActivity.java
示例7: onDownPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
@Override
public void onDownPullRefresh() {
Log.i(TAG, "onDownPullRefresh");
if (poiPageCode == 0) {
mTrafficShowView.setRefreshLayout(false);
mTrafficShowView.showSnackBar("当前已是第一页了");
//Toast.makeText(mContext, "当前已是第一页了", Toast.LENGTH_LONG).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(--poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:12,代码来源:TrafficShowPresenter.java
示例8: onUpPullRefresh
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
@Override
public void onUpPullRefresh() {
Log.i(TAG, "onUpPullRefresh");
if (poiPageCode == (totalPageNum - 1)) {
mTrafficShowView.setRefreshLayout(false);
mTrafficShowView.showSnackBar("没有符合要求的地点了");
// Toast.makeText(mContext, "没有符合要求的地点了", Toast.LENGTH_LONG).show();
} else
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(++poiPageCode));
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:13,代码来源:TrafficShowPresenter.java
示例9: searchRouteProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* �������
*
* @param v
*/
public void searchRouteProcess(View v) {
busLineIDList.clear();
busLineIndex = 0;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
// ����poi�������ӵõ�����poi���ҵ�������·���͵�poi����ʹ�ø�poi��uid���й�����������
mSearch.searchInCity((new PoiCitySearchOption()).city("����").keyword(
etRouteOnline.getText().toString()));
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:15,代码来源:BusLineOnlineActivity.java
示例10: searchButtonProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 发起检索
*
* @param v
*/
public void searchButtonProcess(View v) {
busLineIDList.clear();
busLineIndex = 0;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
EditText editCity = (EditText) findViewById(R.id.city);
EditText editSearchKey = (EditText) findViewById(R.id.searchkey);
// 发起poi检索,从得到所有poi中找到公交线路类型的poi,再使用该poi的uid进行公交详情搜索
mSearch.searchInCity((new PoiCitySearchOption()).city(
editCity.getText().toString()).keyword(
editSearchKey.getText().toString()));
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:18,代码来源:BusLineSearchActivity.java
示例11: searchButtonProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 发起检索,点击“开始”按钮
*
* @param v
*/
public void searchButtonProcess(View v) {
// Log.i("TAG", "开始按钮");
busLineIDList.clear();
busLineIndex = 0;
mBtnPre.setVisibility(View.GONE);
mBtnNext.setVisibility(View.GONE);
// 发起poi检索,从得到所有poi中找到公交线路类型的poi,再使用该poi的uid进行公交详情搜索
// 这里使用了链式编程,对于有相同返回值的方法通过“.”串联起来。简化代码;
mSearch.searchInCity((new PoiCitySearchOption()).city(selectedCity)
.keyword(searchkey.getText().toString().trim()));
}
开发者ID:chenyufeng1991,项目名称:BaiduMap-TrafficAssistant,代码行数:17,代码来源:BusActivity.java
示例12: searchButtonProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
public void searchButtonProcess(View v) {
EditText editSearchKey = (EditText) findViewById(R.id.mainPoi_searchKey);
mPoiSearch.searchInCity((new PoiCitySearchOption())
.city(mCity)
.keyword(editSearchKey.getText().toString())
.pageNum(load_Index));
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:8,代码来源:MainActivity.java
示例13: searchButtonProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
public void searchButtonProcess(View v) {
busLineIDList.clear();
busLineIndex = 0;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
EditText editCity = (EditText) findViewById(R.id.city);
EditText editSearchKey = (EditText) findViewById(R.id.searchkey);
// 发起poi检索,从得到所有poi中找到公交线路类型的poi,再使用该poi的uid进行公交详情搜索
mSearch.searchInCity((new PoiCitySearchOption()).city(
editCity.getText().toString()).keyword(
editSearchKey.getText().toString()));
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:13,代码来源:BusLineSearch.java
示例14: searchButtonProcess1
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 影响搜索按钮点击事件
*
* @param v
*/
public void searchButtonProcess1(View v) {
EditText editCity = (EditText) findViewById(R.id.city);
EditText editSearchKey = (EditText) findViewById(R.id.searchkey);
mPoiSearch.searchInCity((new PoiCitySearchOption())
.city(editCity.getText().toString())
.keyword(editSearchKey.getText().toString())
.pageNum(load_Index));
}
开发者ID:amazingokc,项目名称:BMap,代码行数:14,代码来源:LocationDemo.java
示例15: searchButtonProcess1
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 影响搜索按钮点击事件
*
* @param v
*/
public void searchButtonProcess1(View v) {
EditText editCity = (EditText) findViewById(R.id.city);
EditText editSearchKey = (EditText) findViewById(R.id.searchkey);
bar.setVisibility(View.VISIBLE);
mPoiSearch.searchInCity((new PoiCitySearchOption())
.city(editCity.getText().toString())
.keyword(editSearchKey.getText().toString())
.pageNum(load_Index));
}
开发者ID:amazingokc,项目名称:BMap,代码行数:15,代码来源:MainActivity.java
示例16: searchButtonProcess
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 发起检索
*
* @param v
*/
public void searchButtonProcess(View v) {
busLineIDList.clear();
busLineIndex = 0;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
EditText editCity = (EditText) findViewById(R.id.city);
EditText editSearchKey = (EditText) findViewById(R.id.searchkey);
bar.setVisibility(View.VISIBLE);
// 发起poi检索,从得到所有poi中找到公交线路类型的poi,再使用该poi的uid进行公交详情搜索
mSearch.searchInCity((new PoiCitySearchOption()).city(
editCity.getText().toString()).keyword(
editSearchKey.getText().toString()));
}
开发者ID:amazingokc,项目名称:BMap,代码行数:20,代码来源:BusLineSearchDemo.java
示例17: showPoiResult
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 搜索
*/
private void showPoiResult(String city, String key) {
mProgressDialog = new ProgressDialog(SearchActivity.this);
mProgressDialog.setMessage("请稍等....");
mProgressDialog.show();
mPoiSearch.searchInCity((new PoiCitySearchOption()).city(city)
.keyword(key).pageNum(0));
}
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:12,代码来源:SearchActivity.java
示例18: afterTextChanged
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 输入框监听---输入完毕
*
* @param s
*/
@Override
public void afterTextChanged(Editable s) {
if (s.length() == 0 || "".equals(s.toString())) {
searchPois.setVisibility(View.GONE);
} else {
//创建PoiSearch实例
PoiSearch poiSearch = PoiSearch.newInstance();
//城市内检索
PoiCitySearchOption poiCitySearchOption = new PoiCitySearchOption();
//关键字
poiCitySearchOption.keyword(s.toString());
//城市
poiCitySearchOption.city(city);
//设置每页容量,默认为每页10条
poiCitySearchOption.pageCapacity(10);
//分页编号
poiCitySearchOption.pageNum(1);
poiSearch.searchInCity(poiCitySearchOption);
//设置poi检索监听者
poiSearch.setOnGetPoiSearchResultListener(new OnGetPoiSearchResultListener() {
//poi 查询结果回调
@Override
public void onGetPoiResult(PoiResult poiResult) {
List<PoiInfo> poiInfos = poiResult.getAllPoi();
PoiSearchAdapter poiSearchAdapter = new PoiSearchAdapter(MainActivity.this, poiInfos, locationLatLng);
searchPois.setVisibility(View.VISIBLE);
searchPois.setAdapter(poiSearchAdapter);
}
//poi 详情查询结果回调
@Override
public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) {
}
});
}
}
开发者ID:scp504677840,项目名称:MoveMapLocation,代码行数:42,代码来源:MainActivity.java
示例19: initData
import com.baidu.mapapi.search.poi.PoiCitySearchOption; //导入依赖的package包/类
/**
* 初始化相关数据
**/
private void initData() {
/* 获取poi搜索对象 */
pSearch = PoiSearch.newInstance();
pSearch.setOnGetPoiSearchResultListener(this);
address = mAppConfig.address;
/* 将坐标系转换成百度坐标系 */
// g2c_address = address.clone().setBD09LL();
Intent intent = getIntent();
if (intent != null) {
keyword = intent.getStringExtra("data");
ArrayList<BaiduAddress> addresses = intent.getParcelableArrayListExtra("addresses");
addMode = intent.getBooleanExtra("add", false);
if (!TextUtils.isEmpty(keyword)) {
firstPoiSearch = true;
/* 在城市内检索,检索结果在poi检索结果回调中显示 */
pSearch.searchInCity(new PoiCitySearchOption().city(mAppConfig.selectedCityInSearchPoi == null ?
address.getCity() : mAppConfig.selectedCityInSearchPoi).keyword(keyword).pageCapacity(PER_PAGE).pageNum(poiPageCode));
} else if (addresses != null) {
voiceMode = true;
/* 设置poi搜索点图层 */
poiOverlay = new ConfirmCustomPoiOverlay(baiduMap);
baiduMap.setOnMarkerClickListener(poiOverlay);
if (poiOverlay instanceof ConfirmCustomPoiOverlay) {
((ConfirmCustomPoiOverlay) poiOverlay).setOverlayOptions(addresses);
}
//添加PoiOverlay到地图中
poiOverlay.addToMap();
aList.clear();
aList.addAll(addresses);
setListReverse();
mListAdapter.notifyDataSetChanged();
mPagerAdapter.notifyDataSetChanged();
firstPoiSearch = false;
mAncpPoiBox.setVisibility(View.VISIBLE);
mAncpPoiListBox.setAllowDrag(false);
setPoiPosition();
}
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:44,代码来源:NaviConfirmPointActivity.java
注:本文中的com.baidu.mapapi.search.poi.PoiCitySearchOption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论