本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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自身需求对查询错误情况进行相应的提示或者逻辑处理
}
示例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);
}
}
示例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自身需求对查询错误情况进行相应的提示或者逻辑处理
}
示例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);
}
}
示例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);// 设置同步逆地理编码请求
}
示例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);
}
示例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);
}
}
示例12: onRegeocodeSearched
import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
Log.d(TAG, "onRegeocodeSearched: "+regeocodeResult.toString());
}
示例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);
}
示例14: onRegeocodeSearched
import com.amap.api.services.geocoder.RegeocodeResult; //导入依赖的package包/类
@Override
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
}