Flutter-如何在没有互联网的情况下从坐标获取国家/地区?

问题描述 投票:1回答:1

我有带有地理位置的Flutter应用。我用这个plugin。根据坐标,我需要确定国家。我可以为此使用插件。当有互联网时,它可以工作。但是当互联网不可用时,我还需要确定国家/地区。我只找到一种解决方案:

与主要城市的协调员一起导入数据库,并根据它们确定国家。

也许有一个更简单的解决方案?

flutter dart geolocation
1个回答
0
投票

使用geohash

void main() {
 GeoHasher geoHasher = GeoHasher();
  // country level precision: 10
  myGeoCountryLevelCoord := geoHasher.encode(-98, 38, precision: 10);

  // now you need to download countries geohashes and match it, won't be many, small file only

 }

检查countries global geohash map

© www.soinside.com 2019 - 2024. All rights reserved.