如何使用Google Play服务从lat / lng获取完整地址(不使用Geocoder) [英] How to get Full address from lat/lng using Google Play Service ( Not use Geocoder)

查看:399
本文介绍了如何使用Google Play服务从lat / lng获取完整地址(不使用Geocoder)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个10.792986,106.670004的位置。
如何获得如下所示的完整地址:


207LêVănSỹ,14,PhúNhuận
HồChíMinh ,越南


如果使用地理编码器,我无法获得完整地址。

 列表<地址>地址= null; 
String addressText =;

尝试{
addresses = geocoder.getFromLocation(latitude,longitude,1);
} catch(IOException e){
e.printStackTrace();



$ b $ p
$ b

那么,有什么办法可以使用Gooogle Play Service(例如:GoogleApiClient)从lat / lng获取完整地址或从lat / lng获取placeId。



我的意思是,什么是Android Api class for
经度/纬度的反向地理编码

解决方案

您是否尝试使用googleapis.com,geocode从lat an lng获取位置



只需传递您的经纬度到下面的查询字符串,你会得到一个json数组,从那里获取你的城市



http://maps.googleapis.com/maps/api/geocode/json?latlng=10.792986,106.670004&sensor = true


I have a position at 10.792986, 106.670004. How to get FULL address like as :

207 Lê Văn Sỹ, 14, Phú Nhuận Hồ Chí Minh, Vietnam

If using Geocoder, I couldn't get Full Adress.

List<Address> addresses = null;
        String addressText="";

        try {
            addresses = geocoder.getFromLocation(latitude, longitude,1);
        } catch (IOException e) {
            e.printStackTrace();
        }

So, is there any way to use Gooogle Play Service ( ex: GoogleApiClient) to get full address from lat /lng Or get placeId from lat/lng.

I mean, what is Android Api class for Reverse Geocoding for a Latitude/Longitude

解决方案

Have you try with googleapis.com, geocode get location from lat an lng

simply try to pass your lat and long to the following query string, and you will get a json array, fetch your city from there

http://maps.googleapis.com/maps/api/geocode/json?latlng=10.792986,106.670004&sensor=true

这篇关于如何使用Google Play服务从lat / lng获取完整地址(不使用Geocoder)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆