2013-03-11 118 views
-2

在谷歌地图中,​​我可以获得触摸点的纬度和经度。 现在我怎样才能得到纬度和经度(反向地理编码)的地址。用于在地图上显示地址的纬度和经度

+1

http://stackoverflow.com/a/9409229/1339473看到这一个.. – QuokMoon 2013-03-11 06:24:53

+0

退房这样的回答:http://stackoverflow.com/a/9409229/1567588 – SKK 2013-03-11 06:28:28

回答

0
List<Address> addresses = null; 
try { 
      Locale mLocale = new Locale("en"); 
      Geocoder gCoder = new Geocoder(context , mLocale); 
      addresses = gCoder.getFromLocation(lat, lng, 1); 
      Address addr = addresses.get(0); 
      ... 
      ... 
      .. 
     } catch (Exception e) { 

     } 

Geocoder

+0

' catch(Exception e)'really? – 2013-03-11 06:27:43

+0

为什么?那有什么问题? – 2013-03-11 06:28:42

+1

如果发生异常,你需要几个星期才能找到它:)我猜'catch(异常e)'是编程中可以做的最糟糕的事情。 – 2013-03-11 06:31:24

相关问题