# HG changeset patch # User Zoe Hong # Date 1446220035 -3600 # Node ID f17f43f0a63f1f23a243558849a3c6f3806d5142 # Parent 4151de159dbe1c3b190e0eb8dbe16b028c13c4b4 bug fixed: download error for data from LGDataverse diff -r 4151de159dbe -r f17f43f0a63f map.js --- a/map.js Wed Oct 28 12:02:37 2015 +0100 +++ b/map.js Fri Oct 30 16:47:15 2015 +0100 @@ -160,7 +160,7 @@ if (urlParameter['name']!=undefined && urlParameter['file']==undefined && urlParameter['fileId']!=undefined) { var file=undefined; var name=decodeURI(urlParameter['name']); - var obj={name:name,file:file,preload:true}; + var obj={name:name,file:file,preload:true}; datasetArray.splice(0,0,obj); }; // end @@ -192,6 +192,7 @@ // debug by yao $("#aboutIcon").click(); + }); function getUrlParameter(){ //examine the parameter "mode" in the url @@ -264,12 +265,12 @@ } ]; */ - + var dataCSVformat = fileData.file.dataString; - + dataCSVformat = dataCSVformat.substring(0, dataCSVformat.length-2); // remove the last two characters which are "\n" + // it will cause download error since the last element in table is null //console.log(dataCSVformat); var json = GeoTemConfig.convertCsv(dataCSVformat); - GeoTemConfig.addDataset(new Dataset(GeoTemConfig.loadJson(json),name)); } @@ -295,9 +296,11 @@ timeline.display(GeoTemConfig.datasets); table.display(GeoTemConfig.datasets); pieChart.display(GeoTemConfig.datasets); */ + } + ); - + } } diff -r 4151de159dbe -r f17f43f0a63f php/download.php --- a/php/download.php Wed Oct 28 12:02:37 2015 +0100 +++ b/php/download.php Fri Oct 30 16:47:15 2015 +0100 @@ -28,7 +28,7 @@ $mime = array('application/octet-stream'); header('Content-Type: '.$mime); - header('Content-Disposition: attachment; filename="test.kml"'); + header('Content-Disposition: attachment; filename="download.kml"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.sprintf('%d', $filesize)); header('Expires: 0');