【问题标题】:Get persian information from android Geocoder从 android Geocoder 获取波斯信息
【发布时间】:2017-06-13 17:29:16
【问题描述】:

我正在尝试从 android Geocoder 获取波斯语信息,我的意思是我通过纬度和经度,我想用波斯语获取城市的名称,但是没有语言环境可以在波斯语中获取这些信息。 我可以看到在Place Autocomplete google 建议使用波斯语的位置名称,但没有为地理编码器设置区域设置。 有人知道用波斯语获取这些信息的方法吗?

【问题讨论】:

  • 检查是否实现:The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists. 或者查看 Google Places API:developers.google.com/places/android-api

标签: android google-maps google-api geolocation google-geocoder


【解决方案1】:

在构造函数中传递你想要的语言环境:

Geocoder geo = new Geocoder(getActivity(), new Locale("fa"));

【讨论】:

    【解决方案2】:

    更新geocoding 包:

     List<Placemark> _placemarks = 
         await placemarkFromCoordinates(
             latitude,
             longitude,
             localeIdentifier: "fa-IR"
         );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-04
      相关资源
      最近更新 更多