本文整理汇总了Java中com.amap.api.services.geocoder.GeocodeResult类的典型用法代码示例。如果您正苦于以下问题:Java GeocodeResult类的具体用法?Java GeocodeResult怎么用?Java GeocodeResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeocodeResult类属于com.amap.api.services.geocoder包,在下文中一共展示了GeocodeResult类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCameraChangeFinish
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的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: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int rCode) {
Log.d(TAG, "onGeocodeSearched: rCode is "+rCode);
if (rCode == 1000){
List<GeocodeAddress> addressList = geocodeResult.getGeocodeAddressList();
Log.d(TAG, "onGeocodeSearched: list size is "+addressList.size());
mapActivity.destination = addressList.get(0);
Log.d(TAG, "onGeocodeSearched: first address is "+addressList.get(0).getFormatAddress());
}else {
Log.d(TAG, "onGeocodeSearched: error");
}
}
示例3: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
/**
* 地理编码查询回调
*/
@Override
public void onGeocodeSearched(GeocodeResult result, int rCode) {
// dismissDialog();
if (rCode == 0) {
if (result != null && result.getGeocodeAddressList() != null
&& result.getGeocodeAddressList().size() > 0) {
GeocodeAddress address = result.getGeocodeAddressList().get(0);
aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
AMapUtil.convertToLatLng(address.getLatLonPoint()), 15));
geoMarker.setPosition(AMapUtil.convertToLatLng(address
.getLatLonPoint()));
addressName = "经纬度值:" + address.getLatLonPoint() + "\n位置描述:"
+ address.getFormatAddress();
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);
}
}
示例4: reverseGeocode
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的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);// 设置同步逆地理编码请求
}
示例5: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
示例6: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
/**
* 地理编码回调方法
* 位置转经纬度
* @param geocodeResult
* @param i
*/
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
示例7: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult arg0, int arg1) {
}
示例8: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
示例9: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
/**
* 有高德地图,根据经纬度获取城市名
*
* @param geocodeResult
* @param i
*/
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}