Mercurial > hg > STI-GWT
annotate war/scripts/sti/STICore.js @ 73:02cdf454d94b trimmed_data
only create XLMSerializer once per dataset parsing
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 11 Jan 2013 13:05:40 +0100 |
parents | 4d3df00f5b98 |
children | d69066d16e45 |
rev | line source |
---|---|
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
1 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
2 * defines the core component of the Spatio Temporal Interface |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
3 * |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
4 * @constructor |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
5 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
6 function STICore(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
7 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
8 this.map; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
9 this.timeplot; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
10 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
11 this.refining; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
12 this.individualDataSet; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
13 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
14 this.takeTime; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
15 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
16 this.history; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
17 this.historyIndex; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
18 this.lockScreenContainer; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
19 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
20 this.initialize(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
21 this.blocked = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
22 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
23 }; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
24 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
25 STICore.prototype = { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
26 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
27 blockUI: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
28 this.blocked = true; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
29 fullscreen.addFullscreen(fullscreen.loaderContent()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
30 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
31 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
32 unblockUI: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
33 this.blocked = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
34 setTimeout( function(){ if( !this.blocked ){ setDefinedBounds(); } }, 150 ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
35 fullscreen.removeFullscreen(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
36 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
37 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
38 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
39 * refines the given data by creating a new history entry |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
40 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
41 refine: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
42 if (this.refining > -2) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
43 var contains = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
44 var newDataSets = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
45 var oldDataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
46 for (var i = 0; i < oldDataSets.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
47 var dataSet = oldDataSets[i].copy(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
48 dataSet.source = oldDataSets[i].source; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
49 for (var j = 0; j < oldDataSets[i].objects.length; j++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
50 if ( oldDataSets[i].objects[j].percentage == 1 || this.refining > -1 && this.refining != i ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
51 dataSet.addObject( oldDataSets[i].objects[j] ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
52 contains = true; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
53 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
54 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
55 newDataSets.push(dataSet); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
56 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
57 if (contains) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
58 this.addHistoryEntry( new HistoryEntry(newDataSets) ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
59 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
60 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
61 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
62 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
63 alert("Your Selection contains no elements!"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
64 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
65 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
66 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
67 alert("For Refining choose an Area on the map or a Range on the Timeplot!"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
68 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
69 return -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
70 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
71 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
72 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
73 * refines the given data by creating a new history entry |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
74 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
75 refineByTime: function(minTime,maxTime){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
76 var minDate = new Date(parseInt(minTime)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
77 var maxDate = new Date(parseInt(maxTime)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
78 if( this.timeplot.eds.minDate.getTime() == minDate.getTime() && |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
79 this.timeplot.eds.maxDate.getTime() == maxDate.getTime() ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
80 return; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
81 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
82 var newDataSets = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
83 var oldDataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
84 for (var i = 0; i < oldDataSets.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
85 var dataSet = oldDataSets[i].copy(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
86 dataSet.source = oldDataSets[i].source; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
87 for (var j = 0; j < oldDataSets[i].objects.length; j++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
88 var o = oldDataSets[i].objects[j]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
89 if( o.inTime(minDate,maxDate) ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
90 dataSet.addObject( o ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
91 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
92 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
93 newDataSets.push(dataSet); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
94 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
95 this.addHistoryEntry( new HistoryEntry(newDataSets) ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
96 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
97 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
98 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
99 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
100 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
101 * refines a given dataset by a given text snippet |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
102 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
103 refineByText: function(text,index){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
104 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
105 var dataset = this.history[this.historyIndex].dataSets[index]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
106 for (var i = 0; i < dataset.objects.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
107 var e = dataset.objects[i]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
108 if( e.name.toLowerCase().indexOf(text.toLowerCase()) != -1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
109 e.setPercentage(1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
110 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
111 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
112 this.updateMapAndTimeAndTable(index); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
113 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
114 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
115 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
116 * adds selected elements of a specific dataset as a new dataset |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
117 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
118 * @param {int} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
119 * id the id of the dataset |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
120 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
121 storeSelected: function(id){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
122 var dataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
123 if( dataSets.length == 4 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
124 alert( "The maximum number of 4 parallel datasets is reached!" ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
125 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
126 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
127 var dataSet = dataSets[id].copy(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
128 var contains = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
129 for (var j = 0; j < dataSets[id].objects.length; j++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
130 if ( dataSets[id].objects[j].percentage == 1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
131 dataSet.addObject( dataSets[id].objects[j] ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
132 contains = true; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
133 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
134 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
135 if (contains) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
136 this.addDataSet(dataSet); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
137 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
138 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
139 alert("Your Selection contains no elements!"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
140 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
141 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
142 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
143 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
144 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
145 * Adds a dataset to the actual history entry |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
146 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
147 addDataSet: function( dataSet ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
148 var oldDataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
149 var newDataSets = oldDataSets.concat(dataSet); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
150 this.addHistoryEntry(new HistoryEntry(newDataSets)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
151 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
152 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
153 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
154 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
155 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
156 * Sets the widgets for the core component |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
157 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
158 * @param {STIMap} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
159 * map the javascript object of the map widget |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
160 * @param {STITimeplot} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
161 * plot the javascript object of the timeplot widget |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
162 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
163 setElements: function(map, timeplot){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
164 this.map = map; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
165 this.timeplot = timeplot; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
166 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
167 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
168 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
169 * initializes the core component for the Spatio Temporal Interface. here, |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
170 * the handling of the search interface is defined (including undo, refine |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
171 * and clear selection button). furthermore, the elements (map, timeplot, |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
172 * tables) are instanciated. |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
173 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
174 initialize: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
175 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
176 var context = this; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
177 this.takeTime = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
178 this.props = new STIProps(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
179 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
180 this.history = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
181 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
182 this.history.push( new HistoryEntry([]) ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
183 this.historyIndex = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
184 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
185 var Unselectable = { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
186 enable: function(e){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
187 var e = e ? e : window.event; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
188 if (e.button != 1) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
189 if (e.target) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
190 var targer = e.target; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
191 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
192 else |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
193 if (e.srcElement) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
194 var targer = e.srcElement; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
195 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
196 if( targer.tagName == undefined ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
197 return false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
198 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
199 var targetTag = targer.tagName.toLowerCase(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
200 if ((targetTag != "input") && (targetTag != "textarea")) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
201 return false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
202 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
203 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
204 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
205 disable: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
206 return true; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
207 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
208 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
209 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
210 if (typeof(document.onselectstart) != "type filter textundefined") { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
211 document.onselectstart = Unselectable.enable; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
212 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
213 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
214 document.onmousedown = Unselectable.enable; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
215 document.onmouseup = Unselectable.disable; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
216 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
217 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
218 this.sources = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
219 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
220 var jsonString = this.getFileString("datasources.json"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
221 this.sources = eval('(' + jsonString + ')'); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
222 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
223 catch(e){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
224 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
225 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
226 this.lockScreenContainer = document.createElement("div"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
227 this.lockScreenContainer.setAttribute('class','lockScreenContainer'); |
18
60d50ef2261f
move lockscreen-container below mainContainer
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
228 document.getElementById("mainContainer").appendChild(this.lockScreenContainer); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
229 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
230 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
231 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
232 getFileString: function(url){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
233 var xmlhttp = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
234 if (!xmlhttp) |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
235 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
236 xmlhttp = new XMLHttpRequest(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
237 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
238 catch (e) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
239 xmlhttp = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
240 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
241 if (typeof ActiveXObject != "undefined") { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
242 if (!xmlhttp) |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
243 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
244 xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
245 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
246 catch (e) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
247 xmlhttp = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
248 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
249 if (!xmlhttp) |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
250 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
251 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
252 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
253 catch (e) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
254 xmlhttp = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
255 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
256 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
257 xmlhttp.open('GET', url, false); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
258 xmlhttp.send(""); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
259 return xmlhttp.responseText; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
260 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
261 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
262 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
263 * constructs an url to a dynamic datasource with the specific user input as |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
264 * attribute |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
265 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
266 * @param {int} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
267 * ds the datasource index |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
268 * @param {String} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
269 * input the user input |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
270 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
271 retrieveKml: function(ds,input){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
272 var url = this.sources[ds].url; |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
273 // var tags = input.replace(/[^a-zA-Z0-9]/g,","); |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
274 // url += tags; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
275 url += input; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
276 |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
277 /* test for csv flag in request parameters (see datasources.json) */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
278 var beginCsv = url.indexOf("csv=true"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
279 if (beginCsv != -1) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
280 /* remove "csv=true" from request parameters */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
281 url = url.substr(0, beginCsv) + url.substr(beginCsv + 9); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
282 /* convert csv to kml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
283 this.parseCsv(url,input,ds); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
284 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
285 else { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
286 /* parse kml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
287 this.parseKml(url,input,ds); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
288 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
289 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
290 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
291 parseIt: function(xml,term,ds){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
292 var getTimeData = function( timeString ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
293 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
294 var bc = false; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
295 if( timeString.startsWith("-") ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
296 bc = true; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
297 timeString = timeString.substring(1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
298 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
299 var timeSplit = timeString.split("T"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
300 var timeData = timeSplit[0].split("-"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
301 for (var i = 0; i < timeData.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
302 parseInt(timeData[i]); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
303 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
304 if( bc ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
305 timeData[0] = "-"+timeData[0]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
306 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
307 if (timeSplit.length == 1) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
308 return timeData; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
309 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
310 var dayData; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
311 if (timeSplit[1].indexOf("Z") != -1) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
312 dayData = timeSplit[1].substring(0, timeSplit[1].indexOf("Z") - 1).split(":"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
313 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
314 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
315 dayData = timeSplit[1].substring(0, timeSplit[1].indexOf("+") - 1).split(":"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
316 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
317 for (var i = 0; i < timeData.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
318 parseInt(dayData[i]); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
319 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
320 return timeData.concat(dayData); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
321 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
322 catch (exception) { |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
323 alert("\""+timeString+"\" is no valid time/date"); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
324 return null; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
325 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
326 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
327 |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
328 var core = this; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
329 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
330 var time = SimileAjax.DateTime; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
331 var newObjects = new Array(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
332 var elements = xml.getElementsByTagName("Placemark"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
333 var granularity = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
334 |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
335 if( elements.length == 0 ){ |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
336 this.unblockUI(); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
337 return; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
338 } |
73
02cdf454d94b
only create XLMSerializer once per dataset parsing
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
72
diff
changeset
|
339 |
02cdf454d94b
only create XLMSerializer once per dataset parsing
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
72
diff
changeset
|
340 var xmlSerializer = new XMLSerializer(); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
341 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
342 for (var i = 0; i < elements.length; i++) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
343 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
344 var placemark = elements[i]; |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
345 var name, description, descriptionData, place, timeData, coordinates, timeStamp, timeSpan, g; |
29
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
346 |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
347 try{ |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
348 var nameElement = placemark.getElementsByTagName("name"); |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
349 if ( (nameElement != null) && (nameElement.length > 0) && (nameElement[0].childNodes.length > 0) ){ |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
350 name = nameElement[0].childNodes[0].nodeValue; |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
351 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
352 else { |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
353 name = ""; |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
354 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
355 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
356 name = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
357 } |
29
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
358 |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
359 try{ |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
360 var descriptionElement = placemark.getElementsByTagName("description"); |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
361 if ( (descriptionElement != null) && (descriptionElement.length > 0) && (descriptionElement[0].childNodes.length > 0) ){ |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
362 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
363 description = $(descriptionElement).text(); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
364 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
365 //check whether the description element contains a table |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
366 //if yes, this data will be loaded as separate columns |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
367 try{ |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
368 //cleanWhitespace removes non-sense text-nodes (space, tab) |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
369 //and is an addition to jquery defined in Sti.html |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
370 var descriptionDocument = $($.parseXML(description)).cleanWhitespace(); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
371 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
372 descriptionData = new Object(); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
373 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
374 $(descriptionDocument).find("tr").each( |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
375 function() { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
376 var isHeader = true; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
377 var lastHeader = ""; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
378 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
379 $(this).find("td").each( |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
380 function() { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
381 if (isHeader) { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
382 lastHeader = $(this).text(); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
383 isHeader = false; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
384 } else { |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
385 var value = ""; |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
386 |
72
4d3df00f5b98
added comments for HTML content in cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
387 //if this td contains HTML, serialize all |
4d3df00f5b98
added comments for HTML content in cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
388 //it's children (the "content"!) |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
389 $(this).children().each( |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
390 function() { |
73
02cdf454d94b
only create XLMSerializer once per dataset parsing
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
72
diff
changeset
|
391 value += xmlSerializer.serializeToString(this); |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
392 } |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
393 ); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
394 |
72
4d3df00f5b98
added comments for HTML content in cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
395 //no HTML content (or no content at all) |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
396 if (value.length == 0) |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
397 value = $(this).text(); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
398 |
70
e6b72868e395
Allow more than one field of the same name (append the content)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
399 if (descriptionData[lastHeader] != null) |
e6b72868e395
Allow more than one field of the same name (append the content)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
400 //append if a field occures more than once |
e6b72868e395
Allow more than one field of the same name (append the content)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
401 descriptionData[lastHeader] += "\n" + value; |
e6b72868e395
Allow more than one field of the same name (append the content)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
402 else |
e6b72868e395
Allow more than one field of the same name (append the content)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
403 descriptionData[lastHeader] = value; |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
404 isHeader = true; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
405 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
406 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
407 ) |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
408 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
409 ); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
410 } catch(e) { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
411 //Description is either no HTML or no table |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
412 alert(e); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
413 } |
29
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
414 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
415 else { |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
416 description = ""; |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
417 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
418 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
419 description = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
420 } |
29
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
421 |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
422 try{ |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
423 var placeElement = placemark.getElementsByTagName("address"); |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
424 if ( (placeElement != null) && (placeElement.length > 0) && (placeElement[0].childNodes.length > 0) ){ |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
425 place = placeElement[0].childNodes[0].nodeValue; |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
426 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
427 else { |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
428 place = ""; |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
429 } |
4711c4ab0c23
Improved robustness of KML parsing (with Firefox and probably other browsers a missing node can lead to a NullPointerException that will not be catched by the try/catch)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
18
diff
changeset
|
430 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
431 place = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
432 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
433 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
434 var getDate = function(timeData){ |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
435 try { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
436 var date; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
437 if (timeData.length == 6) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
438 g = time.SECOND; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
439 date = new Date(Date.UTC(timeData[0], timeData[1]-1, timeData[2], timeData[3], timeData[4], timeData[5])); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
440 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
441 else if (timeData.length == 3) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
442 g = time.DAY; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
443 date = new Date(Date.UTC(timeData[0], timeData[1]-1, timeData[2])); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
444 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
445 else if (timeData.length == 2) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
446 g = time.MONTH; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
447 date = new Date(Date.UTC(timeData[0], timeData[1]-1, 1)); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
448 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
449 else if (timeData.length == 1) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
450 g = time.YEAR; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
451 date = new Date(Date.UTC(timeData[0], 0, 1)); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
452 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
453 if (granularity < g) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
454 granularity = g; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
455 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
456 if( timeData[0] && timeData[0] < 100 ){ |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
457 date.setFullYear(timeData[0]); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
458 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
459 return date; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
460 } catch (e) { |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
461 alert("\""+timeData+"\" is no valid time/date"); |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
462 return null; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
463 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
464 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
465 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
466 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
467 timeData = getTimeData( placemark.getElementsByTagName("TimeStamp")[0].getElementsByTagName("when")[0].childNodes[0].nodeValue ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
468 if( timeData != null ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
469 timeStamp = getDate(timeData); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
470 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
471 if( timeStamp == undefined ){ |
66
c7df41c5de53
Alerts on missing time/spatial information
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
472 alert("No valid timestamp or timespan information for element " + i + "."); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
473 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
474 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
475 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
476 catch(e){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
477 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
478 timeStamp = undefined; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
479 var timeSpanTag = placemark.getElementsByTagName("TimeSpan")[0]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
480 var timeDataStart = getTimeData( timeSpanTag.getElementsByTagName("begin")[0].childNodes[0].nodeValue ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
481 var startTime = getDate(timeDataStart); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
482 var timeDataEnd = getTimeData( timeSpanTag.getElementsByTagName("end")[0].childNodes[0].nodeValue ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
483 var endTime = getDate(timeDataEnd); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
484 timeSpan = { start: startTime, end: endTime }; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
485 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
486 catch(e){ |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
487 alert("No valid timestamp or timespan information for element " + i + "."); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
488 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
489 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
490 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
491 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
492 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
493 coordinates = placemark.getElementsByTagName("Point")[0].getElementsByTagName("coordinates")[0].childNodes[0].nodeValue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
494 var lonlat = coordinates.split(","); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
495 if( lonlat[0] == "" || lonlat[1] == "" || isNaN(lonlat[0]) || isNaN(lonlat[1]) ){ |
66
c7df41c5de53
Alerts on missing time/spatial information
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
496 alert("No valid coordinate information for element " + i + "."); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
497 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
498 } |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
66
diff
changeset
|
499 newObjects.push(new DataObject(name, description, place, timeStamp, timeSpan, g, lonlat[0], lonlat[1], descriptionData)); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
500 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
501 catch(e){ |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
502 alert("No valid coordinate information for element " + i + "."); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
503 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
504 } |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
505 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
506 |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
507 var dataset = new DataSet( newObjects, term, granularity ); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
508 dataset.source = ds; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
509 var status = document.getElementById("statusText"); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
510 status.innerHTML = "Space & Time Aggregation ..."; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
511 setTimeout( function(){ |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
512 core.addDataSet( dataset ); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
513 core.unblockUI(); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
514 }, |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
515 1 ); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
516 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
517 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
518 /** |
32
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
519 * retrieves and loads a kml-file from the local system |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
520 * |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
521 * @param {int} |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
522 * ds the datasource index |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
523 * @param {File} |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
524 * file the file that the user selected |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
525 */ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
526 retrieveLocalKml: function(ds,filename){ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
527 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
528 var core = this; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
529 if( this.blocked ){ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
530 setTimeout( function(){ core.retrieveLocalKml(ds,filename); }, 100 ); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
531 return; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
532 } |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
533 core.blockUI(); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
534 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
535 var status = document.getElementById("statusText"); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
536 status.innerHTML = "Retrieving Data ..."; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
537 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
538 var filelist = $('#localKMLFileChooser').get(0).files; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
539 if (filelist.length > 0){ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
540 var file = filelist[0]; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
541 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
542 var reader = new FileReader(); |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
543 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
544 reader.onloadend = (function(theFile) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
545 return function(e) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
546 status.innerHTML = "Parsing Data ..."; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
547 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
548 var localkmlDoc; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
549 try { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
550 localkmlDoc = $.parseXML(reader.result); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
551 } catch (e) { |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
552 alert("KML file is not valid XML. Please check opening/closing tags and check the spelling."); |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
553 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
554 core.unblockUI(); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
555 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
556 return; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
557 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
558 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
559 setTimeout( function(){ core.parseIt(localkmlDoc,filename,ds); }, 1 ); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
560 }; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
561 })(file); |
32
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
562 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
563 reader.readAsText(file); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
564 } |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
565 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
566 return; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
567 }, |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
568 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
569 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
570 * parses the kml-file which includes the results for a given search request |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
571 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
572 * @param {File} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
573 * kmlFile |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
574 * @param {String} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
575 * term the term identifier for the resulting dataset |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
576 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
577 parseKml: function(kmlFile,term,ds){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
578 var core = this; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
579 if( this.blocked ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
580 setTimeout( function(){ core.parseKml(kmlFile,term,ds); }, 100 ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
581 return; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
582 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
583 core.blockUI(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
584 $.ajax({ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
585 url: kmlFile, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
586 dataType: "xml", |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
587 beforeSend: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
588 var status = document.getElementById("statusText"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
589 status.innerHTML = "Retrieving Data ..."; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
590 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
591 success: function(xml){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
592 var status = document.getElementById("statusText"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
593 status.innerHTML = "Parsing Data ..."; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
594 setTimeout( function(){ core.parseIt(xml,term,ds); }, 1 ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
595 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
596 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
597 }, |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
598 |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
599 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
600 * converts the csv-file, then parses the kml-file which includes the |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
601 * results for a given search request |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
602 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
603 * @param {File} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
604 * csvFile |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
605 * @param {String} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
606 * term the term identifier for the resulting dataset |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
607 */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
608 parseCsv: function(csvFile,term,ds){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
609 var core = this; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
610 if( this.blocked ){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
611 setTimeout( function(){ core.parseCsv(csvFile,term,ds); }, 100 ); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
612 return; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
613 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
614 core.blockUI(); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
615 $.ajax({ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
616 url: csvFile, |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
617 dataType: "text", |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
618 beforeSend: function(){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
619 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
620 status.innerHTML = "Retrieving Data ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
621 }, |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
622 success: function(text){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
623 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
624 status.innerHTML = "Converting CSV to KML ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
625 /* convert here from csv to kml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
626 var kmlString = '<?xml version="1.0" standalone="yes"?>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
627 kmlString += '<kml xmlns="http://www.opengis.com/kml/ext/2.2">\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
628 kmlString += '\t<Folder>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
629 /* define expected csv table headers (first line) */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
630 var expectedHeaders = new Array("Name","Address","Description","Longitude","Latitude","TimeStamp","TimeSpan:begin","TimeSpan:end"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
631 /* convert csv string to array of arrays using ucsv library */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
632 var csvArray = CSV.csvToArray(text); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
633 /* get real used table headers from csv file (first line) */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
634 var usedHeaders = csvArray[0]; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
635 /* loop outer array, begin with second line */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
636 for (var i = 1; i < csvArray.length; i++) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
637 var innerArray = csvArray[i]; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
638 kmlString += '\t\t<Placemark>\n'; |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
639 /* declare few variables */ |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
640 var timespanBegin = ""; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
641 var timespanEnd = ""; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
642 var longitude = ""; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
643 var latitude = ""; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
644 /* loop inner array */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
645 for (var j = 0; j < innerArray.length; j++) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
646 /* Name */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
647 if (usedHeaders[j] == expectedHeaders[0]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
648 kmlString += '\t\t\t<name>' + innerArray[j] + '</name>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
649 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
650 /* Address */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
651 if (usedHeaders[j] == expectedHeaders[1]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
652 kmlString += '\t\t\t<address>' + innerArray[j] + '</address>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
653 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
654 /* Description */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
655 if (usedHeaders[j] == expectedHeaders[2]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
656 kmlString += '\t\t\t<description>' + innerArray[j] + '</description>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
657 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
658 /* TimeStamp */ |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
659 if (usedHeaders[j] == expectedHeaders[5]) { |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
660 kmlString += '\t\t\t<TimeStamp>\n' + |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
661 '\t\t\t\t<when>' + innerArray[j] + '</when>\n' + |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
662 '\t\t\t</TimeStamp>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
663 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
664 /* TimeSpan:begin */ |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
665 if (usedHeaders[j] == expectedHeaders[6]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
666 timespanBegin = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
667 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
668 /* TimeSpan:end */ |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
669 if (usedHeaders[j] == expectedHeaders[7]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
670 timespanEnd = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
671 } |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
672 /* Longitude */ |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
673 if (usedHeaders[j] == expectedHeaders[3]) { |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
674 longitude = innerArray[j]; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
675 } |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
676 /* Latitude */ |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
677 if (usedHeaders[j] == expectedHeaders[4]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
678 latitude = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
679 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
680 } |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
681 /* set timespan:begin und timespan:end */ |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
682 kmlString += '\t\t\t<TimeSpan>\n' + |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
683 '\t\t\t\t<begin>' + timespanBegin + '</begin>\n' + |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
684 '\t\t\t\t<end>' + timespanEnd + '</end>\n' + |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
685 '\t\t\t</TimeSpan>\n'; |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
686 /* set longitude and latitude */ |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
687 kmlString += '\t\t\t<Point>\n' + |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
688 '\t\t\t\t<coordinates>' + |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
689 longitude +',' + latitude + |
8
16d70389b24a
mc
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
7
diff
changeset
|
690 '</coordinates>\n' + |
16d70389b24a
mc
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
7
diff
changeset
|
691 '\t\t\t</Point>\n'; |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
692 /* end Placemark */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
693 kmlString += '\t\t</Placemark>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
694 } |
6
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
695 kmlString += '\t</Folder>\n'; |
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
696 kmlString += '</kml>\n'; |
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
697 console.log("kmlstring="+kmlString); |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
698 /* convert string to xml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
699 var kmlXml = $.parseXML(kmlString); |
6
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
700 console.log(kmlXml); |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
701 /* pares the converted kml data */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
702 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
703 status.innerHTML = "Parsing Data ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
704 setTimeout( function(){ core.parseIt(kmlXml,term,ds); }, 1 ); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
705 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
706 }); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
707 }, |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
708 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
709 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
710 * updates the timeplot and table element. its called from the STIMap |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
711 * object, when objects on the map had been selected by featureSelect or |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
712 * polygon. |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
713 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
714 * @param {boolean} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
715 * hover true, if there was a hover selection |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
716 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
717 updateTimeAndTable: function(hover){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
718 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
719 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
720 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
721 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
722 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
723 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
724 * updates the map, timeplot and table element. its called from the STITable |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
725 * object, when a text selection has been done |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
726 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
727 updateMapAndTimeAndTable: function(index){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
728 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
729 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
730 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
731 this.refining = index; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
732 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
733 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
734 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
735 * updates the timeplot and map element. its called from the STITable |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
736 * object, when objects in one of the tables had been selected. |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
737 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
738 updateTimeAndMap: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
739 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
740 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
741 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
742 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
743 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
744 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
745 * updates the table and map element. its called from the STITimeplot |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
746 * object, when objects in the timeplot had been selected by timestamp or |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
747 * -range. |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
748 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
749 * @param {boolean} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
750 * hover true, if there was a hover selection |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
751 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
752 updateTableAndMap: function(hover){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
753 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
754 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
755 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
756 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
757 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
758 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
759 * initializes the sti components (map, timeplot, table) depending on the |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
760 * top masks of the data sets. its called after a new search was performed, |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
761 * refining or undo button had been clicked |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
762 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
763 initElements: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
764 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
765 var dataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
766 var granularity = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
767 for( var i=0; i<dataSets.length; i++ ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
768 if( dataSets[i].maxGranularity > granularity ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
769 granularity = dataSets[i].maxGranularity; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
770 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
771 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
772 this.timeplot.initTimeplot(dataSets, granularity); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
773 this.map.initObjectLayer(dataSets); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
774 initTables(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
775 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
776 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
777 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
778 * deletes a data set with specific index |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
779 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
780 * @param {int} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
781 * index the index of the data set to delete |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
782 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
783 deleteDataSet: function(index){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
784 var color = colors[index]; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
785 colors.splice(index, 1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
786 var oldDataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
787 var newDataSets = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
788 for( var i=0; i<oldDataSets.length; i++ ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
789 if( i != index ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
790 newDataSets.push( oldDataSets[i] ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
791 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
792 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
793 colors.splice( newDataSets.length, 0, color ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
794 this.addHistoryEntry(new HistoryEntry(newDataSets)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
795 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
796 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
797 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
798 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
799 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
800 * Switches to another history entry with the given index |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
801 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
802 * @param {int} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
803 * index the index of the history entry to load |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
804 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
805 switchThroughHistory: function( index ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
806 this.historyIndex = index; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
807 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
808 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
809 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
810 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
811 * Adds a new history entry containing actual datasets |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
812 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
813 * @param {HistoryEntry} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
814 * historyEntry the history entry to add |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
815 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
816 addHistoryEntry: function( historyEntry ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
817 this.history = this.history.slice(0,this.historyIndex+1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
818 this.history.push(historyEntry); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
819 this.historyIndex = this.history.length - 1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
820 addHistoryItem(this.historyIndex); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
821 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
822 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
823 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
824 * adds an element to the user individual data set |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
825 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
826 * @param {DataObject} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
827 * object the data object to add |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
828 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
829 addElement: function(object){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
830 if (this.individualDataSet == null) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
831 this.individualDataSet = new DataSet([], "individual", 0); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
832 var oldDataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
833 var newDataSets = oldDataSets.concat(this.individualDataSet); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
834 this.addHistoryEntry(new HistoryEntry(newDataSets)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
835 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
836 this.individualDataSet.addObject(object); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
837 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
838 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
839 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
840 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
841 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
842 * resets the core within all elements and data objects to |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
843 * non-selection-status |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
844 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
845 reset: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
846 this.refining = -2; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
847 var dataSets = this.history[this.historyIndex].dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
848 for (var i = 0; i < dataSets.length; i++){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
849 for (var j = 0; j < dataSets[i].objects.length; j++){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
850 dataSets[i].objects[j].setPercentage(0); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
851 dataSets[i].objects[j].setHover(false); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
852 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
853 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
854 this.timeplot.resetTimeplot(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
855 this.map.resetMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
856 updateTables(false); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
857 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
858 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
859 /** |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
860 * Security hover unselection of elements if browser events got stucked |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
861 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
862 undoHover: function(update){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
863 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
864 this.map.hoverUnselect(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
865 this.timeplot.hoverUnselect(update); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
866 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
867 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
868 createLink: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
869 var c = this.map.openlayersMap.getCenter(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
870 var map = this.map.openlayersMap.baseLayer.id; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
871 var mapCenter = { lon: c.lon, lat: c.lat }; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
872 var mapZoom = this.map.openlayersMap.getZoom(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
873 var data = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
874 // store complete history in data --> flow of history events |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
875 // history event can be: loading/deleting dataset, refinement by |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
876 // timerange/polygon at specific zoom level/point at specific zoom |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
877 // level, a loaded link history (this) |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
878 // flag for the ability to display stored history or not |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
879 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
880 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
881 lockScreen: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
882 this.lockScreenContainer.style.visibility = "visible"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
883 this.lockScreenContainer.style.height = getDocHeight()+"px"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
884 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
885 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
886 lockScreenMessage: function(div){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
887 this.lockScreenContainer.innerHTML = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
888 var lockScreenDiv = document.createElement("div"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
889 lockScreenDiv.setAttribute('class','lockScreen'); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
890 this.lockScreenContainer.appendChild(lockScreenDiv); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
891 this.lockScreenContainer.appendChild(div); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
892 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
893 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
894 unlockScreen: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
895 this.lockScreenContainer.style.visibility = "hidden"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
896 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
897 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
898 }; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
899 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
900 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
901 * defines a history entry |
7
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
902 * |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
903 * @param {DataSet[]} |
4fb15c3e0e89
- added some robustness: timespan and longitude/latitude values must not be ordered anymore.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
6
diff
changeset
|
904 * dataSets the datasets of this history entry |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
905 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
906 * @constructor |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
907 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
908 function HistoryEntry( dataSets ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
909 this.dataSets = dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
910 }; |