GeoPoint的解决 [英] Geopoint to address

查看:100
本文介绍了GeoPoint的解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何转移的GeoPoint解决示例

i want to know how to transfer geopoint to address Example

double src_lat =30.022584 ;
        double src_long = 31.343822;
   srcGeoPoint = new GeoPoint((int) (src_lat * 1E6),(int) (src_long * 1E6)); 

我怎么能得到这个srcGeoPoint的地址

how can i get the address of this srcGeoPoint

推荐答案

尝试这样的事情

            Geocoder geoCoder = new Geocoder(
                getBaseContext(), Locale.getDefault());
            try {
                List<Address> addresses = geoCoder.getFromLocation(
                    srcGeoPoint.getLatitudeE6()  / 1E6, 
                    srcGeoPoint.getLongitudeE6() / 1E6, 1);

                String add = "";
                if (addresses.size() > 0) 
                {
                    for (int i=0; i<addresses.get(0).getMaxAddressLineIndex(); 
                         i++)
                       add += addresses.get(0).getAddressLine(i) + "\n";
                }

                Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();
            } catch (IOException e) {                
                e.printStackTrace();
            }   

摘自: http://mobiforge.com/developing/story/using - 谷歌 - 地图 - 机器人

看地理编码和反向地理编码中途上下左右页

see geocoding and reverse geocoding about halfway down the page

您可能也想看看 https://developers.google.com/maps/文档/地理编码/

这篇关于GeoPoint的解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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