Skip to content

Instantly share code, notes, and snippets.

@Macariom01
Created September 10, 2014 17:37
Show Gist options
  • Select an option

  • Save Macariom01/674beff4729ac0ed4c14 to your computer and use it in GitHub Desktop.

Select an option

Save Macariom01/674beff4729ac0ed4c14 to your computer and use it in GitHub Desktop.
Shows how to access data form a gon var
// the gon.videos var is an array of objects
if (gon.videos.length >= 1){
for ( var i = 0; i < gon.videos.length; i++ ){
if( (gon.videos[i].lat < latUpperBound) && (gon.videos[i].lat > latLowerBound) && (gon.videos[i].long < lngUpperBound) && (gon.videos[i].long > lngLowerBound) ){
videoList.push(gon.videos[i]);
} // closes if( (gon.videos[i].lat...
} //closes for loop
} else{
videoList.push(gon.videos);
} //closes else
This also works if its not an array
console.log("gon.videos.lat = ",gon.videos.lat);
console.log("gon.videos.long = ",gon.videos.long);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment