Saving Location GeoPoint to DB
Hi, I am struggling a bit saving Geopoint to DB.
I am getting the latitude and longitude, but DB is only giving me a bad request.
Event-Collection-DB = Col.location:
codelocation
(geopoint),idx/code
Mapping
code
var map = Appery('map');
var GLat = map.gmap.getCenter().lat();
var GLon = map.gmap.getCenter().lng();
var point = {};
//point['location']= {"latitude": GLat, "longitude": GLon};
//return point;
//return {"[type":"GeoPoint", "latitude": GLat, "longitude": GLon + ']'};
//var point = "[latitude": GLat, "longitude": GLon + ']';
//point = {"type": "GeoPoint","latitude": GLat, "longitude": GLon};
//point[value]= { "latitude": GLat, "longitude": GLon };
//"location": "[" + 48.208 + "," + 16.373 + "]"
//point[value]= { GLat, GLon };
//point[value]= {GLat,GLon };
/*var point = {
"__type": "GeoPoint",
"latitude": GLat,
"longitude": GLon,
}; */
//var point = "[" + GLon + ", " + GLat + "]"
//point[value]= { "location": [GLat, GLon] };
point[value]= {"latitude": GLat, "longitude": GLon };
console.log(point);
return point;
/code
As you can see, I have tried alot of different options for the mapping. Suggestions?