Using
Cloud.Events.query({
where: {
lnglat: {
'$nearSphere': [userlngglobal,userlatglobal],
'$maxDistance': 0.00326
}
I have tried to pass variables in but keep getting Error Obj Obj
I have tried using '$nearSphere': [JSON.stringify(userlngglobal),54]
same error
The variable is gotten from here
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');
});
Answer gotten from the Appcelerator team
"$nearSphere":[Number(e.coords.longitude), Number(e.coords.latitude)]