Skip to content

Commit

Permalink
Update Parser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
joh13010 committed Jan 13, 2017
1 parent 9a5a4d8 commit 0c8bbbd
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions Parser.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
var data;

function handleFile(evt) {

var file = evt.target.files[0];
console.log(file);

Papa.parse(file, {
header: true,
dynamicTyping: true,
complete: function(results)
{
complete: function(results) {
data = results;
console.log(results.data);
updateMapCenter(data);
addSlider(data);
updateMapCenter(data);
addMarkers(data);
}
});
}

// This method is only called when the initial CSV file is uploaded
function addMarkers(data)
{
for (var i = 0; i<data.data.length ; i++)
{
function addMarkers(data) {
for (var i = 0; i<data.data.length ; i++) {
var lat = data.data[i].latitude;
var lon = data.data[i].longitude;
var prov = data.data[i].Provider;
Expand All @@ -34,12 +28,6 @@ function addMarkers(data)
}
}

/* Troubleshooting Function
function showLatLang(lat, lon)
{
console.log("Latitude: " + lat + ". Longitude: " + lon);
} */

$(document).ready(function()
{
$("#csv-file").change(handleFile);
Expand Down

0 comments on commit 0c8bbbd

Please sign in to comment.