Passing variable into nearsphere (Error Obj Obj) #appcelerator

68 Views Asked by At

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');
});
1

There are 1 best solutions below

0
On BEST ANSWER

Answer gotten from the Appcelerator team

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