Created
May 5, 2017 13:15
-
-
Save prayashm97/adf42b013f21385ab4668cb9da77c2bd to your computer and use it in GitHub Desktop.
Hackstreetboys IceHero Creating HeatMaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment