0

So, I'm building an app that's using Firestore to store data from its users. In the users doc there's a field called location that is storing the location from each user whenever they access the map on the app.

My question is if is there a way to get the nearby users location (getting it from the info Firestore has stored), so I can display a marker on the map in that location, for the user that its currently using the app?

Is there a better way to approach this? I'd also like to disclaim that I'm not currently interested in either the battery usage or user privacy as this app is only for testing purposes for a class.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Doesn't look like geo queries have been implemented yet: https://stackoverflow.com/questions/46607760/how-to-query-closest-geopoints-in-a-collection-in-firebase-cloud-firestore You'll have to roll your own or use a third party solution – kabuko Jan 17 '18 at 02:07
  • What you're trying to do is known as a geoquery. While you can [store geographical locations in Firestore](https://firebase.google.com/docs/firestore/manage-data/data-types), [geoqueries are not supported yet](https://stackoverflow.com/questions/46607760/how-to-query-closest-geopoints-in-a-collection-in-firebase-cloud-firestore). – Frank van Puffelen Jan 17 '18 at 02:07
  • I'm not sure if I should ask this here. But is there another way to work around this, ideally I would like to have it be concurrent users (logged at the same time), but I can work with having its location persistent across all users that access the application (if nearby enough). In the same vein is there any way to access (in firestore) another user document (since I won't know its unique ID)? – user3336801 Jan 17 '18 at 03:23

1 Answers1

0

For now FireStore do not support Geoqueries.

How to query closest GeoPoints in a collection in Firebase Cloud Firestore?

this is a post! the firebase engineers sayes they will add Geoqueries facilities. But when they did not mentioned!

i am also looking for the ans.