Page 3 of 3

Problem posting GeoPoint to parse.com

Posted: Wed Dec 19, 2012 7:55 pm
by maxkatz

Had to add spaces to JSON, it wouldn't display correctly otherwise.


Problem posting GeoPoint to parse.com

Posted: Thu Dec 20, 2012 12:05 pm
by David Fung

Sorry, what do you mean? Add spaces in which command?

var jsonback = {};
jsonback ["__type"] = "Geopoint";
jsonback ["latitude"] = theLat;
jsonback ["longitude"] = theLng;

return JSON.stringify(jsonback);


Problem posting GeoPoint to parse.com

Posted: Thu Dec 20, 2012 4:41 pm
by maxkatz

I meant I had to add spaces to the JSON code only for formatting when replying here.


Problem posting GeoPoint to parse.com

Posted: Fri Jan 04, 2013 1:19 am
by maxkatz

Try this:

code
var jsonback = {
"__type": "GeoPoint",
"latitude": 10.0,
"longitude": 20.0,
};
return jsonback;
/code


Problem posting GeoPoint to parse.com

Posted: Sun May 26, 2013 2:32 pm
by Rahul Chidgopkar

I'm facing similar problems while uploading to Parse. I've tried
var jsonback = {};
jsonback ["__type"] = "Geopoint";
jsonback ["latitude"] = lat;
jsonback ["longitude"] = long;

return JSON.stringify(jsonback);

AND

var jsonback = {
"__type": "GeoPoint",
"latitude": lat,
"longitude": long,
};
return jsonback;

I used alert(JSON.stringify(jsonback)) to see exactly what was getting generated and this is the output I got http://prntscr.com/16r8wm

It looks correct but I get a Bad Request error like this http://prntscr.com/16r93x

This is definitely due to geopoint as I'm able to successfully upload image without geolocation.

Any help will be appreciated.


Problem posting GeoPoint to parse.com

Posted: Sun May 26, 2013 4:15 pm
by maxkatz

Please Chrome's Dev Tools (or Firebug) and Network tab to see the exact error message returned from Parse.