本文整理汇总了Java中com.baidu.mapapi.search.core.PoiInfo类的典型用法代码示例。如果您正苦于以下问题:Java PoiInfo类的具体用法?Java PoiInfo怎么用?Java PoiInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PoiInfo类属于com.baidu.mapapi.search.core包,在下文中一共展示了PoiInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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();
}