我想要一个可以获取用户位置并使用 GPS 显示地名的按钮。
I tried map_view https://pub.dartlang.org/packages/map_view但它只能获取纬度和经度。
use the geocoder https://pub.dartlang.org/packages/geocoder插入
它为您提供从坐标查找地址 https://pub.dartlang.org/documentation/geocoder/0.0.1/services_base/Geocoding/findAddressesFromCoordinates.html
导入'包:geocoder/geocoder.dart';
example;
final coordinates = new Coordinates(1.10, 45.50);
addresses = await Geocoder.local.findAddressesFromCoordinates(coordinates);
first = addresses.first;
print("${first.featureName} : ${first.addressLine}");
NOTE:你也可以使用地理定位 https://pub.dartlang.org/packages/geolocation插件可以获取很多有用的信息,例如检索最后已知的位置
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)