Mercurial > hg > STI-GWT
comparison war/scripts/sti/STICore.js @ 32:f635bbdc6a03
local KML display (beta)
| author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
|---|---|
| date | Fri, 30 Nov 2012 15:17:25 +0100 |
| parents | 4711c4ab0c23 |
| children | 24c45a9048f2 |
comparison
equal
deleted
inserted
replaced
| 31:c7701b00ca5b | 32:f635bbdc6a03 |
|---|---|
| 448 core.addDataSet( dataset ); | 448 core.addDataSet( dataset ); |
| 449 core.unblockUI(); | 449 core.unblockUI(); |
| 450 }, | 450 }, |
| 451 1 ); | 451 1 ); |
| 452 }, | 452 }, |
| 453 | |
| 454 /** | |
| 455 * retrieves and loads a kml-file from the local system | |
| 456 * | |
| 457 * @param {int} | |
| 458 * ds the datasource index | |
| 459 * @param {File} | |
| 460 * file the file that the user selected | |
| 461 */ | |
| 462 retrieveLocalKml: function(ds,filename){ | |
| 463 | |
| 464 var core = this; | |
| 465 if( this.blocked ){ | |
| 466 setTimeout( function(){ core.retrieveLocalKml(ds,filename); }, 100 ); | |
| 467 return; | |
| 468 } | |
| 469 core.blockUI(); | |
| 470 | |
| 471 var status = document.getElementById("statusText"); | |
| 472 status.innerHTML = "Retrieving Data ..."; | |
| 473 | |
| 474 var filelist = $('#localKMLFileChooser').get(0).files; | |
| 475 if (filelist.length > 0){ | |
| 476 var file = filelist[0]; | |
| 477 | |
| 478 var reader = new FileReader(); | |
| 479 | |
| 480 reader.readAsText(file); | |
| 481 | |
| 482 status.innerHTML = "Parsing Data ..."; | |
| 483 core.parseIt($.parseXML(reader.result),filename,ds); | |
| 484 } | |
| 485 | |
| 486 return; | |
| 487 }, | |
| 453 | 488 |
| 454 /** | 489 /** |
| 455 * parses the kml-file which includes the results for a given search request | 490 * parses the kml-file which includes the results for a given search request |
| 456 * | 491 * |
| 457 * @param {File} | 492 * @param {File} |
