Skip to content

Instantly share code, notes, and snippets.

@AleeRojas
Last active August 29, 2015 14:07
Show Gist options
  • Save AleeRojas/82ace64cb5f562085be3 to your computer and use it in GitHub Desktop.
Save AleeRojas/82ace64cb5f562085be3 to your computer and use it in GitHub Desktop.
comerybeber = 'info.json'
$.getJSON( comerybeber, function() {
console.log( "success" );
})
.done(function( data ) {
// console.log(data);
$.each( data, function( i, item ) {
console.log(this);
console.log(item.latitud);
console.log(item.longitud);
lat2 = item.latitud;
lon2 = item.longitud;
var url = "infoextra.json";
$.getJSON( url, function() {
console.log( "nuevoJSON" );
})
.done(function( data ) {
$.each( data.results, function( i, item ) {
console.log(item.geometry.location.lat);
});
});
console.log("Esta a menos de " + radiokm + "km");
}); // End each
});
[
{
id: 4,
nombre: "Restaurant Piero",
celular: 97867866,
correo: "[email protected]",
direccion: "Juan Mackenna #2344",
latitud: "-40.577488",
longitud: "-73.131745",
usuario_id: 1
},
{
id: 5,
nombre: "Hotel Termas de Puyehue",
celular: 74163732,
correo: "[email protected]",
direccion: "",
latitud: "-40.720953",
longitud: "-72.3316847",
usuario_id: 1
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment