Mercurial > hg > LGMap
comparison map.js @ 15:f17f43f0a63f
bug fixed: download error for data from LGDataverse
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 30 Oct 2015 16:47:15 +0100 |
parents | 389cf726303e |
children | bb63a70b8542 |
comparison
equal
deleted
inserted
replaced
14:4151de159dbe | 15:f17f43f0a63f |
---|---|
158 | 158 |
159 // zoe added for incoming json object from LGDataverse | 159 // zoe added for incoming json object from LGDataverse |
160 if (urlParameter['name']!=undefined && urlParameter['file']==undefined && urlParameter['fileId']!=undefined) { | 160 if (urlParameter['name']!=undefined && urlParameter['file']==undefined && urlParameter['fileId']!=undefined) { |
161 var file=undefined; | 161 var file=undefined; |
162 var name=decodeURI(urlParameter['name']); | 162 var name=decodeURI(urlParameter['name']); |
163 var obj={name:name,file:file,preload:true}; | 163 var obj={name:name,file:file,preload:true}; |
164 datasetArray.splice(0,0,obj); | 164 datasetArray.splice(0,0,obj); |
165 }; | 165 }; |
166 // end | 166 // end |
167 | 167 |
168 initWindowWidget(); | 168 initWindowWidget(); |
190 $(".windowWidget").hide(); | 190 $(".windowWidget").hide(); |
191 $(".windowWidget .windowWidgetBar .visibilityButton").click(); | 191 $(".windowWidget .windowWidgetBar .visibilityButton").click(); |
192 | 192 |
193 // debug by yao | 193 // debug by yao |
194 $("#aboutIcon").click(); | 194 $("#aboutIcon").click(); |
195 | |
195 }); | 196 }); |
196 function getUrlParameter(){ | 197 function getUrlParameter(){ |
197 //examine the parameter "mode" in the url | 198 //examine the parameter "mode" in the url |
198 var url=window.location.href; | 199 var url=window.location.href; |
199 var pos=url.indexOf("?"); | 200 var pos=url.indexOf("?"); |
262 | 263 |
263 } | 264 } |
264 } | 265 } |
265 ]; | 266 ]; |
266 */ | 267 */ |
267 | 268 |
268 var dataCSVformat = fileData.file.dataString; | 269 var dataCSVformat = fileData.file.dataString; |
269 | 270 dataCSVformat = dataCSVformat.substring(0, dataCSVformat.length-2); // remove the last two characters which are "\n" |
271 // it will cause download error since the last element in table is null | |
270 //console.log(dataCSVformat); | 272 //console.log(dataCSVformat); |
271 var json = GeoTemConfig.convertCsv(dataCSVformat); | 273 var json = GeoTemConfig.convertCsv(dataCSVformat); |
272 | |
273 GeoTemConfig.addDataset(new Dataset(GeoTemConfig.loadJson(json),name)); | 274 GeoTemConfig.addDataset(new Dataset(GeoTemConfig.loadJson(json),name)); |
274 | 275 |
275 } | 276 } |
276 } else { | 277 } else { |
277 // zoe end | 278 // zoe end |
293 //display in all widgets | 294 //display in all widgets |
294 map.display(GeoTemConfig.datasets); | 295 map.display(GeoTemConfig.datasets); |
295 timeline.display(GeoTemConfig.datasets); | 296 timeline.display(GeoTemConfig.datasets); |
296 table.display(GeoTemConfig.datasets); | 297 table.display(GeoTemConfig.datasets); |
297 pieChart.display(GeoTemConfig.datasets); */ | 298 pieChart.display(GeoTemConfig.datasets); */ |
299 | |
298 } | 300 } |
301 | |
299 ); | 302 ); |
300 | 303 |
301 } | 304 } |
302 | 305 |
303 } | 306 } |
304 function closeDataset(name,fileName){ | 307 function closeDataset(name,fileName){ |
305 var idx; | 308 var idx; |