Max, I'm running this code in my main.js file.
Katya, I tried locationList[0].geolocation.latitude too. it's not working.
This is my code:
var PhotoObject = Parse.Object.extend('photo');
var photoObject = new PhotoObject();
var query = new Parse.Query(PhotoObject);
query.select('geolocation');
query.find({
success: function(locationList) {
alert("Successfully retrieved " + locationList.length + " photos.");
alert(locationList[0].geolocation.latitude);
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});
The first alert for locationList.length is giving correct value, but the second alert is causing this error in console:
It is failing at locationList[0].geolocation because that is returning undefined. I don't know how multi level JSON is supposed to be read.
This might be a very silly problem, but I really appreciate your help.
Thanks,
Rahul.