Skip to content

Instantly share code, notes, and snippets.

@mechanicalgirl
Created November 15, 2016 18:39
Show Gist options
  • Save mechanicalgirl/a22f2ca5efd7771b5c1b0d13bf866710 to your computer and use it in GitHub Desktop.
Save mechanicalgirl/a22f2ca5efd7771b5c1b0d13bf866710 to your computer and use it in GitHub Desktop.
The code I have now that doesn't work (I only know it's not working because the map changed - the script isn't reading the coordinates I'm trying to pass in):
var testData = {
max: 8,
data: null
};
$.getJSON('traffic_fatalities.json', function(traffic_data) {
console.log(traffic_data);
testData.data = traffic_data;
});
heatmap.setData(testData);
here is what the json file looks like:
[{"lat": 30.4681, "count": 1, "lng": -97.7883}]
Here is what it's supposed to look like with the coordinates hard coded:
var testData = {
max: 8,
data: [{"lat": 30.4681, "count": 1, "lng": -97.7883}]
};
And where I'm logging the object to the console:
Array[1]
0:Object
count:1
lat:30.4681
lng:-97.7883
__proto__:Object ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment