How to save GeoPoint in Firebase Cloud Firestore?

后端 未结 4 472
小蘑菇
小蘑菇 2020-12-24 13:01

in the database UI I can create a field with the type geopoint. After providing values, it looks something like this:

location: [1° N, 1° E]
         


        
4条回答
  •  北海茫月
    2020-12-24 13:33

    The Firestore SDKs include a GeoPoint class, so you would have to save locations like this:

    {
      location: new firebase.firestore.GeoPoint(latitude, longitude)
    }
    

提交回复
热议问题