【问题标题】:how can I convert latitude, longitude to address when internet is off in flutter?当互联网关闭时,如何将纬度,经度转换为地址?
【发布时间】:2021-08-23 09:38:08
【问题描述】:

简而言之,我想在离线模式下从经纬度获取地址。 我试过这个geocoder 包。但这是需要互联网才能从经纬度获取地址

目前尝试过
static getCurrentLocationAddress() async {
    try {
      List<Placemark> listPlaceMarks = await placemarkFromCoordinates(
          currentPosition.latitude, currentPosition.longitude);
      Placemark place = listPlaceMarks[0];
      currentLocationAddress =
          "${place.country}, ${place.locality}, ${place.administrativeArea}";
    } catch (e) {
      print(e);
    }
  }

我只是想要同样的想法,但不需要互联网。

欢迎任何答案和建议。提前致谢。

【问题讨论】:

  • pub.dev/packages/location 这对你有帮助
  • shubham 先生,这个包裹不是退货地址。看看我想在不访问互联网的情况下获得经纬度地址的问题。
  • 嗨@abdul 很抱歉,但无法离线执行此任务您必须需要互联网连接才能执行此任务也请查看此答案也许这对您有用stackoverflow.com/questions/6159074/…
  • 我已经完成了这个答案。谢谢建议

标签: flutter geolocation latitude-longitude


【解决方案1】:

您只能通过互联网使用此软件包按位置获取您的地址。 不使用互联网就无法获取地址。

https://pub.dev/packages/geolocator

【讨论】:

    猜你喜欢
    • 2010-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-12
    • 2021-04-15
    • 1970-01-01
    • 1970-01-01
    • 2017-05-10
    相关资源
    最近更新 更多