• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RegeocodeResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amap.api.services.geocoder.RegeocodeResult的典型用法代码示例。如果您正苦于以下问题:Java RegeocodeResult类的具体用法?Java RegeocodeResult怎么用?Java RegeocodeResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RegeocodeResult类属于com.amap.api.services.geocoder包,在下文中一共展示了RegeocodeResult类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCameraChangeFinish

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onCameraChangeFinish(CameraPosition cameraPosition) {
    LatLng target = cameraPosition.target;
    lp = new LatLonPoint(target.latitude, target.longitude);
    GeocodeSearch geocoderSearch = new GeocodeSearch(this);
    geocoderSearch.setOnGeocodeSearchListener(new GeocodeSearch.OnGeocodeSearchListener() {
        @Override
        public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
            if (rCode == AMapException.CODE_AMAP_SUCCESS) {
                if (result != null && result.getRegeocodeAddress() != null
                        && result.getRegeocodeAddress().getPois() != null) {
                    listviewAdapter.setData(result.getRegeocodeAddress().getPois());
                }
            } else {
                ToastUtils.showToast(mContext, String.valueOf(rCode));
            }
        }

        @Override
        public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {

        }
    });
    RegeocodeQuery query = new RegeocodeQuery(lp, 200, GeocodeSearch.AMAP);
    geocoderSearch.getFromLocationAsyn(query);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:PoiAroundSearchActivity.java


示例2: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
     * 逆地理编码回调方法
     * 经纬度转位置
     * @param result
     * @param rCode
     */
    @Override
    public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
            if (rCode == AMapException.CODE_AMAP_SUCCESS) {
                if (result != null && result.getRegeocodeAddress() != null
                        && result.getRegeocodeAddress().getFormatAddress() != null) {
                    lvHolder.address = result.getRegeocodeAddress().getFormatAddress();
                    data.remove(0);
                    data.add(0,lvHolder);
                } else {
        //                ToastUtil.show(ReGeocoderActivity.this, R.string.no_result);
                }
        } else {
//            ToastUtil.showerror(this, rCode);
        }
    }
 
开发者ID:Vicent9920,项目名称:MyMap,代码行数:22,代码来源:PiclocationActivity.java


示例3: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
    if (rCode == 1000) {
        if (result != null && result.getRegeocodeAddress() != null
                && result.getRegeocodeAddress().getFormatAddress() != null) {
            String addressName = "地址:" + result.getRegeocodeAddress().getFormatAddress()
                    + "附近";
            mView.setAddressTextViewVisibility(View.VISIBLE);
            mView.setAddressTextViewText(addressName);
        } else {
            mView.setAddressTextViewVisibility(View.GONE);
        }
    } else {
        mView.setAddressTextViewVisibility(View.GONE);
    }
}
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:17,代码来源:AdvertisementPresenter.java


示例4: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
	 * 逆地理编码回调
	 */
	@Override
	public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
//		dismissDialog();
		if (rCode == 0) {
			if (result != null && result.getRegeocodeAddress() != null
					&& result.getRegeocodeAddress().getFormatAddress() != null) {
				addressName = result.getRegeocodeAddress().getFormatAddress()
						+ "附近";
				aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
						AMapUtil.convertToLatLng(latLonPoint), 15));
				regeoMarker.setPosition(AMapUtil.convertToLatLng(latLonPoint));
				ToastUtil.show(GeocoderActivity.this, addressName);
			} else {
				ToastUtil.show(GeocoderActivity.this, R.string.no_result);
			}
		} else if (rCode == 27) {
			ToastUtil.show(GeocoderActivity.this, R.string.error_network);
		} else if (rCode == 32) {
			ToastUtil.show(GeocoderActivity.this, R.string.error_key);
		} else {
			ToastUtil.show(GeocoderActivity.this,
					getString(R.string.error_other) + rCode);
		}
	}
 
开发者ID:Tsroad,项目名称:Road,代码行数:28,代码来源:GeocoderActivity.java


示例5: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeReult,
		int resultCode) {
	if (resultCode == 0) {
		if (regeocodeReult != null
				&& regeocodeReult.getRegeocodeAddress() != null
				&& mOnLocationGetListener != null) {
			String address = regeocodeReult.getRegeocodeAddress()
					.getFormatAddress();
			String city = regeocodeReult.getRegeocodeAddress().getCityCode();
	 
			PositionEntity entity = new PositionEntity();
			entity.address = address;
			entity.city = city;
			mOnLocationGetListener.onRegecodeGet(entity);

		}
	}
	//TODO 可以根据app自身需求对查询错误情况进行相应的提示或者逻辑处理
}
 
开发者ID:amapapi,项目名称:Android_UsingCar_Example,代码行数:21,代码来源:RegeocodeTask.java


示例6: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
 * 逆地理编码回调
 */
@Override
public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
	if (rCode == 0) {
		if (result != null
				&& result.getRegeocodeAddress() != null
				&& result.getRegeocodeAddress().getFormatAddress() != null) {
			addressName = result.getRegeocodeAddress()
					.getFormatAddress();
			mCurPoint = aMap.addMarker(new MarkerOptions()
					.position(mpositionLatLng)
					.title(addressName)
					.snippet("点击到那去~")
					.icon(BitmapDescriptorFactory
							.fromResource(R.drawable.ic_search)));

		} else {
			ToastUtil.showLong(getActivity(), R.string.no_result);
		}
	} else {
		// ToastUtil.showLong(getActivity(), R.string.error_network);
	}
}
 
开发者ID:flsf,项目名称:WHUMap,代码行数:26,代码来源:MyMapFragment.java


示例7: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeReult,
		int resultCode) {
	if (resultCode == AMapException.CODE_AMAP_SUCCESS) {
		if (regeocodeReult != null
				&& regeocodeReult.getRegeocodeAddress() != null
				&& mOnLocationGetListener != null) {
			String address = regeocodeReult.getRegeocodeAddress()
					.getFormatAddress();
			String city = regeocodeReult.getRegeocodeAddress().getCityCode();
	 
			PositionEntity entity = new PositionEntity();
			entity.address = address;
			entity.city = city;
			mOnLocationGetListener.onRegecodeGet(entity);

			if (regeocodeReult != null && regeocodeReult.getRegeocodeAddress() != null
					&& regeocodeReult.getRegeocodeAddress().getFormatAddress() != null) {
				List<PoiItem> poiItemList = regeocodeReult.getRegeocodeAddress().getPois();
				mOnLocationGetListener.onRegecodeCallback(poiItemList);
			} else {
				Toast.makeText(mContext, R.string.no_result, Toast.LENGTH_SHORT).show();
			}

		}
	}
	//TODO 可以根据app自身需求对查询错误情况进行相应的提示或者逻辑处理
}
 
开发者ID:larrySmile02,项目名称:MultipleViewMap,代码行数:29,代码来源:RegeocodeTask.java


示例8: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
     * 逆地理编码回调
     */
    @Override
    public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
//        dismissDialog();
        if (rCode == 0) {
            if (result != null && result.getRegeocodeAddress() != null
                    && result.getRegeocodeAddress().getFormatAddress() != null) {
                addressName = result.getRegeocodeAddress().getFormatAddress()
                        + "附近";
//                aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
//                        AMapUtil.convertToLatLng(latLonPoint), 15));
                aMap.moveCamera(CameraUpdateFactory
                        .newCameraPosition(aMap.getCameraPosition()));
                regeoMarker.setPosition(AMapUtil.convertToLatLng(latLonPoint));
//                ToastUtil.show(MainActivity.this, addressName);

//                if(dispFlag==1)
//                {
                    regeoMarker.setTitle(addressName);
                    regeoMarker.showInfoWindow();
//                }

            } else {
                ToastUtil.show(MainActivity.this, R.string.no_result);
            }
        } else if (rCode == 27) {
            ToastUtil.show(MainActivity.this, R.string.error_network);
        } else if (rCode == 32) {
            ToastUtil.show(MainActivity.this, R.string.error_key);
        } else {
            ToastUtil.show(MainActivity.this,
                    getString(R.string.error_other) + rCode);
        }
    }
 
开发者ID:Tsroad,项目名称:Road,代码行数:37,代码来源:MainActivity.java


示例9: reverseGeocode

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
 * @description: 开启一个反向地理编码的任务,通过EventReverseGeocodingResult返回结果
 * @author: chenshiqiang E-mail:[email protected]
 * @param loc
 */
public static void reverseGeocode(final LatLng loc, final Object model){
	GeocodeSearch geocoderSearch = new GeocodeSearch(App.app);
	geocoderSearch.setOnGeocodeSearchListener(new OnGeocodeSearchListener() {
		@Override
		public void onRegeocodeSearched(RegeocodeResult result, int rCode) {

			if (rCode == 0) {
				if (result != null && result.getRegeocodeAddress() != null
						&& result.getRegeocodeAddress().getFormatAddress() != null) {
					String address = result.getRegeocodeAddress().getFormatAddress();
					
					if(TextUtils.isEmpty(address)){
						EventBus.getDefault().post(
			            		new EventReverseGeocodingResult(loc, null, model));
					}else{
						EventBus.getDefault().post(
			            		new EventReverseGeocodingResult(loc, address, model));
					}
				}
			}
		}
		
		@Override
		public void onGeocodeSearched(GeocodeResult arg0, int arg1) {
		}
	});
	
	// 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系
	RegeocodeQuery query = new RegeocodeQuery(new LatLonPoint(loc.latitude, loc.longitude), 
			1000,
			GeocodeSearch.AMAP);
	geocoderSearch.getFromLocationAsyn(query);// 设置同步逆地理编码请求
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:39,代码来源:ReverseGeocodingUtil.java


示例10: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
    address.setText(regeocodeResult.getRegeocodeAddress().getFormatAddress());
    mAddress = regeocodeResult.getRegeocodeAddress().getFormatAddress();
    mBriefAddress = regeocodeResult.getRegeocodeAddress().getTownship();
    Uri uri = Uri.parse("http://m.amap.com/navi").buildUpon()
            .appendQueryParameter("dest",LocationModel.getInstance().getCurLocation().getLatitude()+","+LocationModel.getInstance().getCurLocation().getLongitude())
            .appendQueryParameter("destName",mAddress)
            .appendQueryParameter("hideRouteIcon","1")
            .appendQueryParameter("key","474871845dfffa03a26cfcb0ab4fb4f1")
            .build();
    locationMessage = LocationMessage.obtain(LocationModel.getInstance().getCurLocation().getLatitude(),LocationModel.getInstance().getCurLocation().getLongitude(),
            mAddress, uri);
}
 
开发者ID:Jude95,项目名称:Fishing,代码行数:15,代码来源:PlaceLocationSelectActivity.java


示例11: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
/**
 * 有高德地图,根据经纬度获取城市名,再获取帖子
 *
 * @param regeocodeResult
 * @param i
 */
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
    String cityName = regeocodeResult.getRegeocodeAddress().getCity();
    if (CommonUtil.isEmptyString(cityName)||cityName.equals(LocationInfo.getCityName())) {
        return;
    }  else {
        getMorePost(currentCameraLatLng.getLongitude(), currentCameraLatLng.getLatitude(), cityName, 20);
    }
}
 
开发者ID:chenjunqian,项目名称:here,代码行数:16,代码来源:MainMapFragment.java


示例12: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
    Log.d(TAG, "onRegeocodeSearched: "+regeocodeResult.toString());
}
 
开发者ID:yimiaoxiehou,项目名称:ZhuHaiBusApplication,代码行数:5,代码来源:Geo.java


示例13: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
    address = regeocodeResult.getRegeocodeAddress().getTownship();
    getView().showAddress(address);
}
 
开发者ID:Jude95,项目名称:Fishing,代码行数:6,代码来源:WritePresenter.java


示例14: onRegeocodeSearched

import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {

}
 
开发者ID:Tsroad,项目名称:Road,代码行数:5,代码来源:Welcome.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OperationType类代码示例发布时间:2022-05-22
下一篇:
Java EnumEditor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap