本文整理汇总了Java中com.baidu.mapapi.search.core.PoiInfo类的典型用法代码示例。如果您正苦于以下问题:Java PoiInfo类的具体用法?Java PoiInfo怎么用?Java PoiInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PoiInfo类属于com.baidu.mapapi.search.core包,在下文中一共展示了PoiInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setListReverse
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 将所有BaiduAddress对象信息填充到poi搜索信息集合中
**/
public void setListReverse() {
int al = aList.size();
list.clear();
int l = Math.min(al, 10);
for (int i = 0; i < l; i++) {
PoiInfo poiInfo = new PoiInfo();
poiInfo.name = aList.get(i).getName();
poiInfo.uid = aList.get(i).getUid();
poiInfo.address = aList.get(i).getAddress();
poiInfo.city = aList.get(i).getCity();
poiInfo.phoneNum = aList.get(i).getPhoneNum();
poiInfo.postCode = aList.get(i).getPostCode();
poiInfo.type = PoiInfo.POITYPE.POINT;
poiInfo.location = new LatLng(aList.get(i).getLatitude(), aList.get(i).getLongitude());
list.add(poiInfo);
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:21,代码来源:SetFavoriteMapActivity.java
示例2: onBindViewHolder
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onBindViewHolder(NaviPointHolder holder, int position) {
PoiInfo poiInfo = list.get(position);
holder.mTpiNameText.setText((position + 1) + "." + poiInfo.name);
holder.mTpiAddressText.setText(poiInfo.address);
if (addMode) {
holder.mTpiItemConfirmText.setText("添加");
holder.mTpiDistanceText.setVisibility(View.GONE);
} else {
holder.mTpiItemConfirmText.setText("出发");
holder.mTpiDistanceText.setVisibility(View.VISIBLE);
double distance = DistanceUtil.getDistance(new LatLng(address.getLatitude(), address.getLongitude()),
poiInfo.location) / 1000;
holder.mTpiDistanceText.setText(String.format("%.1f", distance) + "km");
}
holder.mTpiTargetConfirmBt.setTag(position);
holder.itemView.setTag(position);
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:19,代码来源:NaviConfirmPointActivity.java
示例3: setListReverse
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
public void setListReverse() {
int al = aList.size();
poiInfoList.clear();
int l = Math.min(al, 10);
for (int i = 0; i < l; i++) {
PoiInfo poiInfo = new PoiInfo();
poiInfo.name = aList.get(i).getName();
poiInfo.uid = aList.get(i).getUid();
poiInfo.address = aList.get(i).getAddress();
poiInfo.city = aList.get(i).getCity();
poiInfo.phoneNum = aList.get(i).getPhoneNum();
poiInfo.postCode = aList.get(i).getPostCode();
poiInfo.type = PoiInfo.POITYPE.POINT;
poiInfo.location = new LatLng(aList.get(i).getLatitude(), aList.get(i).getLongitude());
poiInfoList.add(poiInfo);
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:18,代码来源:TrafficShowPresenter.java
示例4: onGetPoiResult
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onGetPoiResult(PoiResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineOnlineActivity.this, "��Ǹ��δ�ҵ����",
Toast.LENGTH_LONG).show();
return;
}
// ��������poi���ҵ�����Ϊ������·��poi
busLineIDList.clear();
for (PoiInfo poi : result.getAllPoi()) {
if (poi.type == PoiInfo.POITYPE.BUS_LINE
|| poi.type == PoiInfo.POITYPE.SUBWAY_LINE) {
busLineIDList.add(poi.uid);
}
}
SearchOppositeBusline(null);
route = null;
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:20,代码来源:BusLineOnlineActivity.java
示例5: onGetPoiResult
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onGetPoiResult(PoiResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearchActivity.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
return;
}
// 遍历所有poi,找到类型为公交线路的poi
busLineIDList.clear();
for (PoiInfo poi : result.getAllPoi()) {
if (poi.type == PoiInfo.POITYPE.BUS_LINE
|| poi.type == PoiInfo.POITYPE.SUBWAY_LINE) {
busLineIDList.add(poi.uid);
}
}
SearchNextBusline(null);
route = null;
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:20,代码来源:BusLineSearchActivity.java
示例6: onGetPoiResult
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onGetPoiResult(PoiResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearch.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
return;
}
// 遍历所有poi,找到类型为公交线路的poi
busLineIDList.clear();
for (PoiInfo poi : result.getAllPoi()) {
if (poi.type == PoiInfo.POITYPE.BUS_LINE
|| poi.type == PoiInfo.POITYPE.SUBWAY_LINE) {
busLineIDList.add(poi.uid);
}
}
SearchNextBusline(null);
route = null;
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:20,代码来源:BusLineSearch.java
示例7: onGetPoiResult
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onGetPoiResult(PoiResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearchDemo.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
bar.setVisibility(View.GONE); //线路没有显示出来了,关闭Progress
return;
}
// 遍历所有poi,找到类型为公交线路的poi
busLineIDList.clear();
for (PoiInfo poi : result.getAllPoi()) {
if (poi.type == PoiInfo.POITYPE.BUS_LINE
|| poi.type == PoiInfo.POITYPE.SUBWAY_LINE) {
busLineIDList.add(poi.uid);
}
}
SearchNextBusline(null);
route = null;
}
开发者ID:amazingokc,项目名称:BMap,代码行数:21,代码来源:BusLineSearchDemo.java
示例8: onGetPoiResult
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onGetPoiResult(PoiResult result) {
if (result == null
|| result.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) {
Toast.makeText(BusLineActivity.this, getResources().getString(R.string.notFoundResult), Toast.LENGTH_LONG).show();
return;
}
if (result.error == SearchResult.ERRORNO.NO_ERROR) {
for (PoiInfo poi : result.getAllPoi()) {
if (poi.type == PoiInfo.POITYPE.BUS_STATION) {
Intent stationBusLineIntent = new Intent(BusLineActivity.this, StationBusLineActivity.class);
String[] busLineNameList = (poi.address).split(";");
stationBusLineIntent.putExtra("busLineNameList", busLineNameList);
stationBusLineIntent.putExtra("stationName", poi.name + "-公交车站");
startActivity(stationBusLineIntent);
return;
}
}
}
}
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:23,代码来源:BusLineActivity.java
示例9: getView
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.poisearch_item, null);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
PoiInfo poiInfo = poiInfos.get(position);
holder.poisearch_name.setText(poiInfo.name);
holder.poisearch_address.setText(poiInfo.address);
holder.poisearch_distance.setText((int)DistanceUtil.getDistance(locationLatLng, poiInfo.location)+"米");
return convertView;
}
开发者ID:scp504677840,项目名称:MoveMapLocation,代码行数:17,代码来源:PoiSearchAdapter.java
示例10: getView
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.locationpois_item, null);
linearLayout = (LinearLayout) convertView.findViewById(R.id.locationpois_linearlayout);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (position == 0 && linearLayout.getChildCount() < 2) {
ImageView imageView = new ImageView(context);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(32, 32);
imageView.setLayoutParams(params);
imageView.setBackgroundColor(Color.TRANSPARENT);
imageView.setImageResource(R.mipmap.baidumap_ico_poi_on);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
linearLayout.addView(imageView, 0, params);
holder.locationpoi_name.setTextColor(Color.parseColor("#FF5722"));
}
PoiInfo poiInfo = pois.get(position);
holder.locationpoi_name.setText(poiInfo.name);
holder.locationpoi_address.setText(poiInfo.address);
return convertView;
}
开发者ID:scp504677840,项目名称:MoveMapLocation,代码行数:27,代码来源:PoiAdapter.java
示例11: setBaiduAddressFromPoiInfo
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 将poi搜索信息填充到BaiduAddress对象中
**/
private void setBaiduAddressFromPoiInfo(BaiduAddress ad, PoiInfo poiInfo) {
ad.setAddress(poiInfo.address);
ad.setUid(poiInfo.uid);
ad.setName(poiInfo.name);
ad.setCity(poiInfo.city);
ad.setCreated(new Date(System.currentTimeMillis()));
ad.setHasCaterDetails(poiInfo.hasCaterDetails ? 1 : 0);
ad.setIsPano(poiInfo.isPano ? 1 : 0);
ad.setLatitude(poiInfo.location.latitude);
ad.setLongitude(poiInfo.location.longitude);
ad.setPhoneNum(poiInfo.phoneNum);
ad.setPostCode(poiInfo.postCode);
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:17,代码来源:SetFavoriteMapActivity.java
示例12: setAlist
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 重置搜索地址集合
*
* @param list
**/
private void setAlist(List<PoiInfo> list) {
aList.clear();
for (PoiInfo poiInfo : list) {
if (poiInfo.location == null)
continue;
BaiduAddress address = new BaiduAddress();
setBaiduAddressFromPoiInfo(address, poiInfo);
aList.add(address);
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:16,代码来源:SetFavoriteMapActivity.java
示例13: onBindViewHolder
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onBindViewHolder(FavorPointHolder holder, int position) {
PoiInfo poiInfo = list.get(position);
BaiduAddress baiduAddress = aList.get(position);
holder.mTpiNameText.setText(new StringBuilder().append(position + 1).append(".").append(poiInfo.name).toString());
holder.mTpiAddressText.setText(poiInfo.address);
holder.mTpiTargetConfirmBt.setTag(position);
holder.itemView.setTag(position);
switch (mode) {
case SET_FAVORITE:
holder.mTpiItemConfirmText.setText(baiduAddress.getFavoritedTime() == null ? "收藏" : "删除");
// holder.mTpiItemConfirmText.setVisibility(View.GONE);
// holder.mTpiFavoriteStarBt.setVisibility(View.VISIBLE);
break;
case SET_HOME:
holder.mTpiItemConfirmText.setText(baiduAddress.getRemark() == null || !baiduAddress.getRemark().equals("家") ? "设为家" : "清除");
break;
case SET_COMPANY:
holder.mTpiItemConfirmText.setText(baiduAddress.getRemark() == null || !baiduAddress.getRemark().equals("单位") ? "设为单位" : "清除");
break;
case SET_START:
holder.mTpiItemConfirmText.setText(baiduAddress.getRemark() == null || !baiduAddress.getRemark().equals("出发地") ? "设为出发地" : "清除");
// holder.mTpiItemConfirmText.setVisibility(View.GONE);
// holder.mTpiFavoriteStarBt.setVisibility(View.VISIBLE);
break;
case SET_END:
holder.mTpiItemConfirmText.setText(baiduAddress.getRemark() == null || !baiduAddress.getRemark().equals("目的地") ? "设为目的地" : "清除");
// holder.mTpiItemConfirmText.setVisibility(View.GONE);
// holder.mTpiFavoriteStarBt.setVisibility(View.VISIBLE);
break;
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:34,代码来源:SetFavoriteMapActivity.java
示例14: setAlist
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 重置搜索地址集合
*
* @param list
**/
private void setAlist(List<PoiInfo> list) {
aList.clear();
for (PoiInfo poiInfo : list) {
BaiduAddress address = new BaiduAddress();
setBaiduAddressFromPoiInfo(address, poiInfo);
aList.add(address);
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:NaviConfirmPointActivity.java
示例15: intoNaviSetLine
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 进入设置导航路线页面
**/
private void intoNaviSetLine(int index, PoiInfo info) {
if (voiceMode) {
if (SynthesizerBase.isInited()) {
SynthesizerBase.get().stopSpeakingAbsolte();
}
Intent is = new Intent(NaviConfirmPointActivity.this, AssistantService.class);
is.putExtra(AssistantService.CMD, AssistantService.ServiceCmd.STOP_RECOGNIZE);
startService(is);
is.putExtra(AssistantService.CMD, AssistantService.ServiceCmd.PUSH_ROUTE_CACULATE);
is.putExtra("text", "第" + (index + 1) + "个");
is.putExtra(AssistantService.CALLBACK, true);
startService(is);
} else {
if(NetUtil.getInstance(NaviConfirmPointActivity.this).getCurrentNetType().equals(NetUtil.NetType.NETWORK_TYPE_NONE)){
final CommonDialog commonDialog = new CommonDialog(NaviConfirmPointActivity.this,"网络错误","网络状态不佳,请检查网络设置","确定");
commonDialog.setOnConfirmListener(new CommonDialog.OnConfirmListener() {
@Override
public void onConfirm() {
commonDialog.cancel();
}
}).show();
return;
}
Intent intent = new Intent(NaviConfirmPointActivity.this, NaviSetLineActivity.class);
intent.putExtra("latitude", info.location.latitude);
intent.putExtra("longitude", info.location.longitude);
intent.putExtra("address", info.name);
startActivity(intent);
goInto();
}
finish();
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:36,代码来源:NaviConfirmPointActivity.java
示例16: onBindViewHolder
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onBindViewHolder(NaviPointHolder holder, int position) {
PoiInfo poiInfo = poiInfoList.get(position);
holder.mTpiNameText.setText((position + 1) + "." + poiInfo.name);
holder.mTpiAddressText.setText(poiInfo.address);
holder.mTpiItemConfirmText.setText("出发");
holder.mTpiDistanceText.setVisibility(View.VISIBLE);
double distance = DistanceUtil.getDistance(new LatLng(address.getLatitude(), address.getLongitude()),
poiInfo.location) / 1000;
holder.mTpiDistanceText.setText(String.format("%.1f", distance) + "km");
holder.mTpiTargetConfirmBt.setTag(position);
holder.itemView.setTag(position);
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:16,代码来源:TrafficShowPresenter.java
示例17: intoNaviSetLine
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
/**
* 进入设置导航路线页面
**/
private void intoNaviSetLine(int index, PoiInfo info) {
if (voiceMode) {
if (SynthesizerBase.isInited()) {
SynthesizerBase.get().stopSpeakingAbsolte();
}
Intent is = new Intent(mContext, AssistantService.class);
is.putExtra(AssistantService.CMD, AssistantService.ServiceCmd.STOP_RECOGNIZE);
mContext.startService(is);
is.putExtra(AssistantService.CMD, AssistantService.ServiceCmd.PUSH_ROUTE_CACULATE);
is.putExtra("text", "第" + (index + 1) + "个");
is.putExtra(AssistantService.CALLBACK, true);
mContext.startService(is);
} else {
//没有网络进行提示
if (NetUtil.getInstance(mContext).getCurrentNetType().equals(NetUtil.NetType.NETWORK_TYPE_NONE)) {
final CommonDialog commonDialog = new CommonDialog(mContext, "网络错误", "网络状态不佳,请检查网络设置", "确定");
commonDialog.setOnConfirmListener(new CommonDialog.OnConfirmListener() {
@Override
public void onConfirm() {
commonDialog.cancel();
}
}).show();
return;
}
Intent intent = new Intent(mContext, NaviSetLineActivity.class);
intent.putExtra("latitude", info.location.latitude);
intent.putExtra("longitude", info.location.longitude);
intent.putExtra("address", info.name);
mContext.startActivity(intent);
}
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:36,代码来源:TrafficShowPresenter.java
示例18: setBaiduAddressFromPoiInfo
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
private void setBaiduAddressFromPoiInfo(BaiduAddress ad, PoiInfo poiInfo) {
ad.setAddress(poiInfo.address);
ad.setUid(poiInfo.uid);
ad.setName(poiInfo.name);
ad.setCity(poiInfo.city);
ad.setCreated(new Timestamp(System.currentTimeMillis()));
ad.setHasCaterDetails(poiInfo.hasCaterDetails ? 1 : 0);
ad.setIsPano(poiInfo.isPano ? 1 : 0);
ad.setLatitude(poiInfo.location.latitude);
ad.setLongitude(poiInfo.location.longitude);
ad.setPhoneNum(poiInfo.phoneNum);
ad.setPostCode(poiInfo.postCode);
}
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:14,代码来源:TrafficShowPresenter.java
示例19: onQueryFinished
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public void onQueryFinished(RouteData routeData, int queryType, ReverseGeoCodeResult result) {
if (result.error == ERRORNO.NO_ERROR) {
String address = "ERROR";
if (result.getPoiList() != null && result.getPoiList().size() > 0) {
PoiInfo info = result.getPoiList().get(0);
address = info.address + "\n" + info.name;
}
switch (queryType) {
case AddressQuerier.QUERY_BEGIN_ADDRESS:
routeData.setBeginAddress(address);
break;
case AddressQuerier.QUERY_END_ADDRESS:
routeData.setEndAddress(address);
break;
}
} else {
switch (queryType) {
case AddressQuerier.QUERY_BEGIN_ADDRESS:
routeData.setBeginAddress(DeviceHelper.isNetworkAvaliable(this) ? "ERROR" : "NET_ERR");
break;
case AddressQuerier.QUERY_END_ADDRESS:
routeData.setEndAddress(DeviceHelper.isNetworkAvaliable(this) ? "ERROR" : "NET_ERR");
break;
}
}
routeData.saveToFile(true, false);
mAdapter.notifyDataSetChanged();
}
开发者ID:iWay7,项目名称:BikeHelper,代码行数:30,代码来源:RouteListActivity.java
示例20: onPoiClick
import com.baidu.mapapi.search.core.PoiInfo; //导入依赖的package包/类
@Override
public boolean onPoiClick(int index) {
super.onPoiClick(index);
PoiInfo poi = getPoiResult().getAllPoi().get(index);
// if (poi.hasCaterDetails) {
mPoiSearch.searchPoiDetail((new PoiDetailSearchOption())
.poiUid(poi.uid));
// }
return true;
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:12,代码来源:AroundSearchActivity.java
注:本文中的com.baidu.mapapi.search.core.PoiInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论