Search code examples
firebasegeolocationdatabase-normalizationgeofire

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!


Solution

  • There's nothing built into Geofire for you control the property names. But since Geofire is open-source, you can modify it to use the property names you want.

    Just be aware that Geofire uses these shorter names to limit the bandwidth it uses, so your users see a bandwidth increase.