当前位置: 首页>>代码示例>>Java>>正文


Java PoiItem类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:23,代码来源:SOSOLocationActivity.java

示例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;
}
 
开发者ID:tencentlocation,项目名称:TencentLocationDemo,代码行数:10,代码来源:DemoGeofenceEditorActivty.java

示例3: getFenceItems

import com.tencent.tencentmap.mapsdk.search.PoiItem; //导入依赖的package包/类
public static ArrayList<PoiItem> getFenceItems() {
	return sFenceItems;
}
 
开发者ID:tencentlocation,项目名称:TencentLocationDemo,代码行数:4,代码来源:DemoGeofenceApp.java

示例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);
}
 
开发者ID:kk-java,项目名称:MarkerDragForTencentMap,代码行数:65,代码来源:ItemizedOverlayDemo.java


注:本文中的com.tencent.tencentmap.mapsdk.search.PoiItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。