Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 20: | Rivi 20: | ||
jQuery.getScript( "//www.jarviwiki.fi/citobsjs/jwapi.js", function() { | jQuery.getScript( "//www.jarviwiki.fi/citobsjs/jwapi.js", function() { | ||
jw = new jwApi(); | jw = new jwApi(); | ||
so = { 'obscode': 'alg||temp||ice||level||secchi', 'waterbody': page | so = { 'obscode': 'alg||temp||ice||level||secchi', 'waterbody': page, 'startdate': amonthago.toISOString() }; | ||
jw.loadObses( so, function( o ) { | jw.loadObses( so, function( o ) { | ||
| Rivi 30: | Rivi 30: | ||
jw.obstype = {}; | jw.obstype = {}; | ||
for ( var oi in jw.obsList ) { | for ( var oi in jw.obsList ) { | ||
var o = jw.obsList[oi]; | var o = jw.obsList[oi]; | ||
if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; } | console.log( o ); | ||
if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { newest: '', sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; } | |||
jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | ||
} | } | ||


