<i id='J4t65'><tr id='J4t65'><dt id='J4t65'><q id='J4t65'><span id='J4t65'><b id='J4t65'><form id='J4t65'><ins id='J4t65'></ins><ul id='J4t65'></ul><sub id='J4t65'></sub></form><legend id='J4t65'></legend><bdo id='J4t65'><pre id='J4t65'><center id='J4t65'></center></pre></bdo></b><th id='J4t65'></th></span></q></dt></tr></i><div id='J4t65'><tfoot id='J4t65'></tfoot><dl id='J4t65'><fieldset id='J4t65'></fieldset></dl></div>
    1. <small id='J4t65'></small><noframes id='J4t65'>

      1. <legend id='J4t65'><style id='J4t65'><dir id='J4t65'><q id='J4t65'></q></dir></style></legend>
        • <bdo id='J4t65'></bdo><ul id='J4t65'></ul>
      2. <tfoot id='J4t65'></tfoot>

        使用纬度和经度获取特定地址

        时间:2023-09-02
      3. <tfoot id='2MpLY'></tfoot>
        1. <small id='2MpLY'></small><noframes id='2MpLY'>

            <tbody id='2MpLY'></tbody>

            1. <i id='2MpLY'><tr id='2MpLY'><dt id='2MpLY'><q id='2MpLY'><span id='2MpLY'><b id='2MpLY'><form id='2MpLY'><ins id='2MpLY'></ins><ul id='2MpLY'></ul><sub id='2MpLY'></sub></form><legend id='2MpLY'></legend><bdo id='2MpLY'><pre id='2MpLY'><center id='2MpLY'></center></pre></bdo></b><th id='2MpLY'></th></span></q></dt></tr></i><div id='2MpLY'><tfoot id='2MpLY'></tfoot><dl id='2MpLY'><fieldset id='2MpLY'></fieldset></dl></div>

                <legend id='2MpLY'><style id='2MpLY'><dir id='2MpLY'><q id='2MpLY'></q></dir></style></legend>
                • <bdo id='2MpLY'></bdo><ul id='2MpLY'></ul>
                  本文介绍了使用纬度和经度获取特定地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我需要知道是否有任何 API,我可以从那里接收当前地点的地址.使用位置管理器我已经收到了当前地点的纬度和经度,但我需要地址.

                  I need to know is there any API ,from where i can receive the Address of the current place.Using location Manager i have receive the latitude and longitude of the current place ,but i need the address.

                  我已经尝试了下面的 api.

                  I have tried the below api.

                  http://maps.googleapis.com/maps/api/geocode/json?latlng="+ lat + "," + lon + &sensor=true"
                  

                  但它没有显示确切的位置.有人可以帮助我吗.@谢谢

                  But it is not showing the exact place .Can somebody help me.@Thanks

                  推荐答案

                  来自 Geocoder 对象,可以调用 getFromLocation(double, double, int) 方法.

                  From a Geocoder object, you can call the getFromLocation(double, double, int) method.

                  喜欢:-

                  private String getAddress(double latitude, double longitude) {
                          StringBuilder result = new StringBuilder();
                          try {
                              Geocoder geocoder = new Geocoder(this, Locale.getDefault());
                              List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
                              if (addresses.size() > 0) {
                                  Address address = addresses.get(0);
                                  result.append(address.getLocality()).append("
                  ");
                                  result.append(address.getCountryName());
                              }
                          } catch (IOException e) {
                              Log.e("tag", e.getMessage());
                          }
                  
                          return result.toString();
                      }
                  

                  另一个最佳答案在这里 如何从谷歌地图的经纬度坐标中获取城市名称?

                  Another best answer is here How to get city name from latitude and longitude coordinates in Google Maps?

                  这篇关于使用纬度和经度获取特定地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:计算两个位置之间的方位角(纬度、经度) 下一篇:Android:getLastKnownLocation 已过期 - 如何强制刷新位置

                  相关文章

                  最新文章

                • <i id='kDPEs'><tr id='kDPEs'><dt id='kDPEs'><q id='kDPEs'><span id='kDPEs'><b id='kDPEs'><form id='kDPEs'><ins id='kDPEs'></ins><ul id='kDPEs'></ul><sub id='kDPEs'></sub></form><legend id='kDPEs'></legend><bdo id='kDPEs'><pre id='kDPEs'><center id='kDPEs'></center></pre></bdo></b><th id='kDPEs'></th></span></q></dt></tr></i><div id='kDPEs'><tfoot id='kDPEs'></tfoot><dl id='kDPEs'><fieldset id='kDPEs'></fieldset></dl></div>
                  • <bdo id='kDPEs'></bdo><ul id='kDPEs'></ul>
                  1. <legend id='kDPEs'><style id='kDPEs'><dir id='kDPEs'><q id='kDPEs'></q></dir></style></legend>
                      <tfoot id='kDPEs'></tfoot>

                      <small id='kDPEs'></small><noframes id='kDPEs'>