How to get Full address from lat/lng using Google Play Service ( Not use Geocoder)

耗尽温柔 提交于 2020-01-17 12:21:31

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/30013558/how-to-get-full-address-from-lat-lng-using-google-play-service-not-use-geocode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!