小编Moz*_*deh的帖子

Flutter Firestore 地理查询距我的位置一定距离

我将用户数据(包括他们的实时位置)存储为我的 firebase 数据库中的GeoPoint数据类型。现在我需要从数据库中选择并获取距我的位置一定距离的用户。我使用这行代码来检索我的位置:

position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
Run Code Online (Sandbox Code Playgroud)

不,我需要在 flutter 中进行 firebase 查询来检索我周围 500 米的用户。这意味着我应该从 firebase 数据库中检索距离为 500 米的所有用户。我怎样才能做到这一点?

geolocation firebase flutter google-cloud-functions

2
推荐指数
1
解决办法
1794
查看次数