【发布时间】:2020-05-30 05:10:10
【问题描述】:
您好,我有一个收集以下内容的网络表单:
-咖啡馆名称 -纬度 - 其位置的经度。
目前,经纬度在 Firestore 中保存为地图格式,而不是 GeoPoint。因此,我想就如何将其保存为 GeoPoint 格式/数据类型征求您的意见。
form.addEventListener('submit',(e)=>{
e.preventDefault();
db.collection('sgcafe').add ({
name: form.name.value,
category: form.category.value,
coordinates: {Latitude:form.lat.value,Longtitude:form.long.value} //save as map not Geopoint
我尝试了以下所有方法,但都不起作用。
coordinates: new firebase.firestore.GeoPoint(form.lat.value, form.long.value)
coordinates: firebase.firestore.GeoPoint(form.lat.value, form.long.value)
coordinates: GeoPoint(form.lat.value, form.long.value)
【问题讨论】:
标签: javascript firebase google-maps-api-3 google-cloud-firestore