本文整理汇总了Java中com.tencent.tencentmap.mapsdk.search.PoiItem类的典型用法代码示例。如果您正苦于以下问题:Java PoiItem类的具体用法?Java PoiItem怎么用?Java PoiItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PoiItem类属于com.tencent.tencentmap.mapsdk.search包,在下文中一共展示了PoiItem类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.tencent.tencentmap.mapsdk.search.PoiItem; //导入依赖的package包/类
public void run() {
try {
GeocoderSearch geocodersearcher = new GeocoderSearch(SOSOLocationActivity.this);
GeoPoint geoRegeocoder = new GeoPoint(mMapView.getMapCenter().getLatitudeE6(), mMapView.getMapCenter().getLongitudeE6());
ReGeocoderResult regeocoderResult = geocodersearcher.searchFromLocation(geoRegeocoder);
if (regeocoderResult == null || regeocoderResult.poilist == null || regeocoderResult.poilist.size() == 0)
return;
PoiItem poiItem = new PoiItem();
poiItem.name = regeocoderResult.poilist.get(0).name;
poiItem.point = mMapView.getMapCenter();
if(getIntent().hasExtra("location"))
mHandler.obtainMessage(RENDER_POI, poiItem).sendToTarget();
else
mHandler.obtainMessage(SHWO_TIPS, poiItem).sendToTarget();
} catch (Exception e) {
e.printStackTrace();
}
}
示例2: createPoiItem
import com.tencent.tencentmap.mapsdk.search.PoiItem; //导入依赖的package包/类
private PoiItem createPoiItem(TencentGeofence geofence) {
PoiItem item = new PoiItem();
item.point = Utils.of(geofence.getLatitude(), geofence.getLongitude());
item.name = geofence.getTag();
item.address = Utils.fmt(geofence.getLatitude()) + ","
+ Utils.fmt(geofence.getLongitude()) + ","
+ geofence.getRadius();
return item;
}
示例3: getFenceItems
import com.tencent.tencentmap.mapsdk.search.PoiItem; //导入依赖的package包/类
public static ArrayList<PoiItem> getFenceItems() {
return sFenceItems;
}
示例4: onTouchEvent
import com.tencent.tencentmap.mapsdk.search.PoiItem; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent arg0, MapView arg1) {
if (isLongClickMarker && (arg0.getAction() == MotionEvent.ACTION_UP)) {
isLongClickMarker = false;
// 得到拖动停止的位置
OverlayItem oi = getItem(0);
ReGeocoderResult regeocoderResult = null;
try {
arg1.getController().animateTo(oi.getPoint());
regeocoderResult = geocodersearcher.searchFromLocation(oi
.getPoint());
// String nextLine = System.getProperty("line.separator");
//
// if(regeocoderResult.addresslist!=null)
// {
// int iAddrSize=regeocoderResult.addresslist.size();
// strResult+="addresslist size="+iAddrSize+nextLine;
// if(iAddrSize>0)
// {
// ReGeocoderAddress addr=regeocoderResult.addresslist.get(0);
// strResult+="address name="+addr.name+nextLine;
// strResult+="address type="+addr.type+nextLine;
// strResult+="address dist="+addr.dist+nextLine;
// strResult+="address adcode="+addr.adcode+nextLine;
// strResult+="address point="+addr.point.toString()+nextLine;
// }
// }
// if(regeocoderResult.poilist!=null)
// {
// int iPoiSize=regeocoderResult.poilist.size();
// strResult+="poilist size="+iPoiSize+nextLine;
// if(iPoiSize>0)
// {
// PoiItem poi=regeocoderResult.poilist.get(0);
// strResult+="poi name="+poi.name+nextLine;
// strResult+="poi address="+poi.address+nextLine;
// strResult+="poi classes="+poi.classes+nextLine;
// strResult+="poi phone="+poi.phone+nextLine;
// strResult+="poi point="+poi.point.toString()+nextLine;
// }
// }
if (regeocoderResult.poilist != null) {
int iPoiSize = regeocoderResult.poilist.size();
if (iPoiSize > 0) {
PoiItem poi = regeocoderResult.poilist.get(0);
strResult = poi.address + poi.name;
}
}
System.out.println(strResult);
onTap(0);
} catch (Exception e) {
e.printStackTrace();
}
}
return super.onTouchEvent(arg0, arg1);
}