p (Tekstin korvaus – ”jQuery(window).load( function() { <!--{$id|default:AlgalWeekMap|escape:'html'}-->_func(); }); ” muotoon ”function <!--{$id|default:AlgalWeekMap|escape:'html'}-->_jQueryTest() { if ( typeof window.jQuery == 'undefined' ) { ) |
Ei muokkausyhteenvetoa |
||
| (19 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 1: | Rivi 1: | ||
<includeonly> | <includeonly> | ||
<link rel="stylesheet" href=" | <link rel="stylesheet" href="/scripts/ol-10/ol.css" type="text/css"> | ||
<script src="/scripts/ol-10/ol.js"></script> | |||
<link rel="stylesheet" href=" | <link rel="stylesheet" href="/scripts/ol-ext-10/dist/ol-ext.min.css" type="text/css"> | ||
<script src=" | <script src="/scripts/ol-ext-10/dist/ol-ext.min.js"></script> | ||
<script src=" | <script src="/scripts/proj4js/dist/proj4.js"></script> | ||
<script src=" | <script src="/scripts/jwol10js/jwol10.js"></script> | ||
<div class="jwMapContainer" style="height:<!--{$height|default: | <div class="jwMapContainer" style="height:<!--{$height|default:500px|escape:'html'}-->" > | ||
<div style="height: 100%; width: 100%; position: relative;" id="<!--{$id|default:AlgalWeekMap|escape:'html'}-->_container"></div> | <div style="height: 100%; width: 100%; position: relative;" id="<!--{$id|default:AlgalWeekMap|escape:'html'}-->_container"></div> | ||
</div> | </div> | ||
| Rivi 41: | Rivi 38: | ||
var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | ||
var base = "<!--{$base|default:osm|escape:'html'}-->"; | var base = "<!--{$base|default:osm|escape:'html'}-->"; | ||
var baselayers = "<!--{$baselayers|default:x|escape:'html'}-->"; | |||
var baselayersA = baselayers.split( ',' ); | |||
var vesifi = ( "<!--{$vesifi|default:no|escape:'html'}-->" == "yes" ); | |||
var year = parseInt('<!--{$vuosi|default:4|escape:'html'}-->'); | var year = parseInt('<!--{$vuosi|default:4|escape:'html'}-->'); | ||
| Rivi 52: | Rivi 52: | ||
memo.a = {}; | memo.a = {}; | ||
memo.b = {}; | memo.b = {}; | ||
var showregions = false; | |||
for ( var bl in baselayersA ) { | |||
if ( baselayersA[ bl ] == 'regions' ) { showregions = true; } | |||
} | |||
if ( showregions ) { | |||
layersArr.push( { | |||
//'id': 'reagions', | |||
'type': 'anygeo', | |||
'name': 'Maakunnat', | |||
'restUrl': '//geo.stat.fi/geoserver/tilastointialueet/', | |||
'layer': 'tilastointialueet:maakunta1000k', | |||
//'cql_filter': "tilastointialueet:nimi = '" + short + "'", | |||
'selectable': false, | |||
//'zoomToExtent': true, | |||
'fillColor': 'transparent', | |||
'bbox': false, | |||
//'attribution': '<a href="//wwwp2.ymparisto.fi/kayttoehdot.html">Ympäristöhallinnon paikkatietoaineistot</a>', | |||
}); | |||
} | |||
layersArr.push( { | layersArr.push( { | ||
| Rivi 64: | Rivi 85: | ||
'pointRadius': 3, | 'pointRadius': 3, | ||
'label': '', | 'label': '', | ||
'fillColor': '#ccc', | 'fillColor': '#ccc', | ||
'strokeColor': '#ccc', | 'strokeColor': '#ccc', | ||
'zoomToExtent': false | 'zoomToExtent': false | ||
} ); | } ); | ||
var startDate = firstDayOfWeek (year, week); | |||
var endDate = new Date( startDate.getTime() ); | |||
endDate.setDate( endDate.getDate() + 7 ); | |||
layersArr.push({ | |||
'type': 'coo311', | |||
'name': 'Vesi.fi-havainnot', | |||
'service_code': 'algaebloom_service_code_201808151546171', | |||
'hashtags': '_VesiFiObservation', | |||
'startDate': startDate, | |||
'endDate': endDate, | |||
'opacitySlider': false, | |||
'selectable': true, | |||
'clustered': false, | |||
'pointRadius': 8, | |||
'obsesColors': { type: 'cat', 'attribute': 'algaebloom_singlevaluelist_201808151546174', values: [ { key: 1, color: '#308fb3' }, { key: 2, color: '#8db335' }, { key: 3, color: '#f1cb00' }, { key: 4, color: '#ce0000' } ] }, | |||
'obstypebar': false, | |||
'zoomToExtent': false, | |||
'visible': true | |||
}); | |||
layersArr.push({ | |||
'type': 'sitesNobses', | |||
'name': 'Kansalaishavainnot', | |||
'siteSearch': '', | |||
'obsSearch': '[[Vuosi::' + year.toString() + ']][[Viikko::' + week.toString() + ']][[ObsCode::alg]][[Seuranta::!Valtakunnallinen leväseuranta]]', | |||
'opacitySlider': false, | |||
'selectable': true, | |||
'clustered': false, | |||
'obstypebar': false, | |||
'zoomToExtent': false, | |||
'visible': true | |||
}); | |||
layersArr.push({ | layersArr.push({ | ||
'memo': memo.b, | 'memo': memo.b, | ||
| Rivi 121: | Rivi 176: | ||
}); | }); | ||
// do the base map with these settings | // do the base map with these settings | ||
var map = | var map = jwMakeMap({ | ||
'container': '<!--{$id|default:AlgalWeekMap|escape:'html'}-->_container', | 'container': '<!--{$id|default:AlgalWeekMap|escape:'html'}-->_container', | ||
'base': base, | 'base': base, | ||


