Skip to content

Instantly share code, notes, and snippets.

@phsantiago
Created March 1, 2016 15:00
Show Gist options
  • Save phsantiago/dcbede5527678623f6e0 to your computer and use it in GitHub Desktop.
Save phsantiago/dcbede5527678623f6e0 to your computer and use it in GitHub Desktop.
//need angular. ljs = array de objetos
function getLocation(ljs){
angular.forEach(ljs, function(value, key){
setTimeout(function(){
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+value.MAPS+'&sensor=false', null, function (data) {
ljs[key] = $.extend(ljs[key],data.results[0].geometry)
console.log(JSON.stringify(ljs));
});
}, 1000);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment