Mercurial > hg > STI-GWT
annotate war/scripts/sti/STICore.js @ 72:4d3df00f5b98 trimmed_data
added comments for HTML content in cells
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 11 Jan 2013 10:15:45 +0100 |
parents | a610b45d0f90 |
children | 02cdf454d94b |
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 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
339 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
340 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
|
341 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
342 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
|
343 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
|
344 |
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
|
345 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
|
346 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
|
347 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
|
348 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
|
349 } |
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 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
|
351 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
|
352 } |
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 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
354 name = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
355 } |
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
|
356 |
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
|
357 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
|
358 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
|
359 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
|
360 |
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
|
361 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
|
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 //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
|
364 //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
|
365 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
|
366 //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
|
367 //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
|
368 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
|
369 |
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 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
|
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 $(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
|
373 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
|
374 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
|
375 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
|
376 |
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 $(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
|
378 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
|
379 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
|
380 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
|
381 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
|
382 } else { |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
383 var value = ""; |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
384 |
72
4d3df00f5b98
added comments for HTML content in cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
385 //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
|
386 //it's children (the "content"!) |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
387 $(this).children().each( |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
388 function() { |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
389 value += (new XMLSerializer()).serializeToString(this); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
390 } |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
391 ); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
392 |
72
4d3df00f5b98
added comments for HTML content in cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
393 //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
|
394 if (value.length == 0) |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
395 value = $(this).text(); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
70
diff
changeset
|
396 |
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
|
397 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
|
398 //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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 } |
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 } |
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 } 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
|
409 //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
|
410 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
|
411 } |
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
|
412 } |
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
|
413 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
|
414 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
|
415 } |
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 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
417 description = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
418 } |
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
|
419 |
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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 } |
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 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
|
426 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
|
427 } |
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 } catch(e) { |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
429 place = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
430 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
431 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
432 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
|
433 try { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
434 var date; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
435 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
|
436 g = time.SECOND; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
437 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
|
438 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
439 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
|
440 g = time.DAY; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
441 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
|
442 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
443 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
|
444 g = time.MONTH; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
445 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
|
446 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
447 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
|
448 g = time.YEAR; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
449 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
|
450 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
451 if (granularity < g) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
452 granularity = g; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
453 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
454 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
|
455 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
|
456 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
457 return date; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
458 } catch (e) { |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
459 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
|
460 return null; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
461 } |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
462 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
463 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
464 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
465 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
|
466 if( timeData != null ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
467 timeStamp = getDate(timeData); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
468 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
469 if( timeStamp == undefined ){ |
66
c7df41c5de53
Alerts on missing time/spatial information
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
470 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
|
471 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
472 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
473 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
474 catch(e){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
475 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
476 timeStamp = undefined; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
477 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
|
478 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
|
479 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
|
480 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
|
481 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
|
482 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
|
483 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
484 catch(e){ |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
485 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
|
486 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
487 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
488 } |
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 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
491 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
|
492 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
|
493 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
|
494 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
|
495 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
496 } |
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
|
497 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
|
498 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
499 catch(e){ |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
500 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
|
501 continue; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
502 } |
33
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
503 } |
3
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 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
|
506 dataset.source = ds; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
507 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
|
508 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
|
509 setTimeout( function(){ |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
510 core.addDataSet( dataset ); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
511 core.unblockUI(); |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
512 }, |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
513 1 ); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
514 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
515 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
516 /** |
32
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
517 * 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
|
518 * |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
519 * @param {int} |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
520 * ds the datasource index |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
521 * @param {File} |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
522 * file the file that the user selected |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
523 */ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
524 retrieveLocalKml: function(ds,filename){ |
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 var core = this; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
527 if( this.blocked ){ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
528 setTimeout( function(){ core.retrieveLocalKml(ds,filename); }, 100 ); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
529 return; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
530 } |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
531 core.blockUI(); |
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 var status = document.getElementById("statusText"); |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
534 status.innerHTML = "Retrieving Data ..."; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
535 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
536 var filelist = $('#localKMLFileChooser').get(0).files; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
537 if (filelist.length > 0){ |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
538 var file = filelist[0]; |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
539 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
540 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
|
541 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
542 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
|
543 return function(e) { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
544 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
|
545 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
546 var localkmlDoc; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
547 try { |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
548 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
|
549 } catch (e) { |
60
6f2d2b6f969a
Fix KML parser alerts
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
33
diff
changeset
|
550 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
|
551 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
552 core.unblockUI(); |
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 return; |
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 |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
557 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
|
558 }; |
24c45a9048f2
corrected FileReader usage (onloaded callback) for local KML support
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
32
diff
changeset
|
559 })(file); |
32
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
560 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
561 reader.readAsText(file); |
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 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
564 return; |
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 |
f635bbdc6a03
local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
29
diff
changeset
|
567 /** |
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
|
568 * 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
|
569 * |
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 * @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
|
571 * 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
|
572 * @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
|
573 * 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
|
574 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
575 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
|
576 var core = this; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
577 if( this.blocked ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
578 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
|
579 return; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
580 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
581 core.blockUI(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
582 $.ajax({ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
583 url: kmlFile, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
584 dataType: "xml", |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
585 beforeSend: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
586 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
|
587 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
|
588 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
589 success: function(xml){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
590 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
|
591 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
|
592 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
|
593 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
594 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
595 }, |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
596 |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
597 /** |
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
|
598 * 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
|
599 * 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
|
600 * |
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 * @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
|
602 * 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
|
603 * @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
|
604 * 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
|
605 */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
606 parseCsv: function(csvFile,term,ds){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
607 var core = this; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
608 if( this.blocked ){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
609 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
|
610 return; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
611 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
612 core.blockUI(); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
613 $.ajax({ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
614 url: csvFile, |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
615 dataType: "text", |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
616 beforeSend: function(){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
617 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
618 status.innerHTML = "Retrieving Data ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
619 }, |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
620 success: function(text){ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
621 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
622 status.innerHTML = "Converting CSV to KML ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
623 /* convert here from csv to kml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
624 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
|
625 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
|
626 kmlString += '\t<Folder>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
627 /* define expected csv table headers (first line) */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
628 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
|
629 /* 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
|
630 var csvArray = CSV.csvToArray(text); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
631 /* 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
|
632 var usedHeaders = csvArray[0]; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
633 /* loop outer array, begin with second line */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
634 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
|
635 var innerArray = csvArray[i]; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
636 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
|
637 /* 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
|
638 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
|
639 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
|
640 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
|
641 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
|
642 /* loop inner array */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
643 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
|
644 /* Name */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
645 if (usedHeaders[j] == expectedHeaders[0]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
646 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
|
647 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
648 /* Address */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
649 if (usedHeaders[j] == expectedHeaders[1]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
650 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
|
651 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
652 /* Description */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
653 if (usedHeaders[j] == expectedHeaders[2]) { |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
654 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
|
655 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
656 /* 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
|
657 if (usedHeaders[j] == expectedHeaders[5]) { |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
658 kmlString += '\t\t\t<TimeStamp>\n' + |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
659 '\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
|
660 '\t\t\t</TimeStamp>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
661 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
662 /* 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
|
663 if (usedHeaders[j] == expectedHeaders[6]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
664 timespanBegin = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
665 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
666 /* 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
|
667 if (usedHeaders[j] == expectedHeaders[7]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
668 timespanEnd = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
669 } |
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
|
670 /* 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
|
671 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
|
672 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
|
673 } |
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 /* 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
|
675 if (usedHeaders[j] == expectedHeaders[4]) { |
10
bcc91da76221
fixed bug with timespans.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
9
diff
changeset
|
676 latitude = innerArray[j]; |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
677 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
678 } |
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
|
679 /* 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
|
680 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
|
681 '\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
|
682 '\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
|
683 '\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
|
684 /* 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
|
685 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
|
686 '\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
|
687 longitude +',' + latitude + |
8
16d70389b24a
mc
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
7
diff
changeset
|
688 '</coordinates>\n' + |
16d70389b24a
mc
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
7
diff
changeset
|
689 '\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
|
690 /* end Placemark */ |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
691 kmlString += '\t\t</Placemark>\n'; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
692 } |
6
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
693 kmlString += '\t</Folder>\n'; |
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
694 kmlString += '</kml>\n'; |
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
695 console.log("kmlstring="+kmlString); |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
696 /* convert string to xml */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
697 var kmlXml = $.parseXML(kmlString); |
6
7bf904a68ce7
- fixed xml creation bug
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
4
diff
changeset
|
698 console.log(kmlXml); |
4
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
699 /* pares the converted kml data */ |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
700 var status = document.getElementById("statusText"); |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
701 status.innerHTML = "Parsing Data ..."; |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
702 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
|
703 } |
517a6422d1bd
done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
3
diff
changeset
|
704 }); |
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 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
707 /** |
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
|
708 * 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
|
709 * 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
|
710 * 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
|
711 * |
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 * @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
|
713 * 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
|
714 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
715 updateTimeAndTable: function(hover){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
716 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
717 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
718 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
719 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
720 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
721 /** |
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
|
722 * 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
|
723 * 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
|
724 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
725 updateMapAndTimeAndTable: function(index){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
726 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
727 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
728 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
729 this.refining = index; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
730 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
731 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
732 /** |
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
|
733 * 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
|
734 * 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
|
735 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
736 updateTimeAndMap: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
737 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
738 this.timeplot.polesBySlices(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
739 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
740 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
741 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
742 /** |
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
|
743 * 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
|
744 * 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
|
745 * -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
|
746 * |
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 * @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
|
748 * 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
|
749 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
750 updateTableAndMap: function(hover){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
751 updateTables(hover); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
752 this.map.updateMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
753 this.refining = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
754 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
755 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
756 /** |
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
|
757 * 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
|
758 * 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
|
759 * 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
|
760 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
761 initElements: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
762 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
763 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
|
764 var granularity = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
765 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
|
766 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
|
767 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
|
768 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
769 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
770 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
|
771 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
|
772 initTables(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
773 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
774 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
775 /** |
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
|
776 * 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
|
777 * |
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 * @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
|
779 * 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
|
780 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
781 deleteDataSet: function(index){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
782 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
|
783 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
|
784 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
|
785 var newDataSets = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
786 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
|
787 if( i != index ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
788 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
|
789 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
790 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
791 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
|
792 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
|
793 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
794 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
795 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
796 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
797 /** |
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
|
798 * 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
|
799 * |
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 * @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
|
801 * 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
|
802 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
803 switchThroughHistory: function( index ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
804 this.historyIndex = index; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
805 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
806 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
807 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
808 /** |
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
|
809 * 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
|
810 * |
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 * @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
|
812 * 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
|
813 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
814 addHistoryEntry: function( historyEntry ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
815 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
|
816 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
|
817 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
|
818 addHistoryItem(this.historyIndex); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
819 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
820 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
821 /** |
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
|
822 * 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
|
823 * |
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 * @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
|
825 * 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
|
826 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
827 addElement: function(object){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
828 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
|
829 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
|
830 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
|
831 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
|
832 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
|
833 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
834 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
|
835 this.initElements(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
836 this.reset(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
837 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
838 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
839 /** |
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
|
840 * 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
|
841 * 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
|
842 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
843 reset: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
844 this.refining = -2; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
845 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
|
846 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
|
847 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
|
848 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
|
849 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
|
850 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
851 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
852 this.timeplot.resetTimeplot(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
853 this.map.resetMap(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
854 updateTables(false); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
855 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
856 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
857 /** |
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
|
858 * 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
|
859 */ |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
860 undoHover: function(update){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
861 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
862 this.map.hoverUnselect(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
863 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
|
864 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
865 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
866 createLink: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
867 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
|
868 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
|
869 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
|
870 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
|
871 var data = []; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
872 // 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
|
873 // 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
|
874 // 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
|
875 // 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
|
876 // 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
|
877 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
878 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
879 lockScreen: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
880 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
|
881 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
|
882 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
883 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
884 lockScreenMessage: function(div){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
885 this.lockScreenContainer.innerHTML = ""; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
886 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
|
887 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
|
888 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
|
889 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
|
890 }, |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
891 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
892 unlockScreen: function(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
893 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
|
894 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
895 |
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 * 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
|
900 * |
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
|
901 * @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
|
902 * 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
|
903 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
904 * @constructor |
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 function HistoryEntry( dataSets ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
907 this.dataSets = dataSets; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
908 }; |