android - 从多个纬度/经度获取多个地址

标签 android google-maps google-geocoder

我想获取多个纬度/经度的地址,有什么办法可以在一个请求中完成吗?

我可以使用这段代码获取一个位置的地址:

try {
 Geocoder geocoder;
 List<Address> addresses;
 geocoder = new Geocoder(MainActivity.this, Locale.getDefault());
 addresses = geocoder.getFromLocation(Double.parseDouble(latitude), Double.parseDouble(longitude), 1);
 String address = addresses.get(0).getAddressLine(0);
 Log.i("adresse :", address);
 } catch (IOException e) {
     Log.e("tag", e.getMessage());
    }

请帮忙。

最佳答案

制作一个方法,将您的坐标 LatLngs 列表传递给它并循环遍历您已有的代码。

关于android - 从多个纬度/经度获取多个地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21607962/

相关文章:

android - Intent 发送短信不再适用于 Android 11

android - 谷歌路线 API : Get the current step JSON-Object to current position on Android

android - 地理编码器返回多个地址

ruby - 当我尝试调用 Google Geocode API 时出现 SSL 错误

android - 如何以编程方式将项目添加到 xml?

android - 二进制 xml 文件第 9 行错误膨胀类

javascript - 谷歌地图 Javascript v3 : Polyline as Image?

javascript - 如何获取详细的地理编码信息?

android - 更改安卓 :installLocation from auto to internalOnly can lead to Play Store error 963

android - 创建 List<LatLng> 的数组