michartmann
Posts: 0
Joined: Sun Mar 18, 2012 12:56 pm

Problem posting GeoPoint to parse.com

Can't post a GeoPoint to Parse.com object - if I use the REST Test function I can't insert a "location" using the "second level" but if I post a single level location field with the value "{"__type":"GeoPoint", "latitude":40.0, "longitude":-30.0}" it works - Please help.

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

Problem posting GeoPoint to parse.com

Can you explain what you mean by "second level"? Do you mean entering JSON-like string?

michartmann
Posts: 0
Joined: Sun Mar 18, 2012 12:56 pm

Problem posting GeoPoint to parse.com

Working with "one" level works when testing the service but not when the second level is used - how is the second level converted into json? maybe it's not what parse.com is expecting?

Hope it makes it easier to understand what I'm having trouble with.

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

Problem posting GeoPoint to parse.com

Try this:

code
var point = {};
point['location']= { "__type":"GeoPoint", "latitude":40.0, "longitude":-30.0 };
return point;
/code

michartmann
Posts: 0
Joined: Sun Mar 18, 2012 12:56 pm

Problem posting GeoPoint to parse.com

Hi Max,
Thanks for your reply.
However I am not sure where to place your javascript?

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

Problem posting GeoPoint to parse.com

Sorry, when testing the service, you can use this (location is parameter name):

location {"__type":"GeoPoint", "latitude":40.0, "longitude":-30.0}

when using the service on a page, return for mapping:
code
return {"__type":"GeoPoint", "latitude":40.0, "longitude":-30.0};
/code

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

Problem posting GeoPoint to parse.com

Instead of using the fix value, two variables are replaced in the above example. What is the format in javascript?

I tried the following codes without the success.

var map = Tiggr('googlemap1');
var theLat=map.gmap.getCenter().lat();
var theLng=map.gmap.getCenter().lng();

return {"__type":"GeoPoint", "latitude": theLat, "longitude": theLng};

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

Problem posting GeoPoint to parse.com

As this is JavaScript, the variables would need to be concatenated with +.

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

Problem posting GeoPoint to parse.com

I tried this
return' {"__type":"GeoPoint", "latitude": "'+theLat+'", "longitude": "'+theLng+'"}';
But no success

Return to “Issues”