heatmap = new google.maps.visualization.HeatmapLayer({ | |
data: getPoints(), | |
map: map | |
}); | |
function getPoints() { | |
var returnVal = []; | |
$.getJSON( "https://prayashm97.github.io/js/ajax/testfile.json", function( data ) { | |
$.each( data, function( key, val ) { | |
x = { | |
'location':new google.maps.LatLng(val.Latitude,val.Longitude), 'weight': (((val.CO2)-371)/16) | |
} | |
returnVal.push(x) | |
}); | |
}) | |
.error(function(err) { console.error(err)}); | |
return(returnVal); | |
}; |
SpaceApps is a NASA incubator innovation program.