我正在寻找一个移动应用程序(在颤动),可以推断出哪个省/地区/县的设备所在的地理位置。例如,如果设备的地理位置是'X‘,我希望能够将其转换为"Orange county,California“。
我在哪里可以找到这样的数据集,对于每个国家-包括区域名称的区域的多边形坐标(即。{...‘美国’:{...‘加利福尼亚州:{’奥兰治县‘:coords coords...,’圣地亚哥‘:coords coords ......})。
从逻辑上讲,我考虑过使用某种光线投射算法,如果你在这方面有任何好的参考(地理围栏),将非常感谢。
发布于 2019-12-17 17:28:50
您可以使用package https://pub.dev/packages/geopoint_location
您可以直接下载并运行https://github.com/synw/geopoint_location示例
您可以查看示例显示当前位置的地址
示例代码的工作演示

代码片段
class PositionWidget extends StatelessWidget {
const PositionWidget({
Key key,
@required this.locationPoint,
}) : super(key: key);
final GeoPoint locationPoint;
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Text("Latitude ${locationPoint.latitude}"),
Text("Longitude ${locationPoint.longitude}"),
Text("Altitude ${locationPoint.altitude}"),
Text("Speed ${locationPoint.speed}"),
Text("Address ${locationPoint.address}"),
],
);
}
}https://stackoverflow.com/questions/59366140
复制相似问题