本文整理汇总了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);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:PoiAroundSearchActivity.java
示例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");
}
}
开发者ID:yimiaoxiehou,项目名称:ZhuHaiBusApplication,代码行数:13,代码来源:Geo.java
示例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);
}
}
开发者ID:Tsroad,项目名称:Road,代码行数:30,代码来源:GeocoderActivity.java
示例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);// 设置同步逆地理编码请求
}
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:39,代码来源:ReverseGeocodingUtil.java
示例5: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
开发者ID:Jude95,项目名称:Fishing,代码行数:4,代码来源:WritePresenter.java
示例6: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
/**
* 地理编码回调方法
* 位置转经纬度
* @param geocodeResult
* @param i
*/
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
开发者ID:Vicent9920,项目名称:MyMap,代码行数:11,代码来源:PiclocationActivity.java
示例7: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult arg0, int arg1) {
}
开发者ID:larrySmile02,项目名称:MultipleViewMap,代码行数:5,代码来源:RegeocodeTask.java
示例8: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:5,代码来源:AdvertisementPresenter.java
示例9: onGeocodeSearched
import com.amap.api.services.geocoder.GeocodeResult; //导入依赖的package包/类
/**
* 有高德地图,根据经纬度获取城市名
*
* @param geocodeResult
* @param i
*/
@Override
public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
}
开发者ID:chenjunqian,项目名称:here,代码行数:11,代码来源:MainMapFragment.java
注:本文中的com.amap.api.services.geocoder.GeocodeResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论