如何计算 200 米范围内附近的人名单?
how to calculate nearby peoples list within 200 meters in flutter?
我想显示附近人的列表。如何制作循环来计算所有数据库的纬度和经度并给我附近的人列表,以便我可以向他们发送通知。 api 对此有帮助吗?以及如何实现所有这些东西?
这个插件有一个计算两个位置之间距离的方法
double distanceInMeters = await Geolocator().distanceBetween(startLatitude,startLongitude,endLatitude,endLongitude);
你可以循环查看附近的人
for (var person in people) {
double distanceInMeters = await Geolocator().distanceBetween(thisLatitude,thisLongitude,person.Latitude,person.Longitude);
if(distanceInMeters<=200){
notification();
}
}
我想显示附近人的列表。如何制作循环来计算所有数据库的纬度和经度并给我附近的人列表,以便我可以向他们发送通知。 api 对此有帮助吗?以及如何实现所有这些东西?
这个插件有一个计算两个位置之间距离的方法
double distanceInMeters = await Geolocator().distanceBetween(startLatitude,startLongitude,endLatitude,endLongitude);
你可以循环查看附近的人
for (var person in people) {
double distanceInMeters = await Geolocator().distanceBetween(thisLatitude,thisLongitude,person.Latitude,person.Longitude);
if(distanceInMeters<=200){
notification();
}
}