maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem posting GeoPoint to parse.com

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

David Fung
Posts: 0
Joined: Wed Nov 28, 2012 4:52 pm

Problem posting GeoPoint to parse.com

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);

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem posting GeoPoint to parse.com

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem posting GeoPoint to parse.com

Try this:

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

Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Problem posting GeoPoint to parse.com

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem posting GeoPoint to parse.com

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

Return to “Issues”