我有以下火力地堡的數據庫結構,過濾火力地堡數據庫基於位置半徑
"-KSupX7CppMD1zbqIy0y" : {
"addedByUser" : "zQpb7o18VzYsSoTQtT9DNhOqTUn2",
"content" : "Post 1",
"cost" : "20",
"duration" : "Weekly",
"latitude" : "40.7594479995956",
"longitude" : "-73.9838934062393",
"timestamp" : "Fri 30 Sep"
},
"-KSuphuqO6a0lnrJYUkt" : {
"addedByUser" : "zQpb7o18VzYsSoTQtT9DNhOqTUn2",
"content" : "Post 2",
"cost" : "10",
"duration" : "Daily",
"latitude" : "40.7594329996462",
"longitude" : "-73.9846261181847",
"timestamp" : "Fri 30 Sep"
}
我需要過濾一定的距離參數範圍內的職位(小於50M,100M,150米& 200米),我可以得到從「經度」&「緯度」座標,但我努力過濾帖子。任何幫助將不勝感激。
非常感謝提前。新手加入Firebase & Swift。
看看Geofire:https://github.com/firebase/geofire-objc –