首页 > 解决方案 > How can I add fields named Latitude and Longitude using GeoFire in Firebase?

问题描述

Picture of the Database

I'm developing a Location Tracking App with Android Studio and need to store coordinates in a normalized manner (One Variable in One Field). Can I modify the location data created by GeoFire in Firebase? I would like to have a single field called Latitude and another one called Longitude. In the picture above you can see that the coordinates are both stored below one field called ' l ', I would like to modify this, or copy them as separate childs of the current userID in the node Location. Would greatly appreciate any help, thanks!

标签: firebasegeolocationdatabase-normalizationgeofire

解决方案


Geofire 中没有内置任何内容供您控制属性名称。但由于 Geofire 是开源的,您可以修改它以使用您想要的属性名称。

请注意,Geofire 使用这些较短的名称来限制其使用的带宽,因此您的用户会看到带宽增加。


推荐阅读