0

使用傳遞變量到nearsphere(錯誤的OBJ的OBJ)#appcelerator

Cloud.Events.query({ 
      where: { 
     lnglat: { 
      '$nearSphere': [userlngglobal,userlatglobal], 
      '$maxDistance': 0.00326 
     } 

我試圖傳遞變量,但不斷得到Error Obj Obj 我一直在使用'$nearSphere': [JSON.stringify(userlngglobal),54]同樣的錯誤 嘗試的變量就是從這裏

得到
Ti.Geolocation.forwardGeocoder(textfield.getValue(), function(e) { 
    Ti.API.info(e); 
    userlngglobal = e.longitude; 
    userlatglobal = e.latitude; 
    win.close(); 
    console.log('longitude' +userlngglobal); 
     alert('latitude: '+userlatglobal); 
    alert('youve updated it'); 
}); 

回答

1

答案從Appcelerator的團隊得到

"$nearSphere":[Number(e.coords.longitude), Number(e.coords.latitude)]